/* ==========================================================================
   TASKPLUS UNIVERSAL DARK 3D DESIGN SYSTEM (GLOBAL SPECIFICATION)
   Modular, agnostic 3D tactile interface: Deep Midnight Navy Canvas (#080B11 - #161F30),
   vertical gradient surfaces, 1px specular rim highlights, and high-density compact radii.
   ========================================================================== */

:root {
    /* --------------------------------------------------------------------------
     2.1 Base Surfaces & Layout Roles
     -------------------------------------------------------------------------- */
    --bg-canvas: #080b11;
    --bg-sidebar: #0c1018;
    --surface-primary: #111622;
    --surface-elevated: #161e2e;
    --surface-input: #0e131d;
    --surface-active-state: #1e293b;
    --surface-hover: rgba(30, 41, 59, 0.45);

    /* --------------------------------------------------------------------------
     2.2 Borders & 3D Specular Highlights
     -------------------------------------------------------------------------- */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-container: rgba(255, 255, 255, 0.12);
    --highlight-rim: rgba(255, 255, 255, 0.18);
    --highlight-rim-strong: rgba(255, 255, 255, 0.32);
    --focus-ring: rgba(59, 130, 246, 0.5);

    /* --------------------------------------------------------------------------
     2.3 Semantic & Interactive Actions (3D Gradient Surface + Border / Glow)
     -------------------------------------------------------------------------- */
    /* Primary (Blue) */
    --btn-primary-bg: linear-gradient(180deg, #4d5fff 0%, #1d4ed8 100%);
    --btn-primary-border: rgba(96, 165, 250, 0.4);
    --btn-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 4px 14px rgba(37, 99, 235, 0.38);

    /* Secondary (Slate) */
    --btn-secondary-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --btn-secondary-border: rgba(255, 255, 255, 0.12);
    --btn-secondary-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.4);

    /* Destructive / Danger */
    --btn-danger-bg: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    --btn-danger-border: rgba(239, 68, 68, 0.35);
    --btn-danger-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 14px rgba(220, 38, 38, 0.38);

    /* Warning / Caution */
    --btn-warning-bg: linear-gradient(180deg, #d97706 0%, #92400e 100%);
    --btn-warning-border: rgba(245, 158, 11, 0.35);
    --btn-warning-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 14px rgba(217, 119, 6, 0.38);

    /* Success / Verified */
    --btn-success-bg: linear-gradient(180deg, #059669 0%, #065f46 100%);
    --btn-success-border: rgba(16, 185, 129, 0.35);
    --btn-success-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 14px rgba(5, 150, 105, 0.38);

    /* Info / Discovery */
    --btn-info-bg: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    --btn-info-border: rgba(14, 165, 233, 0.35);
    --btn-info-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 14px rgba(2, 132, 199, 0.38);

    /* Solid Colors for Text & Badges */
    --color-primary: #3b82f6;
    --color-primary-light: #60a5fa;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-success: #10b981;
    --color-info: #0ea5e9;

    /* --------------------------------------------------------------------------
     3. Tipografi & Hierarki Skala
     -------------------------------------------------------------------------- */
    --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

    --text-h1: #f8fafc;
    --text-h2: #f1f5f9;
    --text-h3: #e2e8f0;
    --text-column: #64748b;
    --text-body: #cbd5e1;
    --text-meta: #94a3b8;
    --text-subtle: #64748b;

    /* --------------------------------------------------------------------------
     4. Spacing, Elevation & The 3D Tactile Recipe
     -------------------------------------------------------------------------- */
    /* 4.1 Corner Radii Standar */
    --radius-window: 12px; /* Window Overlay / Dialog Modal: 12px (rounded-xl) */
    --radius-card: 10px; /* Card, Panel Kontainer, Data Grid Outer: 10px (rounded-lg) */
    --radius-control: 8px; /* Interactive Controls: 8px (rounded-lg) */
    --radius-badge: 6px; /* Tags, Micro Badges & Priority Indicator: 6px (rounded-md) */
    --radius-avatar: 9999px; /* Avatar, Switch Knobs & Circular Badges: 9999px */
    --radius-pill: 9999px;

    /* 3D Tactile Recipe Shadows */
    --shadow-tactile-card: inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-tactile-hover: inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-modal: inset 0 1px 0 var(--highlight-rim),
        0 24px 60px rgba(0, 0, 0, 0.85);
    --shadow-input-inset: inset 0 1px 3px rgba(0, 0, 0, 0.6);
    --shadow-subtle: 0 2px 6px rgba(0, 0, 0, 0.35);

    /* --------------------------------------------------------------------------
     Legacy Aliases for Seamless Backward Compatibility
     -------------------------------------------------------------------------- */
    --apple-ink: var(--text-h1);
    --apple-muted: var(--text-meta);
    --apple-border: var(--border-container);
    --apple-border-light: var(--border-subtle);
    --apple-soft: var(--bg-canvas);
    --apple-white: var(--surface-primary);
    --apple-gray-050: var(--surface-input);
    --apple-gray-100: var(--surface-active-state);
    --apple-blue: var(--color-primary);
    --apple-blue-deep: #1d4ed8;
    --apple-blue-subtle: rgba(59, 130, 246, 0.16);
    --apple-success: var(--color-success);
    --apple-success-subtle: rgba(16, 185, 129, 0.16);
    --apple-warning: var(--color-warning);
    --apple-warning-subtle: rgba(245, 158, 11, 0.16);
    --apple-danger: var(--color-danger);
    --apple-danger-subtle: rgba(239, 68, 68, 0.16);
    --apple-silver-text: var(--text-h1);

    color-scheme: dark;
}

[data-theme="dark"] {
    color-scheme: dark;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-canvas);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

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

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

.hidden {
    display: none !important;
}

/* Custom Scrollbar for Dark 3D Aesthetic */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
    background: #1f293d;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
    background: #2d3b55;
}

/* ==========================================================================
   4.2 CSS RECIPE STANDAR & TACTILE DEPTH ENGINE
   ========================================================================== */

/* Universal Tactile Card / Elevated Container */
.tactile-surface,
.product-card,
.apple-table-stage {
    background: linear-gradient(180deg, #182030 0%, #111722 100%);
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 4px 14px rgba(0, 0, 0, 0.45);
    border-radius: var(--radius-card);
}

/* Universal Primary 3D Action Button */
.tactile-btn-primary,
.button-primary {
    background: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    box-shadow: var(--btn-primary-shadow);
    border-radius: var(--radius-control);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.01em;
    min-height: 38px;
    padding: 0 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
}
.tactile-btn-primary:hover,
.button-primary:hover {
    background: linear-gradient(180deg, #4a8cf7 0%, #2256e5 100%);
    border-color: rgba(147, 197, 253, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 6px 18px rgba(37, 99, 235, 0.48);
}
.tactile-btn-primary:active,
.button-primary:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(37, 99, 235, 0.3);
}
.tactile-btn-primary:disabled,
.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Universal Secondary 3D Button */
.tactile-btn-secondary,
.button-secondary {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    box-shadow: var(--btn-secondary-shadow);
    border-radius: var(--radius-control);
    color: var(--text-h2) !important;
    font-weight: 500;
    font-size: 13px;
    min-height: 38px;
    padding: 0 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
}
.tactile-btn-secondary:hover,
.button-secondary:hover {
    background: linear-gradient(180deg, #27354d 0%, #141e34 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.5);
    color: #ffffff !important;
}
.tactile-btn-secondary:active,
.button-secondary:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.tactile-btn-secondary:disabled,
.button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Universal Destructive / Danger 3D Button */
.tactile-btn-danger,
.button-danger {
    background: var(--btn-danger-bg);
    border: 1px solid var(--btn-danger-border);
    box-shadow: var(--btn-danger-shadow);
    border-radius: var(--radius-control);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 13px;
    min-height: 38px;
    padding: 0 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
}
.tactile-btn-danger:hover,
.button-danger:hover {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    border-color: rgba(252, 165, 165, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 6px 18px rgba(220, 38, 38, 0.45);
}
.tactile-btn-danger:active,
.button-danger:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}
.tactile-btn-danger:disabled,
.button-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Subtle Danger Button (For secondary destructive like Cancel/Stop) */
.button-subtle-danger {
    background: linear-gradient(180deg, #251216 0%, #170a0d 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-control);
    color: #f87171 !important;
    font-weight: 500;
    font-size: 13px;
    min-height: 38px;
    padding: 0 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
}
.button-subtle-danger:hover {
    background: linear-gradient(180deg, #34151b 0%, #200b10 100%);
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 4px 12px rgba(220, 38, 38, 0.32);
    color: #fca5a5 !important;
}
.button-subtle-danger:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.button-subtle-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   APP SHELL & ADAPTIVE NAVIGATION FRAME (SIDEBAR)
   ========================================================================== */
.apple-app-shell,
.taskplus-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--bg-canvas);
}

.apple-sidebar,
.taskplus-sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: relative;
    z-index: 1050;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.5);
    transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        min-width 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsed Sidebar State */
.apple-sidebar.collapsed,
.taskplus-sidebar.collapsed {
    width: 76px;
    min-width: 76px;
}

.apple-sidebar.collapsed .nav-brand-title,
.apple-sidebar.collapsed .sidebar-item-label,
.apple-sidebar.collapsed .sidebar-item-badge,
.apple-sidebar.collapsed .sidebar-profile-info,
.apple-sidebar.collapsed .sidebar-section-header,
.apple-sidebar.collapsed .sidebar-plan-badge {
    display: none !important;
}

.apple-sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 10px 0;
}

.apple-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

.apple-sidebar.collapsed .theme-toggle-btn {
    padding: 8px;
    justify-content: center;
}
.apple-sidebar.collapsed .theme-toggle-btn span:last-child {
    display: none;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-h1);
    overflow: hidden;
}

.nav-logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 2px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 2px 6px rgba(37, 99, 235, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.nav-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-h1);
    white-space: nowrap;
}

.sidebar-toggle-btn {
    background: linear-gradient(180deg, #161e2e 0%, #0e1420 100%);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim);
    color: var(--text-meta);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-control);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.sidebar-toggle-btn:hover {
    background: linear-gradient(180deg, #1f2a3f 0%, #131b2a 100%);
    color: var(--text-h1);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 10px;
    flex: 1;
    overflow-y: auto;
}

/* ==========================================================================
   SIDEBAR BRANCH ADVANCE SELECTOR
   ========================================================================== */
.sidebar-branch-wrapper {
    position: relative;
    padding: 10px 10px 4px;
}

.sidebar-branch-wrapper .advance-select-wrapper {
    width: 100%;
    display: block;
}

.sidebar-branch-wrapper .advance-select-trigger {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.sidebar-branch-wrapper .advance-select-dropdown {
    width: 100%;
    min-width: 220px;
    left: 0;
    top: calc(100% + 4px);
    box-sizing: border-box;
}

.apple-sidebar.collapsed .sidebar-branch-wrapper {
    padding: 10px 8px 4px;
}

.apple-sidebar.collapsed .sidebar-branch-wrapper .advance-select-trigger {
    padding: 0;
    justify-content: center;
}

.apple-sidebar.collapsed .sidebar-branch-wrapper .advance-select-trigger-text,
.apple-sidebar.collapsed .sidebar-branch-wrapper .advance-select-badge,
.apple-sidebar.collapsed .sidebar-branch-wrapper .advance-select-chevron {
    display: none !important;
}

.apple-sidebar.collapsed .sidebar-branch-wrapper .advance-select-dropdown {
    left: 76px;
    top: 0;
    min-width: 220px;
    width: 220px;
}

.sidebar-section-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-column);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 12px 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-control);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-body);
    background: transparent;
    border: 1px solid transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-h1);
}

/* 5.1 Adaptive Navigation Frame: 3D Raised Gradient Active Indicator */
.sidebar-nav-item.active {
    background: linear-gradient(180deg, #1e293b 0%, #151d2a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.35);
    color: var(--text-h1);
    font-weight: 600;
}

.sidebar-item-icon {
    font-size: 16px;
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    color: var(--text-meta);
}
.sidebar-nav-item.active .sidebar-item-icon {
    color: var(--color-primary-light);
}

.sidebar-item-label {
    white-space: nowrap;
    flex: 1;
}

.sidebar-item-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-badge);
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 5.1 User Profile with Pill Badge Plan */
.sidebar-operator-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #151d2b 0%, #0f1522 100%);
    padding: 9px 12px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.operator-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-avatar);
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.sidebar-profile-info {
    flex: 1;
    overflow: hidden;
    line-height: 1.25;
}

.sidebar-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-h2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-profile-role {
    font-size: 11px;
    color: var(--text-meta);
}

.sidebar-plan-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: var(--radius-badge);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: var(--color-primary-light);
    text-transform: uppercase;
}

/* ==========================================================================
   MAIN VIEWPORT & TOP UTILITY BAR
   ========================================================================== */
.apple-main-viewport,
.taskplus-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-canvas);
}

.apple-top-utility-bar,
.taskplus-top-bar {
    height: 60px;
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #101624 0%, #0a0e16 100%);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-status-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-meta);
}

.nav-pill-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-input);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
    padding: 5px 11px;
    border-radius: var(--radius-control);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-h2);
}

.status-dot-green {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot-gray {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-column);
}

.clock-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-h1);
    font-weight: 600;
    background: var(--surface-input);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 5px 11px;
    border-radius: var(--radius-control);
}

.header-mobile-brand {
    display: none;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #161e2e 0%, #0e1420 100%);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim);
    color: var(--text-h2);
    padding: 6px 12px;
    border-radius: var(--radius-control);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.theme-toggle-btn:hover {
    background: linear-gradient(180deg, #1f2a3f 0%, #131b2a 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Audio Unlock Banner */
.apple-audio-banner {
    background: linear-gradient(180deg, #1e293b 0%, #111722 100%);
    border-bottom: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 4px 14px rgba(0, 0, 0, 0.5);
    color: var(--text-h1);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sidebar-close-btn {
    display: none;
    background: var(--surface-input);
    border: 1px solid var(--border-container);
    border-radius: var(--radius-control);
    color: var(--text-meta);
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-h1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   5.1 RESPONSIVE ADAPTATIONS (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
    .apple-sidebar,
    .apple-sidebar.collapsed {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 270px !important;
        min-width: 270px !important;
        max-width: 85vw;
        transform: translateX(-100%);
        z-index: 1060;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.85);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .apple-sidebar.drawer-open,
    .apple-sidebar.collapsed.drawer-open {
        transform: translateX(0) !important;
    }
    .apple-sidebar.collapsed .nav-brand-title,
    .apple-sidebar.collapsed .sidebar-item-label,
    .apple-sidebar.collapsed .sidebar-item-badge,
    .apple-sidebar.collapsed .sidebar-profile-info,
    .apple-sidebar.collapsed .sidebar-section-header,
    .apple-sidebar.collapsed .sidebar-plan-badge {
        display: inline-flex !important;
    }
    .apple-sidebar.collapsed .sidebar-nav-item {
        justify-content: flex-start !important;
        padding: 9px 12px !important;
    }
    .apple-sidebar.collapsed .sidebar-header {
        justify-content: space-between !important;
        padding: 18px 20px !important;
    }
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar-close-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    /* 1. Header: Hide LiveSync, TV Relay, and Clock Mono on mobile as requested */
    .apple-top-utility-bar,
    .taskplus-top-bar {
        height: 52px;
        min-height: 52px;
        padding: 0 14px;
    }

    #ws-status-container,
    .header-ws-status,
    .clock-pill,
    #clockMono {
        display: none !important;
    }

    .header-mobile-brand {
        display: inline-block !important;
        font-size: 14px;
        font-weight: 700;
        color: var(--text-h1);
        letter-spacing: -0.01em;
    }

    /* 2. Main Content Spacing */
    .apple-content-area,
    .taskplus-content-area {
        padding: 14px 12px 64px;
    }

    /* 3. Toolbar & Filters Optimization */
    .view-controls-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }

    /* Status Pills: Scrollable or Full-width segmented bar */
    .apple-filter-pills {
        display: flex;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        box-sizing: border-box;
        gap: 4px;
        padding: 3px;
        border-radius: var(--radius-control);
    }
    .apple-filter-pills::-webkit-scrollbar {
        display: none;
    }
    .apple-filter-btn {
        flex: 1 1 auto;
        text-align: center;
        white-space: nowrap;
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Row 2: Advance Select & Search Box in symmetrical 2-column grid */
    .view-controls-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .advance-select-wrapper {
        width: 100%;
        position: relative;
    }

    .advance-select-trigger {
        width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
        font-size: 12px;
        gap: 6px;
        justify-content: space-between;
    }

    .advance-select-dropdown {
        left: 0;
        right: auto;
        width: min(280px, calc(100vw - 24px));
        min-width: 200px;
    }

    .apple-search-box {
        width: 100%;
        position: relative;
    }

    .apple-search-input {
        width: 100% !important;
        box-sizing: border-box;
        font-size: 12px;
        padding: 8px 30px 8px 10px;
        height: 38px;
    }

    .apple-search-input:focus {
        width: 100% !important;
    }

    .apple-search-icon {
        right: 10px;
    }

    /* 4. Room Grid & Cards on Mobile */
    .apple-rooms-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 5. Modals on Mobile */
    .apple-modal-card,
    .taskplus-modal-dialog {
        max-width: calc(100vw - 24px);
        margin: 12px;
        border-radius: var(--radius-card);
    }
}

/* Content Area */
.apple-content-area,
.taskplus-content-area {
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 64px;
    flex: 1;
}

/* ==========================================================================
   5.2 MULTI-VIEW CONTROL TOOLBAR & FILTER CONTROLS
   ========================================================================== */
.view-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Tab Switcher & Filter Pills */
.apple-filter-pills {
    display: inline-flex;
    gap: 4px;
    background: var(--surface-input);
    padding: 4px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.apple-filter-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 6px 14px;
    border-radius: var(--radius-badge);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-meta);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.apple-filter-btn:hover {
    color: var(--text-h1);
    background: rgba(255, 255, 255, 0.04);
}

/* 3D Raised Gradient Tab Active State */
.apple-filter-btn.active {
    background: linear-gradient(180deg, #1e293b 0%, #121824 100%);
    color: var(--text-h1);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Search Box & Inset Input */
.apple-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.apple-search-input {
    background: var(--surface-input);
    border: 1px solid var(--border-container);
    border-radius: var(--radius-control);
    padding: 8px 36px 8px 14px;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-h1);
    width: 240px;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-search-input:focus {
    border-color: var(--color-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--focus-ring);
    width: 290px;
}

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

.apple-search-icon {
    position: absolute;
    right: 12px;
    color: var(--text-meta);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.view-controls-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Category Filter Bar */
.apple-category-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* ==========================================================================
   BADGES & CHIPS (Compact 6px Radius)
   ========================================================================== */
.apple-badge,
.tactile-badge {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-badge);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
}

.badge-stopped {
    background: rgba(100, 116, 139, 0.16);
    color: var(--text-meta);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-running {
    background: rgba(59, 130, 246, 0.16);
    color: var(--color-primary-light);
    border: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-finished {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-lost {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   ROOM CARDS (TACTILE 3D CONTAINER)
   ========================================================================== */
.apple-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.product-card {
    container-type: inline-size;
    container-name: product-card;
    background: linear-gradient(180deg, #182030 0%, #111722 100%);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 4px 14px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 8px 24px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.18);
}

/* 3D Top Accent Indicator */
.product-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
}
.product-card[data-state="running"]::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}
.product-card[data-state="warning"]::before {
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}
.product-card[data-state="finished"]::before {
    background: linear-gradient(90deg, #dc2626, #f87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}
.product-card[data-state="lost_time"]::before {
    background: linear-gradient(90deg, #059669, #34d399);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.product-card[data-state="finished"] {
    border-color: rgba(239, 68, 68, 0.45);
    animation: finishPulse 1.8s infinite alternate ease-in-out;
}
@keyframes finishPulse {
    0% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 4px 14px rgba(220, 38, 38, 0.2);
    }
    100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
            0 10px 28px rgba(220, 38, 38, 0.45);
    }
}

.card-top-bar {
    padding: 16px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.card-station-id {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-column);
}

.card-station-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-h1);
    margin-top: 2px;
}

/* Inset Digital Timer Stage */
.apple-timer-stage {
    background: var(--surface-input);
    margin: 4px 16px 14px;
    border-radius: var(--radius-control);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.65);
}

.timer-digits {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-h1);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.product-card[data-state="warning"] .timer-digits {
    color: #fbbf24;
    text-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}
.product-card[data-state="finished"] .timer-digits {
    color: #f87171;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}
.product-card[data-state="lost_time"] .timer-digits {
    color: var(--color-primary-light);
    text-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

.timer-meta-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-meta);
    gap: 8px;
}

.timer-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.timer-duration-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: var(--radius-badge);
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: var(--color-primary-light);
    white-space: nowrap;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.product-card[data-state="warning"] .timer-duration-badge {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.product-card[data-state="finished"] .timer-duration-badge {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.product-card[data-state="lost_time"] .timer-duration-badge {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.4);
    color: var(--color-primary-light);
}

.tv-hardware-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.hardware-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-column);
}
.hardware-dot.on {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.card-actions-area {
    padding: 0 16px 16px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}
.action-button-group button {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.flex-1 {
    flex: 1;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.card-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
}

/* When the card is small (<= 360px), hide text on action buttons and show icons only */
@container product-card (max-width: 360px) {
    .action-button-group .card-action-btn .btn-text-responsive {
        display: none !important;
    }
    .action-button-group .card-action-btn {
        flex: 1;
        padding: 0 6px;
        justify-content: center;
        min-width: 36px;
    }
    .action-button-group .card-icon-btn {
        flex: 1;
        padding: 0 6px;
        justify-content: center;
        min-width: 36px;
    }
}

/* Fallback for narrow mobile screens <= 480px */
@media (max-width: 480px) {
    .action-button-group .card-action-btn .btn-text-responsive {
        display: none !important;
    }
    .action-button-group .card-action-btn {
        flex: 1;
        padding: 0 6px;
        justify-content: center;
        min-width: 36px;
    }
    .action-button-group .card-icon-btn {
        flex: 1;
        padding: 0 6px;
        justify-content: center;
        min-width: 36px;
    }
}

/* ==========================================================================
   5.3 AGNOSTIC DATA REPRESENTATION: TABLES & RESERVATIONS MATRIX
   ========================================================================== */
.apple-table-stage {
    background: linear-gradient(180deg, #161e2e 0%, #111622 100%);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 4px 14px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.table-stage-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, #182236 0%, #141b29 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.table-stage-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-h1);
}

.table-scroll-wrap {
    overflow-x: auto;
    max-height: 640px;
}

.apple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.apple-table th {
    min-width: 180px;
    background: #161e2e;
    color: var(--text-column);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--border-container);
}
.apple-table th:first-child {
    text-align: left;
    min-width: 110px;
}

.apple-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    text-align: center;
    background: transparent;
    color: var(--text-body);
}

.apple-table tbody tr:hover td {
    background: var(--surface-hover);
}

/* Reservation Slots (Tactile 3D Blocks) */
.reservation-slot-box {
    min-height: 42px;
    border-radius: var(--radius-badge);
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.slot-empty {
    background: var(--surface-input);
    color: var(--text-column);
    border: 1px dashed rgba(255, 255, 255, 0.14);
}
.slot-empty:hover {
    background: rgba(59, 130, 246, 0.14);
    color: var(--color-primary-light);
    border-color: rgba(96, 165, 250, 0.5);
}

.slot-booked {
    background: linear-gradient(
        180deg,
        rgba(217, 119, 6, 0.25) 0%,
        rgba(146, 64, 14, 0.25) 100%
    );
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.slot-active-live {
    background: linear-gradient(
        180deg,
        rgba(5, 150, 105, 0.28) 0%,
        rgba(6, 95, 70, 0.28) 100%
    );
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   HISTORY LIST & CARDS
   ========================================================================== */
.apple-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 960px;
}

.history-card-item {
    background: linear-gradient(180deg, #161e2e 0%, #111722 100%);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 2px 8px rgba(0, 0, 0, 0.35);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease,
        border-color 0.15s ease;
    gap: 16px;
}
.history-card-item:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 6px 18px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Empty State Card */
.empty-state-card {
    background: linear-gradient(180deg, #151c2a 0%, #0f1420 100%);
    border: 1px dashed var(--border-container);
    border-radius: var(--radius-card);
    padding: 40px;
    text-align: center;
}

/* ==========================================================================
   5.4 UNIVERSAL DIALOG & MODALS (12px Radii)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active,
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.apple-modal-host {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    pointer-events: none;
}
.apple-modal-host.active,
.apple-modal-host:not(.hidden) {
    pointer-events: auto;
}

.apple-modal {
    background: linear-gradient(180deg, #1a2234 0%, #141b29 100%);
    border-radius: var(--radius-window);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-container);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    transform: scale(0.96) translateY(10px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}
.apple-modal-host.active .apple-modal,
.apple-modal-host:not(.hidden) .apple-modal {
    transform: scale(1) translateY(0);
}

.apple-modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, #1c263b 0%, #161e2e 100%);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-h1);
}
.modal-subtitle {
    font-size: 12px;
    color: var(--text-meta);
    margin-top: 2px;
}

.apple-modal-body {
    padding: 18px 22px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.apple-modal-footer {
    background: #0e131e;
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close-btn {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: var(--radius-control);
    background: linear-gradient(180deg, #1b2436 0%, #121824 100%);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim);
    color: var(--text-meta);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.modal-close-btn:hover {
    background: linear-gradient(180deg, #243048 0%, #172030 100%);
    color: var(--text-h1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   FORMS & INPUT FIELDS (Surface Input #0E131D)
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-column);
}

.input-field,
.select-field,
.textarea-field {
    background: var(--surface-input);
    color: var(--text-h1);
    border: 1px solid var(--border-container);
    border-radius: var(--radius-control);
    min-height: 40px;
    padding: 9px 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    width: 100%;
    box-shadow: var(--shadow-input-inset);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-field:focus,
.select-field:focus,
.textarea-field:focus {
    border-color: var(--color-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 3px var(--focus-ring);
}
.input-field::placeholder,
.textarea-field::placeholder {
    color: var(--text-subtle);
}

/* Preset Duration Chips (Grid 3-col) */
.preset-chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.duration-chip {
    background: linear-gradient(180deg, #1a2234 0%, #121824 100%);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 9px 6px;
    border-radius: var(--radius-control);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    color: var(--text-h2);
    transition: all 0.15s ease;
    user-select: none;
}
.duration-chip:hover {
    background: linear-gradient(180deg, #222d45 0%, #161e2e 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: var(--color-primary-light);
}
.duration-chip.selected,
.duration-chip.active {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: rgba(96, 165, 250, 0.5);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 4px 12px rgba(37, 99, 235, 0.4);
    font-weight: 600;
}

/* Open Session Choice Card */
.open-session-box {
    background: linear-gradient(180deg, #151d2a 0%, #0e131e 100%);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.open-session-box:hover {
    border-color: rgba(96, 165, 250, 0.5);
    background: linear-gradient(180deg, #1a2538 0%, #111826 100%);
}

/* ==========================================================================
   TOAST SHELF
   ========================================================================== */
.toast-shelf {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
    pointer-events: none;
}

.apple-toast {
    background: linear-gradient(180deg, #1a2336 0%, #131b29 100%);
    color: var(--text-h1);
    border: 1px solid var(--border-container);
    box-shadow: inset 0 1px 0 var(--highlight-rim),
        0 16px 36px rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-control);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: auto;
    cursor: pointer;
    animation: toastSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-toast.toast-success {
    border-left: 3px solid var(--color-success);
}
.apple-toast.toast-warning {
    border-left: 3px solid var(--color-warning);
}
.apple-toast.toast-danger {
    border-left: 3px solid var(--color-danger);
}
.apple-toast.toast-info {
    border-left: 3px solid var(--color-primary);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   LOGIN SCREEN (DEEP MIDNIGHT NAVY CANVAS & TACTILE CARD)
   ========================================================================== */
.login-body {
    background: radial-gradient(circle at top center, #141d2d 0%, #080b11 75%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    overflow-y: auto;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.login-brand__logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(96, 165, 250, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 8px 20px rgba(37, 99, 235, 0.45);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-brand__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-h1);
}

.login-brand__title span {
    color: var(--color-primary-light);
}

.login-brand__tagline {
    font-size: 12px;
    color: var(--text-meta);
    margin-top: -2px;
}

.login-alert {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-control);
    padding: 10px 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-column);
}

/* ==========================================================================
   TACTILE 3D TOGGLE SWITCH (TASKPLUS SPECIFICATION)
   ========================================================================== */
.tactile-switch-card {
  background: linear-gradient(180deg, #182234 0%, #101622 100%);
  border: 1px solid var(--border-container);
  border-radius: var(--radius-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 2px 6px rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.tactile-switch-card:hover {
  border-color: rgba(96, 165, 250, 0.40);
  background: linear-gradient(180deg, #1C283E 0%, #121927 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.45);
}

.tactile-switch-card:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.tactile-switch-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.tactile-switch-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.tactile-switch-icon-box.active {
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 8px rgba(37, 99, 235, 0.40);
  color: #FFFFFF;
}

.tactile-switch-icon-box.inactive {
  background: var(--surface-input);
  border: 1px solid var(--border-container);
  color: var(--text-column);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.tactile-switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tactile-switch-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-h1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tactile-switch-desc {
  font-size: 11px;
  color: var(--text-meta);
  line-height: 1.35;
}

/* 3D Track & Knob */
.tactile-switch-track {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.tactile-switch-track.active {
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  border: 1px solid rgba(96, 165, 250, 0.50);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 10px rgba(59, 130, 246, 0.35);
}

.tactile-switch-track.inactive {
  background: #0E131D;
  border: 1px solid var(--border-container);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
}

.tactile-switch-knob {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 
    inset 0 1px 0 #FFFFFF,
    0 2px 6px rgba(0, 0, 0, 0.55);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.22s ease, border-color 0.22s ease;
}

.tactile-switch-track.active .tactile-switch-knob {
  transform: translateX(20px);
}

.tactile-switch-track.inactive .tactile-switch-knob {
  transform: translateX(0);
  background: linear-gradient(180deg, #94A3B8 0%, #64748B 100%);
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20), 0 2px 5px rgba(0, 0, 0, 0.50);
}

/* ==========================================================================
   ADVANCE SELECT DROPDOWN (TASKPLUS SPECIFICATION)
   ========================================================================== */
.advance-select-wrapper {
  position: relative;
  display: inline-block;
}

.advance-select-wrapper.w-full {
  width: 100%;
  display: block;
}

.advance-select-wrapper.w-full .advance-select-trigger {
  width: 100%;
  display: flex;
}

.advance-select-wrapper.w-full .advance-select-dropdown {
  min-width: 100%;
  width: 100%;
  max-width: 100%;
}

.advance-select-trigger {
  background: var(--surface-input);
  border: 1px solid var(--border-container);
  border-radius: var(--radius-control);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  color: var(--text-h2);
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.advance-select-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.advance-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.20);
  background: linear-gradient(180deg, #151D2A 0%, #0E1420 100%);
  color: var(--text-h1);
}

.advance-select-trigger.active,
.advance-select-trigger:focus-visible {
  border-color: var(--color-primary);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.30), 0 0 0 3px var(--focus-ring);
  outline: none;
}

.advance-select-trigger.has-filter {
  background: linear-gradient(180deg, #182438 0%, #101826 100%);
  border-color: rgba(96, 165, 250, 0.40);
  color: var(--color-primary-light);
}

.advance-select-icon {
  color: var(--text-column);
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}
.advance-select-trigger.has-filter .advance-select-icon,
.advance-select-trigger.active .advance-select-icon {
  color: var(--color-primary-light);
}

.advance-select-chevron {
  color: var(--text-meta);
  display: flex;
  align-items: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.advance-select-chevron.open {
  transform: rotate(180deg);
}

.advance-select-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-badge);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-meta);
}
.advance-select-trigger.has-filter .advance-select-badge {
  background: rgba(59, 130, 246, 0.20);
  color: var(--color-primary-light);
  border: 1px solid rgba(96, 165, 250, 0.30);
}

/* 3D Elevated Dropdown Menu */
.advance-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  background: linear-gradient(180deg, #1C263B 0%, #141B29 100%);
  border: 1px solid var(--border-container);
  border-radius: var(--radius-control);
  box-shadow: 
    inset 0 1px 0 var(--highlight-rim),
    0 16px 36px rgba(0, 0, 0, 0.70);
  padding: 6px;
  z-index: 1200;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.advance-select-header {
  padding: 6px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-column);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.advance-select-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}

.advance-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-badge);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.advance-select-item:hover {
  background: var(--surface-hover);
  color: var(--text-h1);
}

.advance-select-item.selected {
  background: linear-gradient(180deg, #1E293B 0%, #151D2A 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 6px rgba(0, 0, 0, 0.30);
  color: var(--color-primary-light);
  font-weight: 600;
}

.advance-select-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.advance-select-item-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-meta);
  padding: 1px 6px;
  border-radius: var(--radius-badge);
  background: rgba(0, 0, 0, 0.30);
}
.advance-select-item.selected .advance-select-item-count {
  background: rgba(59, 130, 246, 0.20);
  color: var(--color-primary-light);
}
