:root {
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #F8FAFC;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: env(safe-area-inset-bottom);
}

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

.card {
    border-radius: 12px;
}

.card:not(.modal-content):not(.modal .card) {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:not(.modal-content):not(.modal .card):hover {
    transform: translateY(-1px);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    padding: 0.6rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.navbar {
    padding: 0.75rem 0;
}

.navbar .app-brand {
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar .app-brand-logo {
    display: block;
    height: 70px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.navbar .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fixed-bottom .nav-link {
    font-size: 0.7rem;
}

.alert {
    border: none;
    border-radius: 10px;
}

#qr-reader {
    border-radius: 12px;
    overflow: hidden;
}

#qr-reader video {
    border-radius: 12px;
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 1.5px solid #E2E8F0;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .navbar .app-brand-logo {
        height: 42px;
        max-width: 150px;
    }

    h4 {
        font-size: 1.25rem;
    }

    .table {
        font-size: 0.85rem;
    }

    body {
        padding-bottom: 80px;
    }
}

@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }

    .navbar {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card:not(.modal-content):not(.modal .card),
.list-group-item:not(.modal .list-group-item) {
    animation: fadeIn 0.3s ease forwards;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
}
