/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161821;
    --bg-tertiary: #1c1e2a;
    --bg-elevated: #222436;
    --bg-hover: #282c3e;
    --border: #2a2d3e;
    --border-light: #353849;
    --text-primary: #e1e4f0;
    --text-secondary: #8b8fa7;
    --text-muted: #5c607a;
    --accent: #7c6aef;
    --accent-hover: #6b58e0;
    --accent-glow: rgba(124, 106, 239, 0.15);
    --accent-subtle: rgba(124, 106, 239, 0.08);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --actor-color: #60a5fa;
    --actress-color: #f472b6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.app-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-stats {
    display: flex;
    gap: 8px;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.actor-chip .stat-value {
    color: var(--actor-color);
}

.actress-chip .stat-value {
    color: var(--actress-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    margin-left: 8px;
}

.btn-logout:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid var(--border);
}

.stat-chips {
    display: flex;
    gap: 8px;
    margin-right: auto;
}

.user-welcome {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-welcome strong {
    color: var(--text-primary);
}


/* ===== MAIN ===== */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== ACTION BAR ===== */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--accent), #9b7cf8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 106, 239, 0.35);
    background: linear-gradient(135deg, var(--accent-hover), #8b6ce8);
}

.btn-add:active {
    transform: translateY(0);
}

.record-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 11px 40px 11px 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}

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

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.search-clear:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 4px;
    white-space: nowrap;
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.filter-check:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.filter-check input {
    display: none;
}

.check-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.filter-check input:checked~.check-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-check input:checked~.check-mark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.filter-check input:checked~.check-label {
    color: var(--text-primary);
}

.check-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== TABLE ===== */
.table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    /* Allow horizontal scroll for table */
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Enforce column widths */
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    vertical-align: middle;
    overflow: hidden;
    /* Prevent spillover */
}

/* Explicit widths */
.th-date {
    width: 180px;
}

.th-name {
    width: auto;
}

.th-status {
    width: 110px;
    text-align: center;
}

.th-actions {
    width: 100px;
    text-align: center;
}

/* Centering classes for body cells */
td.status-dot,
td.action-buttons {
    text-align: center !important;
}

/* Table Row Styles */
.data-table tbody tr:hover:not(.empty-row) {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Cell styles */
.cell-date {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.cell-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.cell-name .name {
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    word-break: break-word;
    /* Prevent overflow */
}

.cell-name .url {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
    word-break: break-all;
}

.cell-name .url:hover {
    color: var(--accent);
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.type-badge.actor {
    background: rgba(96, 165, 250, 0.1);
    color: var(--actor-color);
}

.type-badge.actress {
    background: rgba(244, 114, 182, 0.1);
    color: var(--actress-color);
}

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

.dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
}

.dot.active {
    background: var(--success-bg);
    color: var(--success);
}

.dot.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.action-buttons {
    text-align: center;
    white-space: nowrap;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    margin: 0 2px;
}

.btn-edit:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: rgba(124, 106, 239, 0.2);
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    margin: 0 2px;
}

.btn-delete:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}

/* Extra URLs in row */
.cell-extras {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.extra-tag {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.extra-tag .label {
    color: var(--text-muted);
    font-weight: 600;
}

.extra-tag .value {
    color: var(--text-secondary);
}

.extra-tag .type-label {
    color: var(--accent);
    font-weight: 700;
    margin-right: 4px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-body {
    padding: 24px;
}

/* View Modal Specifics */
.view-group {
    margin-bottom: 20px;
}

.view-group:last-child {
    margin-bottom: 0;
}

.view-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.view-value {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.view-value .url {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.view-value .url:hover {
    text-decoration: underline;
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

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

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

.view-extras-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.view-extra-item {
    background: var(--bg-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.view-extra-item .type-label {
    color: var(--accent);
    font-weight: 700;
}

.view-extra-item .label {
    color: var(--text-muted);
    font-weight: 600;
}

.view-extra-item .value {
    color: var(--text-primary);
}

.view-extra-item .arrow {
    margin: 0 6px;
    color: var(--text-muted);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

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

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.type-option input {
    display: none;
}

.type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.type-option input:checked+.type-btn {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.type-btn:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

/* Extra Entries (dynamic + button) */
.extra-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-plus {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-plus:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.extra-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.extra-entry {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.extra-entry .entry-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extra-entry .entry-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.extra-entry input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.extra-entry input:focus {
    border-color: var(--accent);
}

.extra-entry input::placeholder {
    color: var(--text-muted);
}

.btn-remove-entry {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 2px;
}

.btn-remove-entry:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}

/* Update Checks in Form */
.update-checks {
    display: flex;
    gap: 12px;
}

.update-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    flex: 1;
}

.update-check:hover {
    border-color: var(--border-light);
}

.update-check input {
    display: none;
}

.update-check-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.update-check input:checked~.update-check-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.update-check input:checked~.update-check-mark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.update-check-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.update-check input:checked~.update-check-label {
    color: var(--text-primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-cancel:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent), #9b7cf8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 106, 239, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.form-date-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    justify-content: center;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-header {
        height: auto;
        padding: 12px 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .header-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .main-content {
        padding: 16px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-options {
        gap: 6px;
    }

    .data-table {
        min-width: 600px;
        /* Prevent total collapse on mobile */
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .th-date {
        width: 150px;
    }

    .th-status {
        width: 80px;
    }

    .th-actions {
        width: 90px;
    }

    .modal {
        width: 100%;
        max-height: 100vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-top: auto;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .type-selector {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .update-checks {
        flex-direction: column;
    }
}

/* ===== PAGINATION ===== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

.page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition);
}

.page-num:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

.page-num.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}