/* ============================================================================
   Admin Panel — Stylesheet
   Modern admin design with sidebar navigation and responsive layout.
   ============================================================================ */

/* -- CSS Variables -------------------------------------------------------- */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #e2e8f0;
    --sidebar-hover-bg: #334155;
    --sidebar-header-bg: #0f172a;
    --topbar-height: 56px;
    --topbar-bg: #ffffff;
    --topbar-border: #e2e8f0;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --success-hover: #15803d;
    --warning: #f59e0b;
    --info: #0891b2;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-radius: 6px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --transition: 150ms ease;
}

/* -- Reset / Base --------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background: var(--content-bg);
    line-height: 1.5;
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

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

/* -- Sidebar -------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-header {
    background: var(--sidebar-header-bg);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #e2e8f0;
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-active);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
}

.sidebar-link.active .sidebar-icon {
    color: var(--primary);
}

.sidebar-text {
    flex: 1;
}

.sidebar-shortcut {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    font-family: var(--font-mono);
}

/* -- Main wrapper --------------------------------------------------------- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -- Topbar --------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-dark);
}

.topbar-search {
    flex: 1;
    max-width: 400px;
}

.topbar-search-input {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.topbar-search-input:focus {
    border-color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.topbar-user {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.topbar-logout {
    font-size: 0.85rem;
    color: var(--danger);
}

.topbar-logout:hover {
    text-decoration: underline;
}

/* -- Content area --------------------------------------------------------- */
.content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* -- Cards ---------------------------------------------------------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-action {
    font-size: 0.85rem;
    color: var(--primary);
}

.card-body {
    padding: 1.25rem;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
}

.stat-card-warning {
    border-left: 4px solid var(--warning);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.35rem;
}

/* -- Tables --------------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
    white-space: nowrap;
}

.table-striped tbody tr:nth-child(even) {
    background: #f8fafc;
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.table-sortable th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.table-sortable th[data-sort]:hover {
    color: var(--primary);
}

.table-sortable th[data-sort]::after {
    content: ' \2195';
    font-size: 0.7rem;
}

.th-narrow {
    width: 60px;
}

.td-thumb {
    width: 50px;
}

.thumb-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.thumb-placeholder {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 0.75rem;
}

.td-truncate {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

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

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

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

.text-nowrap {
    white-space: nowrap;
}

.total-row td {
    border-top: 2px solid var(--text-dark);
    font-weight: 600;
}

/* -- Badges --------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-new { background: #dbeafe; color: #1e40af; }
.badge-processing { background: #fef3c7; color: #92400e; }
.badge-packed { background: #e0e7ff; color: #3730a3; }
.badge-shipped { background: #d1fae5; color: #065f46; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-return { background: #fce7f3; color: #9d174d; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-default { background: #f1f5f9; color: #475569; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #cffafe; color: #155e75; }

/* -- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-sans);
    line-height: 1.4;
}

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

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

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

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

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

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

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

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

.btn-outline:hover {
    background: #f1f5f9;
    border-color: var(--text-light);
    color: var(--text-dark);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.inline-form {
    display: inline;
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #ffffff;
    color: var(--text-dark);
    font-family: var(--font-sans);
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.form-input-color {
    padding: 0.2rem;
    height: 2.5rem;
    cursor: pointer;
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.checkbox-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
}

.checkbox-list .form-checkbox {
    margin-bottom: 0.4rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group-half {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 200px;
}

.form-group-third {
    flex: 1 1 calc(33.333% - 0.67rem);
    min-width: 150px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* -- Form grid (two-column layout) ---------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

.form-col-main {
    min-width: 0;
}

.form-col-side {
    min-width: 0;
}

/* -- Filter bar ----------------------------------------------------------- */
.filter-bar {
    margin-bottom: 1.25rem;
}

.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1 1 160px;
    min-width: 120px;
    max-width: 250px;
}

/* -- Detail grids --------------------------------------------------------- */
.order-detail-grid,
.shipment-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.25rem;
    align-items: start;
}

.order-detail-main { min-width: 0; }
.order-detail-side { min-width: 0; }

.detail-grid {
    display: grid;
    gap: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-block h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.info-block p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* -- Meta list ------------------------------------------------------------ */
.meta-list {
    display: grid;
    gap: 0.6rem;
}

.meta-item {
    display: flex;
    gap: 0.75rem;
}

.meta-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.meta-value {
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* -- Admin note ----------------------------------------------------------- */
.admin-note-existing {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

/* -- Image upload --------------------------------------------------------- */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.image-upload-slot {
    text-align: center;
}

.image-preview {
    width: 100%;
    aspect-ratio: 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: #f8fafc;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    font-size: 0.75rem;
    color: var(--text-light);
}

.image-file-input {
    display: none;
}

/* -- Pagination ----------------------------------------------------------- */
.pagination {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    transition: background var(--transition);
    text-decoration: none;
}

.pagination-link:hover {
    background: #f1f5f9;
    text-decoration: none;
}

.pagination-link.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* -- Tabs ----------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tab-link {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
    text-decoration: none;
}

.tab-link:hover {
    color: var(--text-dark);
    text-decoration: none;
}

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

/* -- Alerts --------------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid;
}

.alert-success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #cffafe;
    border-color: #67e8f9;
    color: #155e75;
}

/* -- Code block ----------------------------------------------------------- */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

/* -- Modal ---------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* -- Toast notifications -------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 300ms ease;
    max-width: 380px;
}

.toast-success {
    background: #166534;
    color: #ffffff;
}

.toast-error {
    background: #991b1b;
    color: #ffffff;
}

.toast-info {
    background: #1e40af;
    color: #ffffff;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* -- Loading state -------------------------------------------------------- */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -- Link styles ---------------------------------------------------------- */
.link-primary {
    color: var(--primary);
    font-weight: 500;
}

.link-primary:hover {
    color: var(--primary-hover);
}

/* -- Label preview -------------------------------------------------------- */
.label-preview-content {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: #f8fafc;
    text-align: center;
    min-height: 100px;
}

/* -- Login page ----------------------------------------------------------- */
.login-page {
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 2.5rem 2rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

/* -- Print styles --------------------------------------------------------- */
@media print {
    .sidebar,
    .topbar,
    .toast-container,
    .modal-overlay,
    .no-print {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .content {
        padding: 0;
    }

    body {
        background: #ffffff;
        color: #000;
    }

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

    .badge {
        border: 1px solid currentColor;
        background: transparent !important;
    }

    a {
        color: #000;
    }
}

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .order-detail-grid,
    .shipment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .content {
        padding: 1rem;
    }

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

    .filter-form {
        flex-direction: column;
    }

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

    .form-row {
        flex-direction: column;
    }

    .form-group-half,
    .form-group-third {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

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

    .topbar-search {
        display: none;
    }
}
