/* ═══════════════════════════════════════════════════════════════════
   ProFlow Mobile — Apple-Inspired Design System
   Clean, Premium, Glassmorphism, Smooth Animations
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
    /* Background */
    --bg-primary: #000000;
    --bg-secondary: rgba(28, 28, 30, 0.8);
    --bg-tertiary: rgba(44, 44, 46, 0.6);
    --bg-card: rgba(30, 30, 32, 0.65);
    --bg-card-solid: #1c1c1e;
    --bg-input: rgba(44, 44, 46, 0.8);
    --bg-hover: rgba(58, 58, 60, 0.5);
    --bg-elevated: rgba(38, 38, 40, 0.72);

    /* Text */
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.6);
    --text-muted: rgba(245, 245, 247, 0.35);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);

    /* Accent — Apple Blue Gradient */
    --accent: #2997ff;
    --accent-hover: #64b5ff;
    --accent-gradient: linear-gradient(135deg, #2997ff 0%, #5ac8fa 100%);

    /* Semantic */
    --success: #30d158;
    --success-bg: rgba(48, 209, 88, 0.12);
    --warning: #ff9f0a;
    --warning-bg: rgba(255, 159, 10, 0.12);
    --danger: #ff453a;
    --danger-bg: rgba(255, 69, 58, 0.12);
    --info: #64d2ff;
    --info-bg: rgba(100, 210, 255, 0.12);

    /* Layout */
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 30px rgba(41, 151, 255, 0.15);
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.15s ease;
    --header-height: 54px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);

    /* Glass */
    --glass-bg: rgba(30, 30, 32, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(40px) saturate(180%);

    font-size: 16px;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(41, 151, 255, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.47059;
    letter-spacing: -0.022em;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

/* ─── Header ───────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    padding-left: 8px;
    padding-right: 8px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.header-logo {
    height: 22px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.9;
}

.app-header h1 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.header-btn:hover,
.header-btn:active {
    color: var(--accent);
    background: var(--bg-hover);
}

/* ─── Main Content ─────────────────────────────────────────────── */
.app-content {
    padding: calc(var(--header-height) + var(--safe-top) + 16px) 20px 24px;
    max-width: 640px;
    margin: 0 auto;
}

/* ─── Drawer Menu ──────────────────────────────────────────────── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: rgba(22, 22, 24, 0.95);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer-menu.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    flex-shrink: 0;
}

.drawer-logo {
    height: 24px;
    width: auto;
    opacity: 0.9;
}

.drawer-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    flex: 1;
}

.drawer-close {
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.drawer-close:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.9);
}

.drawer-nav {
    flex: 1;
    padding: 8px 12px;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}

.drawer-item svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    opacity: 0.7;
}

.drawer-item:active {
    background: var(--bg-hover);
    transform: scale(0.98);
}

.drawer-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

.drawer-item.active svg {
    color: var(--accent);
    opacity: 1;
}

.drawer-item-danger {
    color: var(--danger) !important;
}

.drawer-item-danger svg {
    opacity: 1 !important;
}

.drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 16px;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drawer-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.drawer-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.menu-toggle:active {
    color: var(--accent);
    background: var(--bg-hover);
    transform: scale(0.9);
}

body.drawer-open { overflow: hidden; }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 16px;
    margin-bottom: 10px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:active {
    transform: scale(0.985);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

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

.card-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* ─── Stat Cards (Dashboard) ──────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(30, 30, 32, 0.72) 0%, rgba(20, 20, 22, 0.65) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 18px 16px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.stat-card.accent::before { background: var(--accent-gradient); }
.stat-card.accent .stat-value { color: var(--accent); }

.stat-card.success::before { background: var(--success); }
.stat-card.success .stat-value { color: var(--success); }

.stat-card.warning::before { background: var(--warning); }
.stat-card.warning .stat-value { color: var(--warning); }

.stat-card.danger::before { background: var(--danger); }
.stat-card.danger .stat-value { color: var(--danger); }

/* ─── Status Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.badge-default { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.badge-primary { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-accent { background: rgba(41, 151, 255, 0.12); color: var(--accent); }

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

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 980px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(41, 151, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 20px rgba(41, 151, 255, 0.4);
}

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.btn-ghost {
    background: transparent;
    color: var(--accent);
    padding: 8px 14px;
}

.btn-ghost:hover { background: rgba(41, 151, 255, 0.08); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; min-width: 44px; min-height: 44px; border-radius: 50%; }

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

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.12);
    background: rgba(44, 44, 46, 1);
}

.form-select {
    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='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 6px;
}

/* ─── Search Bar ───────────────────────────────────────────────── */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 980px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all var(--transition);
}

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

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.08);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 17px;
    height: 17px;
}

/* ─── Filter Chips ─────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 980px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.filter-chip.active,
.filter-chip:active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 600;
}

/* ─── Lists ────────────────────────────────────────────────────── */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.list-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.list-item:only-child { border-radius: var(--radius); }

.list-item:active {
    background: var(--bg-hover);
    transform: scale(0.99);
}

.list-item-content { flex: 1; min-width: 0; }

.list-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.list-item-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.list-item-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.list-group {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ─── Section Headers ──────────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 12px;
}

.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-link {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ─── Pagination ───────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 980px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.pagination a:active { transform: scale(0.92); }
.pagination .active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 600;
}
.pagination .disabled { opacity: 0.3; pointer-events: none; }

/* ─── Detail View ──────────────────────────────────────────────── */
.detail-header {
    margin-bottom: 20px;
}

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.detail-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); flex-shrink: 0; padding-right: 16px; }
.detail-value { color: var(--text-primary); font-weight: 500; text-align: right; word-break: break-word; }

/* ─── Tabs ─────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 980px;
    padding: 3px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    flex: 1;
    padding: 9px 14px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 980px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border: none;
    background: none;
    letter-spacing: -0.01em;
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.tab:active { transform: scale(0.96); }

/* ─── Empty State ──────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.92rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ─── Alerts / Flash Messages ──────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(48, 209, 88, 0.15);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 69, 58, 0.15);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(255, 159, 10, 0.15);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(100, 210, 255, 0.15);
}

/* ─── Kanban / Production ──────────────────────────────────────── */
.kanban-column {
    margin-bottom: 20px;
}

.kanban-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.kanban-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kanban-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 980px;
    font-weight: 600;
}

.kanban-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    padding: 14px;
    margin-bottom: 8px;
    transition: transform var(--transition);
}

.kanban-card:active {
    transform: scale(0.98);
}

.kanban-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.kanban-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ─── Machine Cards ────────────────────────────────────────────── */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.machine-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: transform var(--transition);
}

.machine-card:active {
    transform: scale(0.97);
}

.machine-name {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.machine-status {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.machine-jobs {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 6px;
    letter-spacing: -0.02em;
}

/* ─── Private Mode Toggle ──────────────────────────────────────── */
.private-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition-fast);
    border-radius: var(--radius);
}

.private-toggle:active {
    background: var(--bg-hover);
}

.private-toggle-info {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.private-toggle-info svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.private-toggle.active .private-toggle-info svg {
    color: var(--accent);
}

.private-toggle-title {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.private-toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.private-toggle-switch {
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.private-toggle-switch.on {
    background: var(--success);
}

.private-toggle-knob {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.private-toggle-switch.on .private-toggle-knob {
    transform: translateX(20px);
}

/* ─── Login Page ───────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(41, 151, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(90, 200, 250, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.login-logo {
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo-img {
    height: 44px;
    width: auto;
    opacity: 0.95;
}

.login-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.login-form {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow-lg);
}

/* ─── Fab (Floating Action Button) ─────────────────────────────── */
.fab {
    position: fixed;
    right: 20px;
    bottom: calc(var(--safe-bottom) + 24px);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(41, 151, 255, 0.35);
    cursor: pointer;
    transition: all var(--transition);
    z-index: 50;
    text-decoration: none;
}

.fab:active {
    transform: scale(0.88);
}

.fab:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 6px 28px rgba(41, 151, 255, 0.45);
}

/* ─── Action Sheet ─────────────────────────────────────────────── */
.action-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.action-sheet-overlay.show {
    display: block;
    opacity: 1;
}

.action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 16px 20px calc(20px + var(--safe-bottom));
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.action-sheet.show { transform: translateY(0); }

.action-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 18px;
}

.action-sheet-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
    letter-spacing: -0.02em;
}

.action-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    letter-spacing: -0.01em;
}

.action-sheet-item:active {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(0.98);
}

.action-sheet-item.danger { color: var(--danger); }

/* ─── Confirm Dialog ───────────────────────────────────────────── */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dialog-overlay.show { display: flex; }

.dialog {
    background: rgba(36, 36, 38, 0.95);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.dialog-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.dialog-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 22px;
    line-height: 1.5;
}

.dialog-actions { display: flex; gap: 8px; }
.dialog-actions .btn { flex: 1; }

/* ─── Page Title ───────────────────────────────────────────────── */
.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    margin-bottom: 4px;
    background: linear-gradient(180deg, #f5f5f7 30%, rgba(245, 245, 247, 0.55) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 400;
}

/* ─── Dashboard Greeting ──────────────────────────────────────── */
.dashboard-greeting {
    margin-bottom: 24px;
}

.dashboard-greeting .greeting-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-secondary);
    line-height: 1.2;
}

.dashboard-greeting .greeting-name {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #f5f5f7 0%, rgba(245, 245, 247, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
}

.dashboard-greeting .greeting-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

/* ─── Utility Classes ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.1rem; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Sort Select ─────────────────────────────────────────────── */
.sort-select {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 28px 5px 10px;
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    max-width: 180px;
}
.sort-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ─── Light Theme ──────────────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-tertiary: rgba(240, 240, 242, 0.8);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-solid: #ffffff;
    --bg-input: rgba(240, 240, 242, 0.9);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --text-primary: #1d1d1f;
    --text-secondary: rgba(29, 29, 31, 0.6);
    --text-muted: rgba(29, 29, 31, 0.35);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background-image: radial-gradient(ellipse at 50% 0%, rgba(41, 151, 255, 0.06) 0%, transparent 60%);
}

[data-theme="light"] .page-title {
    background: linear-gradient(180deg, #1d1d1f 30%, rgba(29, 29, 31, 0.55) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .dashboard-greeting .greeting-name {
    background: linear-gradient(135deg, #1d1d1f 0%, rgba(29, 29, 31, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 245, 247, 0.8) 100%);
}

[data-theme="light"] .drawer-menu {
    background: rgba(255, 255, 255, 0.97);
}

[data-theme="light"] .drawer-item.active {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .filter-chip.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}

[data-theme="light"] .notification-panel,
[data-theme="light"] .modal-panel,
[data-theme="light"] .action-sheet {
    background: rgba(255, 255, 255, 0.97);
}

[data-theme="light"] .global-search-input-wrap {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

[data-theme="light"] ::selection {
    background: rgba(41, 151, 255, 0.2);
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .machine-grid { grid-template-columns: repeat(3, 1fr); }
    .app-content { max-width: 720px; }
}

@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(5, 1fr); }
    .app-content { max-width: 960px; }
}

/* ─── Animations ───────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-in {
    animation: fadeInScale 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Staggered animation for stat cards */
.stats-grid .stat-card {
    opacity: 0;
    animation: fadeInScale 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.03s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.06s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.09s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.18s; }
.stats-grid .stat-card:nth-child(7) { animation-delay: 0.21s; }
.stats-grid .stat-card:nth-child(8) { animation-delay: 0.24s; }
.stats-grid .stat-card:nth-child(9) { animation-delay: 0.27s; }
.stats-grid .stat-card:nth-child(10) { animation-delay: 0.30s; }

/* Staggered animation for list items */
.list-group .list-item {
    opacity: 0;
    animation: fadeIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.list-group .list-item:nth-child(1) { animation-delay: 0.04s; }
.list-group .list-item:nth-child(2) { animation-delay: 0.08s; }
.list-group .list-item:nth-child(3) { animation-delay: 0.12s; }
.list-group .list-item:nth-child(4) { animation-delay: 0.16s; }
.list-group .list-item:nth-child(5) { animation-delay: 0.20s; }

/* ─── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ─── Install Check Page ───────────────────────────────────────── */
.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
}

.check-ok { color: var(--success); }
.check-fail { color: var(--danger); }
.check-icon { font-size: 1.2rem; flex-shrink: 0; width: 24px; text-align: center; }

/* ─── Global Search Overlay ────────────────────────────────────── */
.global-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: calc(var(--safe-top) + 16px);
}

.global-search-overlay.open {
    display: flex;
}

.global-search-container {
    width: 100%;
    max-width: 540px;
    padding: 0 20px;
}

.global-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card-solid);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 980px;
    padding: 12px 18px;
    box-shadow: var(--shadow-lg);
}

.global-search-input-wrap svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.global-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

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

.global-search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: var(--transition);
}

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

.global-search-results {
    margin-top: 12px;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: var(--radius);
}

.global-search-results .search-category {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.global-search-results .list-item {
    background: var(--bg-card-solid);
}

.global-search-results .list-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.global-search-results .list-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* ─── Notification Button & Badge ─────────────────────────────── */
.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ─── Notification Panel ──────────────────────────────────────── */
.notification-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 250;
    display: none;
}

.notification-overlay.open { display: block; }

.notification-panel {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top));
    right: 0;
    width: 340px;
    max-width: 90vw;
    max-height: 70vh;
    background: rgba(28, 28, 30, 0.97);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: 260;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s, visibility 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.notification-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.notification-panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.notification-panel-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:hover { background: var(--bg-hover); }

.notification-item.unread { background: rgba(41, 151, 255, 0.04); }

.notification-item .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.notification-item .notif-dot.info { background: var(--info); }
.notification-item .notif-dot.warning { background: var(--warning); }
.notification-item .notif-dot.critical { background: var(--danger); }
.notification-item .notif-dot.read { background: var(--text-muted); opacity: 0.3; }

.notification-item .notif-content { flex: 1; min-width: 0; }

.notification-item .notif-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.notification-item .notif-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item .notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ─── Quick-Edit Modal ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 400;
    display: none;
}

.modal-overlay.open { display: block; }

.modal-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: rgba(28, 28, 30, 0.98);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 410;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-panel.open { transform: translateY(0); }

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

.modal-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-close {
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-panel-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .modal-panel {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        width: 480px;
        max-height: 70vh;
        border-radius: var(--radius-xl);
    }
    .modal-panel.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ─── Bulk Action Bar ─────────────────────────────────────────── */
.bulk-bar {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(28, 28, 30, 0.97);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 980px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 90;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    white-space: nowrap;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(60px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.bulk-bar-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}

.bulk-bar-actions {
    display: flex;
    gap: 6px;
}

/* ─── Multi-Select Checkbox ───────────────────────────────────── */
.select-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.select-check:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.select-check:checked::after {
    content: '';
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.select-all-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    margin-bottom: 4px;
}

.select-all-wrap label {
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* ─── Dashboard Charts ────────────────────────────────────────── */
.chart-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 240px;
}

.chart-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

/* ─── Kanban Drag & Drop ──────────────────────────────────────── */
.kanban-cards {
    min-height: 20px;
}

.kanban-card.sortable-ghost {
    opacity: 0.4;
    transform: scale(0.97);
}

.kanban-card.sortable-chosen {
    box-shadow: var(--shadow-glow);
    border-color: var(--accent);
}

.kanban-card.sortable-drag {
    opacity: 0.9;
    transform: rotate(2deg);
    box-shadow: var(--shadow-lg);
}

.kanban-card[data-id] {
    cursor: grab;
}

.kanban-card[data-id]:active {
    cursor: grabbing;
}

/* ─── Kanban Compact View ─────────────────────────────────────── */
.kanban-view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.kanban-view-btn {
    padding: 6px 14px;
    border-radius: 980px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.kanban-view-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 600;
}

.kanban-compact .kanban-card {
    padding: 8px 12px;
    margin-bottom: 4px;
}

.kanban-compact .kanban-card-title { font-size: 0.82rem; margin-bottom: 0; }
.kanban-compact .kanban-card-meta { display: none; }
.kanban-compact .kanban-card .text-xs { display: none; }
.kanban-compact .kanban-card .d-flex { display: none !important; }
.kanban-compact .kanban-card form { display: none; }

/* ─── Live Timer ──────────────────────────────────────────────── */
.live-timer {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}

.timer-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 8px;
    animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ─── Production Timeline ─────────────────────────────────────── */
.timeline-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 120px repeat(24, 40px);
    gap: 2px;
    min-width: fit-content;
}

.timeline-header-cell {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.timeline-row {
    display: contents;
}

.timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.timeline-bar {
    border-radius: 4px;
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

/* ─── Export Buttons ──────────────────────────────────────────── */
.export-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-export {
    padding: 6px 14px;
    border-radius: 980px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.btn-export:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ─── Lead Stats ──────────────────────────────────────────────── */
.lead-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

/* ─── Selection highlight ──────────────────────────────────────── */
::selection {
    background: rgba(41, 151, 255, 0.3);
    color: var(--text-primary);
}

/* ─── Last Updated Timestamp ──────────────────────────────────── */
.last-updated {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Pagination Info ─────────────────────────────────────────── */
.pagination-info {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ─── Select All Wrap with Export ─────────────────────────────── */
.select-all-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
