:root {
    --bg: #07090d;
    --bg-soft: #0f1218;
    --panel: rgba(14, 18, 24, 0.92);
    --panel-2: rgba(18, 23, 31, 0.96);
    --text: #f5f7fb;
    --muted: #9ea7b5;
    --line: rgba(255, 255, 255, 0.08);
    --gold: #d6a62a;
    --gold-deep: #9d7311;
    --teal: #15b7c9;
    --green: #27c07d;
    --red: #ff6b6b;
    --orange: #ff9d4d;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background:
        radial-gradient(circle at top right, rgba(21, 183, 201, 0.18), transparent 22%),
        radial-gradient(circle at top left, rgba(214, 166, 42, 0.20), transparent 28%),
        linear-gradient(180deg, #05070a 0%, #0c1016 100%);
    color: var(--text);
    min-height: 100vh;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
}

img {
    max-width: 100%;
    display: block;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    padding: 28px;
}

.login-card,
.surface-card,
.stat-card,
.timeline-card,
.task-row,
.link-card,
.member-card,
.activity-item,
.kanban-card,
.chat-widget,
.sidebar,
.page-header,
.presentation-shell,
.presentation-hero {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(17, 22, 29, 0.96) 0%, rgba(10, 13, 19, 0.96) 100%);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 24px;
}

.brand-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 22px;
}

.brand-preview img {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-copy h1,
.page-header h1,
.presentation-hero h1 {
    margin: 10px 0 12px;
    line-height: 1.05;
    font-size: clamp(2rem, 3vw, 3.4rem);
}

.brand-copy p,
.page-header p,
.timeline-card p,
.task-meta,
.section-note,
.sidebar-meta,
.form-message,
.presentation-hero p {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
}

.eyebrow::before {
    content: "";
    width: 30px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--teal));
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pill-row span,
.status-pill,
.priority-pill,
.file-badge span,
.metric-chip {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.demo-credentials {
    margin-top: 18px;
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card h2 {
    margin: 10px 0 24px;
}

.stack-form,
.grid-form {
    display: grid;
    gap: 14px;
}

.grid-form.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack-form label,
.grid-form label {
    display: grid;
    gap: 8px;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(21, 183, 201, 0.7);
    transform: translateY(-1px);
}

textarea {
    min-height: 104px;
    resize: vertical;
}

.primary-btn,
.ghost-btn,
.tab-chip,
.quick-filter {
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.tab-chip:hover,
.quick-filter:hover,
.nav-item:hover {
    transform: translateY(-1px);
}

.primary-btn {
    background: linear-gradient(135deg, var(--gold), #f4d068);
    color: #121212;
}

.ghost-btn,
.tab-chip,
.quick-filter {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.small-btn {
    padding: 9px 12px;
    font-size: 0.88rem;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    min-height: 100vh;
    padding: 22px;
}

.sidebar {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 22px;
    height: calc(100vh - 44px);
}

.sidebar-top {
    display: grid;
    gap: 16px;
}

.sidebar-brand img {
    border-radius: 18px;
}

.user-chip {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-chip span,
.sidebar-footer small,
.muted {
    display: block;
    color: var(--muted);
}

.sidebar-section {
    display: grid;
    gap: 10px;
}

.sidebar-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.main-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    padding: 12px 14px;
    border-radius: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid transparent;
    font-weight: 700;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(214, 166, 42, 0.2), rgba(21, 183, 201, 0.18));
    border-color: rgba(214, 166, 42, 0.25);
}

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

.mini-stat {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-stat span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
}

.mini-stat strong {
    font-size: 1.4rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.content-area {
    display: grid;
    gap: 18px;
    padding-bottom: 120px;
}

.app-shell.in-lobby #dashboardView,
.app-shell.in-lobby #chatWidget,
.app-shell.in-lobby .main-nav,
.app-shell.in-lobby .compact-stats,
.app-shell.in-lobby .sidebar-section {
    display: none;
}

.app-shell.in-lobby .sidebar {
    height: auto;
}

.project-lobby {
    display: none;
    gap: 18px;
}

.app-shell.in-lobby .project-lobby {
    display: grid;
}

.lobby-head {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(214,166,42,0.07), rgba(21,183,201,0.08));
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
}

.lobby-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.project-entry-card,
.empty-state-card {
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
    border: 1px solid rgba(255,255,255,0.08);
    display: grid;
    gap: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.24);
}

.project-entry-card.selected {
    border-color: rgba(214,166,42,0.36);
    box-shadow: 0 24px 46px rgba(0,0,0,0.3), 0 0 0 1px rgba(214,166,42,0.08) inset;
}

.project-entry-top,
.project-entry-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
}

.project-entry-card h3,
.empty-state-card h3 {
    margin: 0;
    font-size: 1.22rem;
}

.project-entry-card p,
.empty-state-card p {
    margin: 0;
    color: var(--muted);
}

.page-header {
    padding: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-panel {
    display: none;
    gap: 18px;
}

.tab-panel.active {
    display: grid;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: clamp(1.6rem, 2.4vw, 2.5rem);
}

.overview-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
}

.overview-grid.single-column {
    grid-template-columns: 1fr;
}

.surface-card {
    padding: 20px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
}

.progress-wide,
.progress-bar {
    height: 10px;
    width: 100%;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.progress-wide span,
.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--teal));
}

.timeline-list,
.activity-list,
.member-list,
.link-list,
.task-section-list,
.entries-list,
.presentation-task-list {
    display: grid;
    gap: 12px;
}

.timeline-card,
.activity-item,
.link-card,
.member-card,
.kanban-card {
    padding: 16px;
}

.timeline-meta,
.task-submeta,
.activity-item small,
.member-card small,
.link-card small {
    color: var(--muted);
}

.task-toolbar {
    display: grid;
    gap: 14px;
}

.toolbar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-filter.active,
.tab-chip.active {
    border-color: rgba(21, 183, 201, 0.45);
    background: rgba(21, 183, 201, 0.13);
}

.task-section {
    display: grid;
    gap: 12px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.task-row {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.task-row-header,
.task-topline,
.member-topline,
.link-topline,
.activity-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.task-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.task-meta-row,
.metrics-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill,
.priority-pill,
.metric-chip {
    font-weight: 700;
}

.status-todo,
.status-planning {
    background: rgba(255, 255, 255, 0.05);
}

.status-in_progress,
.status-live {
    background: rgba(21, 183, 201, 0.15);
    border-color: rgba(21, 183, 201, 0.3);
}

.status-done {
    background: rgba(39, 192, 125, 0.16);
    border-color: rgba(39, 192, 125, 0.3);
}

.status-blocked {
    background: rgba(255, 107, 107, 0.16);
    border-color: rgba(255, 107, 107, 0.28);
}

.priority-high {
    background: rgba(255, 157, 77, 0.18);
    border-color: rgba(255, 157, 77, 0.3);
}

.priority-normal {
    background: rgba(214, 166, 42, 0.14);
    border-color: rgba(214, 166, 42, 0.28);
}

.priority-low {
    background: rgba(255, 255, 255, 0.06);
}

.task-editor {
    display: none;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.task-row.open .task-editor {
    display: grid;
}

.task-row.flash {
    animation: flashPulse 1.6s ease;
}

@keyframes flashPulse {
    0% {
        box-shadow: 0 0 0 rgba(21, 183, 201, 0);
        border-color: rgba(21, 183, 201, 0.15);
    }
    30% {
        box-shadow: 0 0 0 4px rgba(21, 183, 201, 0.18);
        border-color: rgba(21, 183, 201, 0.5);
    }
    100% {
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.08);
    }
}

.entry-card {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.entry-card.note {
    border-left: 3px solid var(--gold);
}

.entry-card.comment {
    border-left: 3px solid var(--teal);
}

.kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.kanban-column {
    display: grid;
    gap: 12px;
}

.kanban-column h3 {
    margin: 0;
}

.link-card,
.member-card {
    display: grid;
    gap: 8px;
}

.member-accent {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: min(420px, calc(100vw - 44px));
    z-index: 20;
    overflow: hidden;
}

.chat-widget.minimized {
    height: auto;
}

.chat-widget.minimized .chat-messages,
.chat-widget.minimized .chat-form {
    display: none;
}

.chat-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.chat-messages {
    max-height: 340px;
    overflow: auto;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.chat-bubble {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-bubble strong {
    display: block;
    margin-bottom: 6px;
}

.chat-bubble small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.file-badge {
    display: inline-flex;
    align-items: center;
}

.file-badge input {
    display: none;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kv-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.kv-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.empty-state {
    padding: 28px;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.presentation-body {
    padding: 24px;
}

.presentation-shell {
    padding: 20px;
    display: grid;
    gap: 18px;
    max-width: 1280px;
    margin: 0 auto;
}

.presentation-hero {
    padding: 20px;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.presentation-task {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 1240px) {
    .app-shell,
    .login-shell,
    .overview-grid,
    .presentation-hero {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kanban-grid,
    .grid-form.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell,
    .login-shell,
    .presentation-body {
        padding: 14px;
    }

    .page-header,
    .brand-card,
    .grid-form.two,
    .grid-form.three,
    .compact-stats,
    .stats-grid,
    .kanban-grid,
    .kv-grid,
    .chat-form {
        grid-template-columns: 1fr;
    }

    .page-header,
    .section-heading,
    .task-row-header,
    .task-topline,
    .member-topline,
    .link-topline,
    .activity-topline {
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .chat-widget {
        left: 14px;
        right: 14px;
        width: auto;
    }
}
