/* ============================================================
   Fatura App v5 - Complete Responsive Stylesheet
   Portuguese Invoice QR Code PWA
   ============================================================ */

/* ----------------------------------------------------------
   1. Reset & Base
   ---------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --primary: #1a56db;
    --primary-dark: #1040a0;
    --primary-light: #e8effc;
    --secondary: #6b7280;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --bg: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-light: #6b7280;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: 0.2s ease;
}

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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: 1.3;
}

p {
    margin: 0;
}

/* ----------------------------------------------------------
   2. Navbar
   ---------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: #ffffff;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 1rem;
}

.nav-brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-link {
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background var(--transition);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid #ffffff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-emoji {
    margin-right: 0.35rem;
}

.nav-text {
    /* Nav link text - hidden on mobile */
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        width: 100%;
        top: 60px;
        left: 0;
        background: var(--primary);
        padding: 0.5rem 0;
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1.25rem;
        border-radius: 0;
        width: 100%;
    }

    .nav-text {
        display: inline;
    }
}

/* ----------------------------------------------------------
   3. User Dropdown
   ---------------------------------------------------------- */
.nav-user {
    position: relative;
    margin-left: auto;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    transition: background var(--transition);
    font-size: 0.9rem;
}

.nav-user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.nav-user-name {
    font-weight: 500;
}

.nav-user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    min-width: 280px;
    display: none;
    z-index: 1100;
    overflow: hidden;
    border: 1px solid var(--border);
}

.nav-user-dropdown.show {
    display: block;
}

.nav-user-info {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.nav-user-info .name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.nav-user-info .email {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.nav-user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    transition: background var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.nav-user-item:hover {
    background: var(--bg);
    text-decoration: none;
}

.nav-user-logout {
    color: var(--danger) !important;
    font-weight: 500;
}

.nav-user-logout:hover {
    background: #fee2e2 !important;
}

.nav-user-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

/* ----------------------------------------------------------
   4. Container
   ---------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }
}

/* ----------------------------------------------------------
   5. Flash Messages
   ---------------------------------------------------------- */
.flash-message {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: opacity var(--transition);
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #059669;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #dc2626;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #d97706;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #2563eb;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.flash-close:hover {
    opacity: 1;
}

/* ----------------------------------------------------------
   6. Cards
   ---------------------------------------------------------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.card-body {
    padding: 1.25rem;
}

.card-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.card-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: color var(--transition), border-color var(--transition);
}

.card-tab:hover {
    color: var(--text);
}

.card-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ----------------------------------------------------------
   7. Tables
   ---------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: top;
}

tr:hover td {
    background: #f9fafb;
}

tr:last-child td {
    border-bottom: none;
}

/* ----------------------------------------------------------
   8. Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-info {
    background: var(--info);
    color: #ffffff;
}

.btn-info:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--secondary);
}

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------------------------------------------------
   9. Badges
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f3f4f6;
    color: var(--text-light);
}

/* ----------------------------------------------------------
   10. Forms
   ---------------------------------------------------------- */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text);
    background: #ffffff;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-light);
    padding: 0.25rem;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text);
}

/* ----------------------------------------------------------
   11. Stats Grid
   ---------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.stat-info p {
    font-size: 0.82rem;
    color: var(--text-light);
    margin: 0;
}

/* ----------------------------------------------------------
   12. Page Header
   ---------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* ----------------------------------------------------------
   13. Filters Bar
   ---------------------------------------------------------- */
.filters-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
    flex: 1;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filter-group .form-control {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
}

/* ----------------------------------------------------------
   14. Period Navigator
   ---------------------------------------------------------- */
.period-navigator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-display {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* ----------------------------------------------------------
   15. Auth Pages
   ---------------------------------------------------------- */
.auth-body {
    background: linear-gradient(135deg, #1a56db 0%, #1040a0 50%, #0c2d6b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-container-wide {
    max-width: 560px;
}

.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.auth-bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.auth-bg-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.auth-bg-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.auth-brand-name {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
}

.auth-brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.auth-card-header {
    padding: 1.5rem 1.75rem 1rem;
    text-align: center;
}

.auth-card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.auth-card-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.auth-form {
    padding: 0 1.75rem 1.75rem;
}

.auth-submit {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    justify-content: center;
}

.auth-footer {
    text-align: center;
    padding: 0 1.75rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.auth-error {
    margin: 0 1.75rem 0.5rem;
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius);
    font-size: 0.9rem;
    border: 1px solid #fca5a5;
}

.auth-info {
    margin: 0 1.75rem 0.5rem;
    padding: 0.75rem 1rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: var(--radius);
    font-size: 0.9rem;
    border: 1px solid #93c5fd;
}

/* ----------------------------------------------------------
   16. Type Selector (Registration)
   ---------------------------------------------------------- */
.tipo-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.tipo-option {
    cursor: pointer;
}

.tipo-option input {
    display: none;
}

.tipo-card {
    padding: 1.25rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color var(--transition), background var(--transition);
}

.tipo-option:hover .tipo-card {
    border-color: #93c5fd;
    background: #f9fafb;
}

.tipo-option.selected .tipo-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tipo-icon {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
    line-height: 1;
}

.tipo-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.tipo-desc {
    font-size: 0.78rem;
    color: var(--text-light);
}

.tipo-info-box {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.tipo-info-cliente {
    background: #f0fdf4;
    border-color: #86efac;
    color: #065f46;
}

.tipo-info-contabilista {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

/* ----------------------------------------------------------
   17. QR Result
   ---------------------------------------------------------- */
.qr-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.qr-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
    letter-spacing: 0.025em;
    font-weight: 500;
}

.qr-field span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    word-break: break-word;
}

/* ----------------------------------------------------------
   18. Upload Area
   ---------------------------------------------------------- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.upload-area-text {
    font-size: 0.95rem;
    color: var(--text-light);
}

.upload-area-text strong {
    color: var(--primary);
}

/* ----------------------------------------------------------
   19. Empty State
   ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
    line-height: 1;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ----------------------------------------------------------
   20. Justification Alert
   ---------------------------------------------------------- */
.justification-alert {
    padding: 1rem;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.justification-alert h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.justification-alert p {
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ----------------------------------------------------------
   21. Action Links
   ---------------------------------------------------------- */
.action-links {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------
   22. Mobile Responsive
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .qr-result-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.6rem 0.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .period-navigator {
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
    }

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

    .upload-area {
        padding: 2rem 1rem;
    }

    .tipo-selector {
        grid-template-columns: 1fr;
    }

    .auth-card-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .auth-form {
        padding: 0 1.25rem 1.25rem;
    }

    .auth-footer {
        padding: 0 1.25rem 1.25rem;
    }

    .auth-error,
    .auth-info {
        margin: 0 1.25rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.15rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }
}

/* ----------------------------------------------------------
   23. Print
   ---------------------------------------------------------- */
@media print {
    .navbar,
    .flash-message,
    .flash-close,
    .btn,
    .btn-group,
    .no-print,
    .nav-toggle,
    .filters-bar,
    .period-navigator,
    .action-links {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        border: 1px solid #cccccc;
        box-shadow: none;
        break-inside: avoid;
    }

    .card-header {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    table {
        font-size: 10pt;
    }

    th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a {
        color: #000000 !important;
        text-decoration: none !important;
    }

    a[href]::after {
        content: none !important;
    }
}

/* ----------------------------------------------------------
   Animations
   ---------------------------------------------------------- */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ----------------------------------------------------------
   Utility Classes
   ---------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-light);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.font-mono { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace; }