/* ===================================================================
   Design Tokens
   =================================================================== */
:root {
    /* Backgrounds */
    --bg-base: #0d1117;
    --bg-surface: #161b22;
    --bg-elevated: #1c2330;
    --bg-hover: #21293a;

    /* Borders */
    --border-subtle: #21293a;
    --border-default: #30394a;
    --border-strong: #4a5568;

    /* Accent */
    --accent: #38bdf8;
    --accent-dim: #1e7fb5;
    --accent-glow: rgba(56,189,248,0.15);
    --accent-hover: #7dd3fc;

    /* Text */
    --text-primary: #e6edf3;
    --text-secondary: #8b98a8;
    --text-muted: #5a6478;
    --text-inverse: #0d1117;

    /* Status */
    --status-online: #22c55e;
    --status-online-bg: rgba(34,197,94,0.12);
    --status-offline: #f97316;
    --status-offline-bg: rgba(249,115,22,0.12);
    --status-stale: #ef4444;
    --status-stale-bg: rgba(239,68,68,0.12);

    /* Priority */
    --priority-critical: #ef4444;
    --priority-critical-bg: rgba(239,68,68,0.12);
    --priority-high: #f97316;
    --priority-high-bg: rgba(249,115,22,0.12);
    --priority-medium: #38bdf8;
    --priority-medium-bg: rgba(56,189,248,0.12);
    --priority-low: #64748b;
    --priority-low-bg: rgba(100,116,139,0.12);

    /* Semantic */
    --danger: #ef4444;
    --danger-dim: rgba(239,68,68,0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245,158,11,0.15);
    --success: #22c55e;
    --success-dim: rgba(34,197,94,0.15);

    /* Shape */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Layout */
    --header-height: 58px;
    --bottom-bar-height: 64px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

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

a:hover {
    color: var(--accent-hover);
}

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

.login-page::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.login-box {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-brand-mark {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
}

.login-box h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-error {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: left;
}

/* ===================================================================
   Page Layout
   =================================================================== */
.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 150ms ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 5px 12px;
}

.btn-lg {
    font-size: 1rem;
    padding: 12px 28px;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-default);
}

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

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: rgba(239,68,68,0.25);
}

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

.btn-warning {
    background: var(--warning-dim);
    color: var(--warning);
    border-color: rgba(245,158,11,0.25);
}

.btn-warning:hover {
    background: var(--warning);
    color: var(--text-inverse);
}

.btn-success {
    background: var(--success-dim);
    color: var(--success);
    border-color: rgba(34,197,94,0.25);
}

.btn-success:hover {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

/* ===================================================================
   Badges
   =================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Status badges */
.badge-online { background: var(--status-online-bg); color: var(--status-online); border: 1px solid rgba(34,197,94,0.25); }
.badge-online .badge-dot { background: var(--status-online); }
.badge-offline { background: var(--status-offline-bg); color: var(--status-offline); border: 1px solid rgba(249,115,22,0.25); }
.badge-offline .badge-dot { background: var(--status-offline); }
.badge-stale { background: var(--status-stale-bg); color: var(--status-stale); border: 1px solid rgba(239,68,68,0.25); }
.badge-stale .badge-dot { background: var(--status-stale); }

/* Priority badges */
.priority-critical { background: var(--priority-critical-bg); color: var(--priority-critical); border: 1px solid rgba(239,68,68,0.25); }
.priority-high { background: var(--priority-high-bg); color: var(--priority-high); border: 1px solid rgba(249,115,22,0.25); }
.priority-medium { background: var(--priority-medium-bg); color: var(--priority-medium); border: 1px solid rgba(56,189,248,0.25); }
.priority-low { background: var(--priority-low-bg); color: var(--priority-low); border: 1px solid rgba(100,116,139,0.25); }

/* Job status badges */
.badge-open { background: var(--priority-medium-bg); color: var(--priority-medium); border: 1px solid rgba(56,189,248,0.25); }
.badge-in-progress { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-further-work { background: var(--priority-high-bg); color: var(--priority-high); border: 1px solid rgba(249,115,22,0.25); }
.badge-invoice { background: var(--success-dim); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-closed { background: rgba(100,116,139,0.12); color: var(--priority-low); border: 1px solid rgba(100,116,139,0.25); }

/* Role badges */
.badge-superadmin { background: var(--priority-critical-bg); color: var(--priority-critical); border: 1px solid rgba(239,68,68,0.25); }
.badge-admin { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-user { background: var(--priority-medium-bg); color: var(--priority-medium); border: 1px solid rgba(56,189,248,0.25); }

/* Account state badges */
.badge-active { background: var(--success-dim); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-inactive { background: rgba(100,116,139,0.12); color: var(--priority-low); border: 1px solid rgba(100,116,139,0.25); }
.badge-locked { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* ===================================================================
   Alerts
   =================================================================== */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.alert-icon {
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-success { background: var(--success-dim); color: var(--success); }
.alert-error { background: var(--danger-dim); color: var(--danger); }
.alert-warning { background: var(--warning-dim); color: var(--warning); }
.alert-info { background: var(--accent-glow); color: var(--accent); }

/* ===================================================================
   Forms
   =================================================================== */
.form-group {
    margin-bottom: 18px;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: all 150ms ease;
}

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

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

.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

.check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 150ms ease;
}

.check-item:has(input:checked) {
    background: var(--accent-glow);
    border-color: var(--accent-dim);
}

.check-item input[type="checkbox"] {
    accent-color: var(--accent);
}

/* ===================================================================
   Tables
   =================================================================== */
.table-wrapper {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

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

.data-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 14px;
    text-align: left;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px;
}

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

.data-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 6px;
    opacity: 0.3;
    font-size: 0.7rem;
}

.data-table th.sort-asc::after {
    content: '▲';
    opacity: 0.8;
}

.data-table th.sort-desc::after {
    content: '▼';
    opacity: 0.8;
}

.data-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table .clickable {
    cursor: pointer;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Mobile card rows — hidden on desktop */
.table-card-row {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.tcr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tcr-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.tcr-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    margin-bottom: 12px;
}

.tcr-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.tcr-field-value {
    font-size: 0.85rem;
}

.tcr-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===================================================================
   Cards
   =================================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===================================================================
   Stat Tiles
   =================================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
}

.stat-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-tile-compact {
    padding: 10px 14px;
    text-align: center;
}

.stat-tile-compact .stat-label {
    margin-bottom: 2px;
}

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

/* ===================================================================
   Modals
   =================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* ===================================================================
   Activity Feed
   =================================================================== */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-entry {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.activity-entry:last-child {
    border-bottom: none;
}

.activity-dot-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    width: 20px;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-line {
    width: 2px;
    flex: 1;
    background: var(--border-subtle);
}

.dot-action { background: var(--accent); }
.dot-status { background: var(--warning); }
.dot-custody { background: var(--priority-medium); }
.dot-create { background: var(--success); }

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 4px;
}

.activity-user {
    font-weight: 600;
    font-size: 0.875rem;
}

.activity-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

/* ===================================================================
   Filter Bar
   =================================================================== */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

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

.search-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    padding: 9px 14px 9px 38px;
    transition: all 150ms ease;
}

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

.filter-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    padding: 9px 32px 9px 14px;
    appearance: none;
    cursor: pointer;
    transition: all 150ms ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b98a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===================================================================
   Two-Column Collapse
   =================================================================== */
@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr !important;
    }

    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================================================
   Header — Desktop
   =================================================================== */
.platform-header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 32px;
}

.header-brand .brand-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: var(--radius-sm);
}

.header-brand .brand-name {
    font-weight: 700;
    font-size: 1rem;
}

.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 150ms ease;
}

.nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-tab .tab-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
}

.nav-tab .tab-icon svg {
    width: 14px;
    height: 14px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

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

.user-info .user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-info .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===================================================================
   Mobile Top Bar & Bottom Tab Bar
   =================================================================== */
.mobile-top-bar {
    display: none;
}

.bottom-tab-bar {
    display: none;
}

/* ===================================================================
   Mobile (<=640px)
   =================================================================== */
@media (max-width: 640px) {
    .platform-header {
        display: none !important;
    }

    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-brand .brand-mark {
        width: 22px;
        height: 22px;
        background: var(--accent);
        border-radius: 4px;
    }

    .mobile-brand .brand-name {
        font-weight: 700;
        font-size: 0.9rem;
    }

    .mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-logout-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 4px;
        font-size: 0.8rem;
    }

    .bottom-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-bar-height);
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-surface);
        border-top: 1px solid var(--border-subtle);
        z-index: 9999;
    }

    .bottom-tab-bar nav {
        display: flex;
        width: 100%;
        height: 100%;
    }

    .bottom-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        gap: 3px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        position: relative;
        transition: all 150ms ease;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    .bottom-tab .btab-icon {
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
    }

    .bottom-tab .btab-icon svg {
        width: 22px;
        height: 22px;
    }

    .bottom-tab.active {
        color: var(--accent);
    }

    .bottom-tab.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--accent);
        box-shadow: 0 0 8px var(--accent-glow);
    }

    .bottom-tab.active .btab-icon {
        background: var(--accent-glow);
    }

    .page-content {
        padding: 16px;
        padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 16px);
    }

    /* Show card rows, hide table */
    .table-wrapper {
        display: none;
    }

    .table-card-row {
        display: block;
    }

    /* Stat grid mobile */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal as bottom sheet */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-box {
        max-width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 85vh;
    }

    .modal-footer {
        flex-direction: column;
    }

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

    /* Activity timestamps wrap */
    .activity-meta {
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
    }
}
