/* ============================================================================
   RESPONSIVE DESIGN
   Mobile-first breakpoints
   ============================================================================ */

/* ============================================================================
   TABLET (640px - 1024px)
   ============================================================================ */

@media (max-width: 1024px) {
.stat-card {
        padding: var(--spacing-md);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .btn {
        padding: 0.5rem 0.875rem;
        min-height: 2.5rem;
    }

    .card {
        margin-bottom: var(--spacing-md);
    }

    .table {
        font-size: var(--font-size-xs);
    }

    .table th,
    .table td {
        padding: var(--spacing-sm);
    }
}

/* ============================================================================
   MOBILE (< 640px)
   ============================================================================ */

@media (max-width: 640px) {

.page-title {
        font-size: var(--font-size-2xl);
    }

    .stat-card {
        padding: var(--spacing-md);
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    /* Stack card columns */
    .row {
        flex-direction: column;
    }

    .col-sm-4,
    .col-sm-6,
    .col-lg-4 {
        width: 100% !important;
    }

    /* Form full width */
    .form-group {
        width: 100%;
    }

    .form-control,
    .form-select,
    .form-textarea,
    .btn {
        width: 100%;
    }

    .btn {
        justify-content: center;
        padding: var(--spacing-md);
        min-height: 2.75rem;
        font-size: var(--font-size-base);
    }

    /* Tables get horizontal scroll */
    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: var(--font-size-xs);
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tr {
        display: block;
        margin-bottom: var(--spacing-md);
        background-color: var(--color-white);
        border: 1px solid var(--color-gray-light);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .table td {
        display: block;
        padding: var(--spacing-sm);
        border: none;
        border-bottom: 1px solid var(--color-gray-light);
    }

    .table td::before {
        content: attr(data-label);
        font-weight: var(--font-weight-semibold);
        color: var(--color-slate);
        display: inline-block;
        width: 30%;
        margin-right: var(--spacing-sm);
    }

    /* Modal responsive */
    .modal {
        min-width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }

/* Alert responsive */
    .alert {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .alert-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Pagination responsive */
    .pagination {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    /* Dropdown responsive */
    .dropdown-menu {
        min-width: 100%;
        width: 100%;
        max-width: calc(100vw - 2rem);
    }

    /* Breadcrumb responsive */
    .breadcrumb {
        font-size: var(--font-size-xs);
        overflow-x: auto;
        gap: var(--spacing-xs);
    }

    /* Modal footer stack */
    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Badge responsive */
    .badge {
        font-size: var(--font-size-xs);
        padding: 0.25rem 0.5rem;
    }

    /* Card responsive */
    .card-body,
    .card-header,
    .card-footer {
        padding: var(--spacing-md);
    }

    .card-title {
        font-size: var(--font-size-base);
    }
}

/* ============================================================================
   EXTRA SMALL DEVICES (< 360px)
   ============================================================================ */

@media (max-width: 360px) {
    .page-title {
        font-size: var(--font-size-xl);
    }

    .stat-card .value {
        font-size: 1.25rem;
    }

.btn {
        min-height: 2.5rem;
        padding: var(--spacing-sm);
    }

    .form-control,
    .form-select,
    .form-textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .modal {
        min-width: 100%;
        max-width: 100%;
    }

    .alert {
        padding: var(--spacing-md);
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .btn,
    .breadcrumb {
        display: none;
    }

    .card,
    .table {
        page-break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }
}

/* ============================================================================
   HIGH RESOLUTION DISPLAYS (Retina)
   ============================================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* ============================================================================
   DARK MODE (Future support)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    /* TODO: Implement dark mode theme variations */
}

/* ============================================================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================================
   LARGE SCREENS (> 1920px)
   ============================================================================ */

@media (min-width: 1921px) {
}
