/* ===================================================
   innovaPM — Sci-Fi PMO Command Center Theme
   Dark navy · Cyan/neon accents · Glassmorphism
   =================================================== */

:root {
    --bg-base: #070B18;
    --bg-panel: rgba(255,255,255,0.045);
    --bg-panel-hover: rgba(255,255,255,0.07);
    --bg-input: rgba(2,6,23,0.6);
    --bg-card: rgba(2,6,23,0.45);
    --border: rgba(255,255,255,0.1);
    --border-subtle: rgba(255,255,255,0.05);
    --border-cyan: rgba(103,232,249,0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --cyan: #67e8f9;
    --cyan-dim: rgba(103,232,249,0.15);
    --cyan-glow: rgba(103,232,249,0.2);
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --sidebar-width: 220px;
    --header-height: 60px;
}

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

html { font-size: 14px; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Ambient Background Blobs === */
.ambient-bg {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.7;
}
.ambient-bg .blob-1 {
    position: absolute;
    left: -10%;
    top: -20%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(6,182,212,0.2);
    filter: blur(110px);
}
.ambient-bg .blob-2 {
    position: absolute;
    right: -10%;
    top: 15%;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: rgba(217,70,239,0.2);
    filter: blur(120px);
}
.ambient-bg .blob-3 {
    position: absolute;
    bottom: -15%;
    left: 30%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(29,78,216,0.3);
    filter: blur(130px);
}

/* === Layout === */
#app-layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: rgba(2,6,23,0.8);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #67e8f9, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(103,232,249,0.25);
    flex-shrink: 0;
}

.sidebar-logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-title {
    font-size: 0.875rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: 1px solid transparent;
}

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

.nav-item.active {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-color: var(--border-cyan);
}

.nav-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(217,70,239,0.2);
    color: #e879f9;
    border-radius: 99px;
    padding: 0.05rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 700;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.user-card:hover { background: var(--bg-panel); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #67e8f9, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #0f172a;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); truncate: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 0.6rem; color: var(--text-muted); }

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

/* === Top Bar === */
.topbar {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: rgba(2,6,23,0.6);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: text;
    transition: border-color 0.15s;
}

.topbar-search:focus-within {
    border-color: var(--border-cyan);
}

.topbar-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.topbar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 100%;
    font-family: inherit;
}
.topbar-search input::placeholder { color: var(--text-muted); }

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

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

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

.topbar-btn.primary {
    background: #67e8f9;
    color: #0f172a;
    border-color: #67e8f9;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(103,232,249,0.2);
}

.topbar-btn.primary:hover {
    background: #a5f3fc;
}

.topbar-btn svg { width: 14px; height: 14px; }

.notification-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

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

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f472b6;
    border: 1px solid var(--bg-base);
}

/* === Page Body === */
.page-body {
    flex: 1;
    padding: 1.25rem;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
}

/* === Panel / Card === */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(2,6,23,0.2);
}

.panel-cyan {
    background: rgba(103,232,249,0.045);
    border-color: rgba(103,232,249,0.2);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* === Stat Cards === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.625rem;
}

@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stat-icon { background: rgba(255,255,255,0.1); border-radius: 10px; padding: 0.5rem; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 16px; height: 16px; color: var(--cyan); }
.stat-value { font-size: 1.5rem; font-weight: 900; color: var(--text-primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); }

/* === Pills === */
.pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 99px;
    border: 1px solid;
    font-weight: 600;
}

.pill-sm  { padding: 0.1rem 0.5rem; font-size: 0.65rem; }
.pill-md  { padding: 0.25rem 0.625rem; font-size: 0.7rem; }

.pill-default { background: rgba(255,255,255,0.1); color: #cbd5e1; border-color: rgba(255,255,255,0.1); }
.pill-success { background: rgba(52,211,153,0.15); color: #6ee7b7; border-color: rgba(52,211,153,0.2); }
.pill-warn    { background: rgba(251,191,36,0.15); color: #fde68a; border-color: rgba(251,191,36,0.2); }
.pill-danger  { background: rgba(251,113,133,0.15); color: #fda4af; border-color: rgba(251,113,133,0.2); }
.pill-info    { background: rgba(103,232,249,0.15); color: #a5f3fc; border-color: rgba(103,232,249,0.2); }
.pill-purple  { background: rgba(192,132,252,0.15); color: #d8b4fe; border-color: rgba(192,132,252,0.2); }

/* === Phase Bar (Status Span) === */
.phase-bar-wrap {
    position: relative;
    height: 28px;
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.8);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.phase-bar-progress-line {
    position: absolute;
    inset: 0;
    z-index: 20;
    border-right: 1px solid rgba(255,255,255,0.8);
    pointer-events: none;
}

.phase-bar-inner {
    display: flex;
    height: 100%;
    width: 100%;
}

.phase-segment {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(2,6,23,0.25);
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    transition: opacity 0.2s;
    overflow: hidden;
}

.phase-segment .pulse-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.2);
    animation: phasePulse 2s ease-in-out infinite;
}

@keyframes phasePulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.phase-segment span { position: relative; z-index: 10; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Gantt Bar === */
.gantt-bar-wrap {
    position: relative;
    height: 32px;
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.8);
}

.gantt-grid-line {
    position: absolute;
    inset-y: 0;
    border-right: 1px solid rgba(255,255,255,0.035);
}

.gantt-phase {
    position: absolute;
    top: 4px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(2,6,23,0.3);
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(2,6,23,0.3);
}

.gantt-phase span { position: relative; z-index: 10; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gantt-today-line {
    position: absolute;
    inset-y: 0;
    z-index: 30;
    border-right: 1px solid rgba(255,255,255,0.8);
    pointer-events: none;
}

/* === Tracker Table === */
.tracker-wrap {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.35);
}

.tracker-header {
    display: grid;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    padding: 0.5rem 0.75rem;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.tracker-body {
    max-height: 690px;
    overflow-y: auto;
}

.tracker-body::-webkit-scrollbar { width: 4px; }
.tracker-body::-webkit-scrollbar-track { background: transparent; }
.tracker-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.tracker-row {
    display: grid;
    gap: 0.5rem;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
    width: 100%;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    color: inherit;
    font-family: inherit;
}

.tracker-row:hover { background: rgba(255,255,255,0.06); }
.tracker-row.selected { background: rgba(103,232,249,0.075); }

.project-code-cell { display: flex; align-items: center; gap: 0.5rem; }
.project-color-bar { width: 4px; height: 28px; border-radius: 99px; flex-shrink: 0; }
.project-code { font-size: 0.75rem; font-weight: 900; color: var(--cyan); }

.project-name-cell { min-width: 0; }
.project-name { font-size: 0.825rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-dates { margin-top: 2px; display: flex; align-items: center; gap: 0.375rem; font-size: 0.65rem; color: var(--text-muted); }
.project-dates svg { width: 11px; height: 11px; }

/* === Status Span columns === */
.tracker-status-cols { grid-template-columns: 116px 260px 142px 120px 90px 92px 105px minmax(520px, 1fr) 72px; min-width: 1520px; }
.tracker-gantt-cols  { grid-template-columns: 116px 260px 142px 100px 88px auto 72px; }

/* === Info Box === */
.info-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}
.info-box-label { font-size: 0.7rem; color: var(--text-muted); }
.info-box-value { margin-top: 0.25rem; font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }

/* === Summary Lifecycle Bar === */
.summary-stage-grid {
    display: grid;
    gap: 0.5rem;
}

.summary-stage-card {
    background: rgba(2,6,23,0.45);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.75rem;
}

.summary-stage-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.summary-stage-dot { width: 10px; height: 10px; border-radius: 50%; }
.summary-stage-count { font-size: 1.25rem; font-weight: 900; }
.summary-stage-label { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-stage-bar { margin-top: 0.5rem; height: 6px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.summary-stage-fill { height: 100%; border-radius: 99px; }

/* === Selected Project Rail === */
.phase-chip {
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: inherit;
}

.phase-chip:hover { background: rgba(255,255,255,0.07); }

.phase-chip.selected {
    border-color: var(--border-cyan);
    background: rgba(103,232,249,0.15);
}

.phase-chip-header { display: flex; align-items: center; gap: 0.5rem; }
.phase-chip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.phase-chip-label { font-size: 0.75rem; font-weight: 900; color: var(--text-primary); }
.phase-chip-meta { margin-top: 0.25rem; font-size: 0.65rem; color: var(--text-muted); }

/* === Progress Bar === */
.progress-bar-wrap { height: 10px; background: var(--bg-base); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #67e8f9, #3b82f6, #d946ef); }

/* === Filters Bar === */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.5);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-btn:hover { background: var(--bg-panel); color: var(--text-primary); }
.filter-btn svg { width: 14px; height: 14px; }

.view-toggle {
    background: rgba(2,6,23,0.5);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    padding: 0.2rem;
    display: inline-flex;
    gap: 0.1rem;
}

.view-toggle-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.view-toggle-btn.active {
    background: #67e8f9;
    color: #0f172a;
}

/* === Template Filter Tabs === */
.template-filter-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tmpl-tab {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.tmpl-tab.active {
    border-color: var(--cyan);
    background: var(--cyan);
    color: #0f172a;
}

/* === Discussion Board === */
.discussion-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.discussion-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--cyan-dim);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.discussion-icon svg { width: 16px; height: 16px; }

/* === Form inputs === */
.ipm-input, .ipm-select, .ipm-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.ipm-input:focus, .ipm-select:focus, .ipm-textarea:focus {
    border-color: rgba(103,232,249,0.6);
}

.ipm-input::placeholder, .ipm-textarea::placeholder { color: #334155; }

.ipm-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.ipm-select { appearance: none; }

/* === Form Section === */
.form-section {
    margin-bottom: 1.25rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.25);
    padding: 1rem;
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--cyan-dim);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-section-icon svg { width: 20px; height: 20px; }
.form-section-title { font-size: 0.9rem; font-weight: 900; color: var(--text-primary); }
.form-section-sub { font-size: 0.75rem; color: var(--text-muted); }

/* === Template Picker Card === */
.tmpl-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.35);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.tmpl-card:hover { background: rgba(255,255,255,0.06); }
.tmpl-card.selected { border-color: var(--border-cyan); background: rgba(103,232,249,0.1); }

.tmpl-card-accent { height: 6px; border-radius: 99px; margin-bottom: 0.75rem; }
.tmpl-card-label { font-size: 0.875rem; font-weight: 900; color: var(--text-primary); }
.tmpl-card-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* === Toast Notifications === */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.9);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease;
}

.toast.success { border-color: rgba(52,211,153,0.3); }
.toast.error   { border-color: rgba(251,113,133,0.3); }
.toast.warn    { border-color: rgba(251,191,36,0.3); }

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

/* === Skeleton Loader === */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

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

/* === Drawer === */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(90vw, 1100px);
    background: rgba(7,11,24,0.97);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(30px);
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

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

/* === Scrollbar global === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* === Utility === */
.d-none     { display: none !important; }
.text-cyan  { color: var(--cyan); }
.text-muted { color: var(--text-muted); }
.text-cyan-200 { color: #a5f3fc; }
.text-slate-600 { color: #475569; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-100 { color: #f1f5f9; }
.text-sm    { font-size: 0.8rem; }
.text-xs    { font-size: 0.7rem; }
.text-xxs   { font-size: 0.65rem; }
.font-black { font-weight: 900; }
.font-bold  { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-2      { gap: 0.5rem; }
.gap-3      { gap: 0.75rem; }
.flex       { display: flex; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.flex-wrap  { flex-wrap: wrap; }
.flex-col   { flex-direction: column; }
.flex-1     { flex: 1; }
.shrink-0   { flex-shrink: 0; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.p-5  { padding: 1.25rem; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.opacity-25 { opacity: 0.25; }

/* === Detail Dock Tabs === */
.detail-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    font-family: inherit;
    white-space: nowrap;
}

.detail-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.detail-tab.active {
    background: var(--bg-panel);
    border-color: var(--border);
    color: var(--cyan);
}

.detail-tab svg { width: 13px; height: 13px; }

.detail-tab-panel { display: none; padding-top: 0.875rem; }
.detail-tab-panel.active { display: block; }

/* === Activity / Timeline Feed === */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.40);
}
.activity-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-icon svg { width: 16px; height: 16px; }

/* === Gantt header border utility === */
.border-r { border-right: 1px solid; }
.border-white-5 { border-color: rgba(255,255,255,0.05); }
.text-center { text-align: center; }

/* === Tailwind color classes used for stage colors === */
.bg-slate-500  { background-color: #64748b; }
.bg-sky-500    { background-color: #0ea5e9; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-purple-500 { background-color: #a855f7; }
.bg-cyan-500   { background-color: #06b6d4; }
.bg-amber-400  { background-color: #fbbf24; }
.bg-amber-500  { background-color: #f59e0b; }
.bg-emerald-500{ background-color: #10b981; }
.bg-blue-500   { background-color: #3b82f6; }
.bg-pink-500   { background-color: #ec4899; }
.bg-green-600  { background-color: #16a34a; }

/* Additional stage colors from theme reference */
.bg-sky-400    { background-color: #38bdf8; }
.bg-teal-500   { background-color: #14b8a6; }
.bg-rose-500   { background-color: #f43f5e; }
.bg-orange-500 { background-color: #f97316; }
.bg-lime-500   { background-color: #84cc16; }
.bg-yellow-400 { background-color: #facc15; }
.bg-red-500    { background-color: #ef4444; }
.bg-indigo-400 { background-color: #818cf8; }
.bg-fuchsia-500{ background-color: #d946ef; }

/* Auth-specific */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #67e8f9, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    box-shadow: 0 0 30px rgba(103,232,249,0.25);
}

.auth-logo-icon svg { width: 28px; height: 28px; color: white; }
.auth-title { font-size: 1.5rem; font-weight: 900; }
.auth-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.o365-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}

.o365-btn:hover { background: var(--bg-panel); border-color: rgba(255,255,255,0.2); }

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: none;
    background: #67e8f9;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    box-shadow: 0 0 20px rgba(103,232,249,0.2);
}

.btn-primary:hover { background: #a5f3fc; }

/* Inline error messages */
.field-error { color: #fda4af; font-size: 0.7rem; margin-top: 0.25rem; }

/* === Mobile nav toggle === */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-nav-toggle { display: flex; }
}
