﻿*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-height: 100dvh;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

a,
button,
.btn,
.nav-link,
.badge,
td,
th,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: anywhere;
}

.container,
.container-fluid {
    max-width: 100%;
}

.card,
.modal-content,
.pricing-card,
.ticket-card,
.ticket-display {
    max-width: 100%;
}

.btn,
button,
select,
textarea {
    min-height: 44px;
}

input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-width: 0;
}

.form-check .form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    min-width: 1.05rem;
    min-height: 1.05rem;
    margin-top: .25rem;
    margin-left: 0;
    flex: 0 0 auto;
}

.form-check .form-label,
.form-check .form-check-label {
    margin-bottom: 0;
    line-height: 1.35;
}

.btn {
    white-space: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0;
}

.table th,
.table td {
    white-space: nowrap;
}

.form-control,
.form-select {
    min-width: 0;
}

.header,
.filter-form,
.card-header,
.modal-footer {
    min-width: 0;
}

.kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

.kpi-card {
    min-width: 0;
}

.kpi-value {
    overflow-wrap: anywhere;
}

.swal2-popup {
    width: min(32rem, calc(100vw - 2rem)) !important;
}

@media (max-width: 991.98px) {
    body {
        height: auto !important;
        min-height: 100dvh !important;
    }

    .navbar-brand {
        max-width: calc(100vw - 96px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-collapse {
        padding-top: .75rem;
    }

    .navbar-nav {
        gap: .25rem;
    }

    .navbar .nav-link {
        padding: .75rem 0;
    }

    .hero-section {
        padding: 2.75rem 0 !important;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .pricing-card,
    .ticket-display {
        padding: 1.5rem !important;
        margin: 1.25rem 0 !important;
        border-radius: 16px !important;
    }

    .login-card,
    .card {
        max-width: 100%;
    }

    .floating-element,
    .floating-icon {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    .sidebar {
        width: min(82vw, 300px) !important;
        max-width: 300px;
        overflow-y: auto;
        padding-bottom: 1rem;
    }

    .sidebar-brand {
        font-size: 1.15rem !important;
        padding: 0 1rem 1rem !important;
        margin-bottom: .75rem !important;
    }

    .sidebar .nav-link {
        padding: .8rem 1rem !important;
        min-height: 44px;
    }

    .submenu {
        padding-left: 1.25rem !important;
    }

    .main-content > .d-md-none:first-child {
        position: sticky;
        top: .75rem;
        z-index: 900;
        margin-bottom: 1rem !important;
    }

    .container-fluid {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .header {
        flex-wrap: wrap;
        align-items: flex-start !important;
        gap: 1rem;
        margin-bottom: 1.25rem !important;
        padding-bottom: 1rem !important;
    }

    .page-title {
        font-size: 1.35rem !important;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .zone-selector {
        width: 100%;
        min-width: 0 !important;
    }

    .filter-form .row > [class*="col-"],
    form .row > [class*="col-"] {
        margin-bottom: .75rem;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    .card {
        border-radius: 12px !important;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 1rem !important;
    }

    .d-flex {
        min-width: 0;
    }

    .d-flex.flex-wrap,
    .d-flex.justify-content-between,
    .d-flex.align-items-center {
        gap: .75rem;
    }

    .btn,
    .btn-primary-custom,
    .btn-outline-neon {
        width: 100%;
        padding: .85rem 1rem !important;
    }

    .btn-group,
    .btn-group form,
    .btn-group .btn {
        width: 100%;
    }

    .btn-group {
        display: grid;
        gap: .5rem;
    }

    .modal-dialog {
        margin: .75rem;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        font-size: .875rem;
        padding: .65rem .75rem;
    }

    h1,
    .h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2,
    .h2 {
        font-size: 1.45rem;
        line-height: 1.25;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 2rem 0 !important;
    }

    .hero-title {
        font-size: 1.55rem !important;
    }

    .pricing-card,
    .ticket-display {
        padding: 1rem !important;
    }

    .ticket-container {
        width: 100% !important;
        margin: 1rem auto !important;
        padding: 0 .75rem !important;
    }

    .ticket-header {
        padding: 1.5rem 1rem !important;
    }

    .ticket-header h1 {
        font-size: 1.35rem !important;
    }

    .ticket-body {
        padding: 1rem !important;
    }

    .ticket-info {
        padding: 1rem !important;
    }

    .info-row {
        display: block !important;
        padding: .85rem 0 !important;
    }

    .info-label {
        display: block;
        margin-bottom: .35rem;
    }

    .info-value,
    .ticket-value {
        display: block;
        width: 100%;
        font-size: 1rem !important;
        word-break: break-word;
    }

    .action-buttons {
        gap: .75rem !important;
        margin-top: 1rem !important;
    }

    .qr-placeholder {
        width: min(150px, 70vw) !important;
        height: min(150px, 70vw) !important;
    }
}
