:root {
    --ai-bg-gradient: radial-gradient(circle at 0% 0%, #1f2937 0, #020617 35%, #020617 100%);
    --ai-bg-glow: radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.35) 0, transparent 55%);
    --ai-card: rgba(15, 23, 42, 0.78);
    --ai-card-soft: rgba(15, 23, 42, 0.6);
    --ai-border: rgba(148, 163, 184, 0.45);
    --ai-border-soft: rgba(148, 163, 184, 0.25);
    --ai-text: #e5e7eb;
    --ai-muted: #9ca3af;
    --ai-brand: #38bdf8;
    --ai-brand-soft: rgba(56, 189, 248, 0.12);
    --ai-bubble-ai: rgba(15, 23, 42, 0.9);
    --ai-bubble-user: rgba(56, 189, 248, 0.14);
    --ai-scrollbar-track: rgba(15, 23, 42, 0.7);
    --ai-scrollbar-thumb: rgba(148, 163, 184, 0.8);
}

/* Reusable thin scrollbar utility. Use this class on any scrolling container to get
   a subtle, background-friendly scrollbar across browsers. Also referenced by
   existing selectors to gradually standardize appearance. */
:root {
    --thin-scroll-track: transparent;
    --thin-scroll-thumb: rgba(255, 255, 255, 0.35);
    --thin-scroll-thumb-hover: rgba(255, 255, 255, 0.5);
}

.thin-scrollbar {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--thin-scroll-thumb) var(--thin-scroll-track);
}
.thin-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.thin-scrollbar::-webkit-scrollbar-track { background: var(--thin-scroll-track); }
.thin-scrollbar::-webkit-scrollbar-thumb {
    background: var(--thin-scroll-thumb);
    border-radius: 4px;
}
.thin-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--thin-scroll-thumb-hover); }

* {
    box-sizing: border-box;
}

body.ai-body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ai-text);

    /* use your enterprise blue background image */
    background-image: url("/images/bg001.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

/* main layout under topbar */
.ai-main {
    flex: 1;
    padding: 32px 24px 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ai-main .main {
    width: 100%;
    max-width: 960px;
}

/* glass window card */
.window-card {
    position: relative;
    background: var(--ai-card);
    border-radius: 24px;
    border: 1px solid var(--ai-border);
    box-shadow:
        0 24px 80px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(15, 23, 42, 0.6);
    overflow: hidden;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.window-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0%, rgba(244, 63, 94, 0.12), transparent 55%);
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Standard card used across non-window panels (home dashboard cards, small panels) */
.card {
    background: var(--ai-card);
    color: var(--ai-text);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(2,6,17,0.6);
    margin-bottom: 15px;
    border: 1px solid var(--ai-border);
}

/* Data modal / table tweaks */
.dm-table-wrapper {
    overflow: auto;
    min-height: 240px; /* reserve space for ~5 rows even when empty */
}
.dm-table {
    width: 100%;
    border-collapse: collapse;
}
.dm-table thead tr {
    background: linear-gradient(90deg, rgba(3,37,76,0.95), rgba(6,48,90,0.95));
}
.dm-table thead th {
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}
.dm-table td {
    color: var(--ai-text);
    opacity: 0.98;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 15px;
}

.dm-table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.01);
}
.dm-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

/* Strong overrides for #dataModal to beat legacy `style.css` specificity */
#dataModal .dm-table {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.03) !important;
}
#dataModal .dm-table thead {
    background: linear-gradient(90deg, rgba(2,30,60,0.98), rgba(6,48,90,0.98)) !important;
}
#dataModal .dm-table thead th {
    color: #ffffff !important;
    font-weight: 700 !important;
}
#dataModal .dm-table td {
    color: var(--ai-text) !important;
    opacity: 0.96 !important;
    background: transparent !important;
}
#dataModal .dm-table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.01) !important;
}
#dataModal .dm-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02) !important;
}

/* Pagination button contrast */
#dataModal .data-btn {
    background: rgba(56,124,246,0.95) !important;
    color: #fff !important;
}

/* User overview panel (large white card under board) */
.scrum-user-overview-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.96));
    border-radius: 12px;
    padding: 18px;
    margin: 12px 0;
    box-shadow: 0 6px 18px rgba(2,6,17,0.2);
    display: block;
}
.scrum-user-overview-inner {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}
.scrum-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 60%;
    padding: 12px 16px;
    border-radius: 8px;
    background: transparent;
}
.scrum-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}
.scrum-user-name { font-weight:700; color:#0f172a; font-size:18px; }
.scrum-user-role { color:#475569; font-size:13px; margin-top:4px }
.scrum-user-chips { margin-top:10px; }
.scrum-user-chips .chip { display:inline-block; background: #f1f5f9; color:#0f172a; padding:6px 10px; border-radius:999px; font-size:12px; margin-right:8px; }

.scrum-active-sprints { flex: 0 0 260px; }
.active-sprints-title { color: var(--ai-brand); margin:0 0 8px 0; }
.active-sprints-list { display:flex; flex-direction:column; gap:10px; }
.active-sprint-card { background: #f1f5f9; border-radius:8px; padding:12px; box-shadow: 0 6px 12px rgba(2,6,17,0.08); }
.active-sprint-title { font-weight:700; color:#0f172a; margin-bottom:6px }
.active-sprint-dates { font-size:12px; color:#475569; margin-bottom:8px }
.active-sprint-progress-wrap { background:#e6eefb; border-radius:6px; height:8px; overflow:hidden; }
.active-sprint-progress { background: #06b6d4; height:8px; width:8%; border-radius:6px; }

/* small responsive tweaks */
@media (max-width:900px) {
    .scrum-user-overview-inner { flex-direction:column; }
    .scrum-active-sprints { width:100%; }
}

/* Window modal header/title small tweaks (Data Management) */
.window-modal .window-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
}

/* modal control dots slightly smaller */
.window-modal-dot { width: 12px; height: 12px; }

/* Data button font adjustments (applies to Import CSV label too) */
.data-btn {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
}

/* Smaller dot buttons when inside header (for nested modals) */
.window-modal .window-modal-dots .window-modal-dot { width: 12px; height: 12px; }

/* titlebar with mac-style dots */
.window-titlebar {
    position: relative;
    z-index: 1;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--ai-border-soft);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.8));
}

.window-titlebar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.window-dot.red {
    background: #f97373;
}

.window-dot.amber {
    background: #facc6b;
}

.window-dot.green {
    background: #4ade80;
}

.window-title-text h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e5e7eb;
}

.window-title-text span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--ai-muted);
}

/* right side of title bar */
.window-titlebar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--ai-muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.16);
    border: 1px solid rgba(22, 163, 74, 0.32);
    color: #bbf7d0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

.model-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--ai-border-soft);
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.26), transparent 70%);
    color: #e5e7eb;
}

/* body */
.window-body {
    position: relative;
    z-index: 1;
    padding: 18px 18px 20px;
}

.window-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* small info banner */
.assistant-note {
    font-size: 12px;
    color: var(--ai-muted);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.4));
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid var(--ai-border-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

.assistant-note-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.6);
    color: #e0f2fe;
}

/* toolbar row (shortcuts + buttons) */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.toolbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-chip {
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--ai-border-soft);
    background: rgba(15, 23, 42, 0.9);
    color: var(--ai-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.toolbar-chip span.key {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 11px;
}

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

.actions button,
.actions a button {
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid var(--ai-border-soft);
    background: rgba(15, 23, 42, 0.85);
    color: var(--ai-muted);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.actions button:hover,
.actions a button:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(148, 163, 184, 0.75);
    transform: translateY(-1px);
}

/* chat layout */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* messages area */
.chat-messages {
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--ai-border-soft);
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.09), transparent 55%),
                linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.86));
    padding: 14px 12px;
    min-height: 260px;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* scrollbars */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--ai-scrollbar-track);
    border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--ai-scrollbar-thumb, rgba(148,163,184,0.2));
    border-radius: 999px;
}

/* Window/modal scrollbar styling to match projects panel */
/* Apply thin scrollbar utility to existing modal and project containers */
.window-modal, .window-modal .window-modal-body,
.scrum-projects-table-wrapper,
.chat-messages,
.dm-table-wrapper {
    /* use the utility class rules for consistency */
    scrollbar-width: thin;
    scrollbar-color: var(--thin-scroll-thumb) var(--thin-scroll-track);
}
.window-modal::-webkit-scrollbar,
.window-modal .window-modal-body::-webkit-scrollbar,
.scrum-projects-table-wrapper::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.dm-table-wrapper::-webkit-scrollbar {
    width: 6px;
}
.window-modal::-webkit-scrollbar-track,
.window-modal .window-modal-body::-webkit-scrollbar-track,
.scrum-projects-table-wrapper::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.dm-table-wrapper::-webkit-scrollbar-track {
    background: var(--thin-scroll-track);
}
.window-modal::-webkit-scrollbar-thumb,
.window-modal .window-modal-body::-webkit-scrollbar-thumb,
.scrum-projects-table-wrapper::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.dm-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--thin-scroll-thumb);
    border-radius: 4px;
}
.window-modal::-webkit-scrollbar-thumb:hover,
.window-modal .window-modal-body::-webkit-scrollbar-thumb:hover,
.scrum-projects-table-wrapper::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.dm-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--thin-scroll-thumb-hover);
}

/* messages */
.msg-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.msg-row:last-child {
    margin-bottom: 0;
}

.msg-row.ai {
    justify-content: flex-start;
}

.msg-row.user {
    justify-content: flex-end;
}

/* avatar */
.avatar {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--ai-border-soft);
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.9));
    color: #e5e7eb;
}

.avatar.user {
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.9));
}

/* bubble */
.bubble {
    position: relative;
    max-width: 78%;
    padding: 9px 11px 18px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.msg-row.ai .bubble {
    background: var(--ai-bubble-ai);
    border: 1px solid var(--ai-border-soft);
    color: #e5e7eb;
}

.msg-row.user .bubble {
    background: var(--ai-bubble-user);
    border: 1px solid rgba(56, 189, 248, 0.7);
    color: #e0f2fe;
}

/* timestamp */
.stamp {
    display: inline-flex;
    margin-top: 6px;
    font-size: 11px;
    color: var(--ai-muted);
    opacity: 0.8;
}

/* thinking indicator */
.thinking {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.thinking::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.4);
    border-top-color: rgba(56, 189, 248, 0.9);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* input row */
.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border-radius: 18px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--ai-border-soft);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
}

.chat-input textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--ai-text);
    font-size: 13px;
    max-height: 160px;
}

.chat-input textarea::placeholder {
    color: var(--ai-muted);
}



/* ==== Auth / login page built on top of glass theme ==== */

/* Center card vertically a bit more for login */
.ai-login-main {
    align-items: center;
    padding-top: 60px;
}

/* Login card width a bit smaller than AI chat window */
.auth-card {
    max-width: 420px;
    width: 100%;
}

/* Layout wrapper inside window-body */
.auth-layout {
    display: flex;
    flex-direction: column;
}

/* Form block */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Form header text */
.auth-form-header h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: #e5e7eb;
}

.auth-form-header p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--ai-muted);
}

/* Labels and inputs */
.auth-form label {
    font-size: 13px;
    color: var(--ai-muted);
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    margin-top: 4px;
    margin-bottom: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-form input[type="text"]::placeholder,
.auth-form input[type="password"]::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    border-color: rgba(56, 189, 248, 0.9);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
    background: rgba(15, 23, 42, 0.95);
}

/* Submit button */
.auth-submit {
    margin-top: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #0b1120;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    cursor: pointer;
    box-shadow:
        0 8px 22px rgba(56, 189, 248, 0.4),
        0 0 0 1px rgba(15, 23, 42, 0.8);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.auth-submit:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow:
        0 10px 26px rgba(56, 189, 248, 0.5),
        0 0 0 1px rgba(15, 23, 42, 0.8);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow:
        0 4px 14px rgba(56, 189, 248, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.8);
}

/* Error / success messages */
.auth-message {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

.auth-error {
    background: rgba(248, 113, 113, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fed7d7;
}

.auth-success {
    background: rgba(52, 211, 153, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.7);
    color: #bbf7d0;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .ai-login-main {
        padding-top: 40px;
        padding-inline: 16px;
    }

    .auth-card {
        border-radius: 20px;
    }
}


/* send button */
#sendBtn {
    border-radius: 999px;
    border: none;
    min-width: 90px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0b1120;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    box-shadow:
        0 8px 22px rgba(56, 189, 248, 0.4),
        0 0 0 1px rgba(15, 23, 42, 0.8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

#sendBtn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow:
        0 10px 26px rgba(56, 189, 248, 0.5),
        0 0 0 1px rgba(15, 23, 42, 0.8);
}

#sendBtn:active {
    transform: translateY(0);
    box-shadow:
        0 4px 14px rgba(56, 189, 248, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.8);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

/* responsive */
@media (max-width: 768px) {
    .ai-main {
        padding: 20px 12px 28px;
    }

    .window-body {
        padding: 14px 12px 16px;
    }

    .chat-messages {
        min-height: 220px;
        max-height: 420px;
    }

    .bubble {
        max-width: 86%;
    }
}

/* --- Scrum layout using hammer-ai glass theme --- */
.ai-page-overlay {
    position: relative;
    min-height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.ai-main-container {
    max-width: 1280px;
    margin: 24px auto;
}

/* main glass window */

.glass-window {
    border-radius: 18px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f5f5f5;
}

/* generic glass panel inside window */

.glass-panel {
    border-radius: 14px;
    padding: 14px 16px;
    background: rgba(8, 12, 24, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrum specific */

.scrum-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scrum-window {
    width: 100%;
}

.scrum-header-title h1 {
    margin: 0;
    font-size: 24px;
}

.scrum-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    opacity: 0.8;
}

.scrum-header-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

/* Tabs */

.scrum-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 12px;
}

.scrum-tab-button {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 24, 52, 0.7);
    color: #eaeaea;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.scrum-tab-button.active {
    background: rgba(88, 142, 255, 0.9);
    color: #fff;
}

.scrum-tab-button:hover {
    transform: translateY(-1px);
}

/* 2-column content */

.scrum-content {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    gap: 16px;
}

.scrum-left-column,
.scrum-right-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Board */

.scrum-board-panel {
    padding: 12px;
}

.scrum-board-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.scrum-column-title {
    font-size: 14px;
    margin: 0 0 8px;
    opacity: 0.9;
}

.scrum-board-column {
    background: rgba(8, 18, 36, 0.8);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 120px;
}

.scrum-board-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Story cards */

.scrum-story-card {
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(30, 45, 85, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
}

.scrum-story-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.scrum-story-meta {
    font-size: 11px;
    opacity: 0.9;
}

.scrum-story-assignee {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.85;
}

/* Right column: daily form */

.scrum-daily-panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.scrum-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scrum-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scrum-label {
    font-size: 12px;
    opacity: 0.9;
}

.scrum-input,
.scrum-textarea,
.scrum-select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(12, 18, 36, 0.8);
    color: #f5f5f5;
    padding: 6px 8px;
    font-size: 13px;
    resize: vertical;
}

.scrum-input:focus,
.scrum-textarea:focus,
.scrum-select:focus {
    outline: none;
    border-color: rgba(102, 163, 255, 0.9);
}

.scrum-message {
    font-size: 12px;
    opacity: 0.85;
}

/* Utilities */

.scrum-muted {
    font-size: 13px;
    opacity: 0.8;
}

.hidden {
    display: none !important;
}

/* Responsive */

@media (max-width: 992px) {
    .scrum-content {
        grid-template-columns: 1fr;
    }
}

/* mobile: stack vertically */
@media (max-width: 992px) {
    .scrum-lower-windows {
        grid-template-columns: 1fr;
    }
}

/* Collapse toggle button */
.scrum-toggle-button {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(6, 17, 38, 0.6);
    color: #ffffff;
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.scrum-toggle-button:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Scrum page container: full width with fixed horizontal margin */
.scrum-page-container {
    width: 100%;
    max-width: none;                 /* 覆盖 ai-main-container 的 1280px 限制 */
    margin: 0;                       /* 不再居中留白 */
    padding: 24px 40px 40px;         /* 距离浏览器边缘固定 40px */
    box-sizing: border-box;
}

/* 确保三个窗口本身占满容器宽度 */
.scrum-window,
.scrum-daily-window,
.scrum-analytics-window {
    width: 100%;
}

/* 底部 Daily + Analytics 一排并列（各占一半） */
.scrum-lower-windows {
    display: flex;
    gap: 16px;
}

.scrum-daily-window,
.scrum-analytics-window {
    flex: 1 1 0;
}

/* Top scrum window content: single column (tab body only) */
.scrum-content {
    display: block;
    margin-top: 12px;
}


/* Window header + body */
.scrum-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}



/* Collapse state: only hide this window's body */
.scrum-window-collapsed .scrum-window-body {
    display: none;
}

/* Header: title left, collapse button right */
.scrum-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.scrum-header-toggle {
    display: flex;
    align-items: flex-start;
}

/* Project row 在 body 顶部右对齐 */
.scrum-header-controls-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Project list panel */
.scrum-project-list-header h3 {
    margin: 0;
    font-size: 16px;
}

/* small button variant */
.primary-button.small {
    padding: 4px 10px;
    font-size: 12px;
}

/* project table */
.scrum-project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.scrum-project-table th,
.scrum-project-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.scrum-project-table th {
    opacity: 0.85;
}

/* modal */
.scrum-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* ===========================
   Glass UI Buttons
   =========================== */

.primary-button,
.secondary-button {
    border-radius: 10px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

/* Primary (Save) */
.primary-button {
    background: rgba(0, 120, 255, 0.9);
    box-shadow: 0 0 10px rgba(0,120,255,0.45);
}

.primary-button:hover {
    background: rgba(0, 140, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(0,140,255,0.55);
}

/* Secondary (Cancel) */
.secondary-button {
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.35);
}

.secondary-button:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-1px);
}

/* Small size buttons */
.primary-button.small,
.secondary-button.small {
    padding: 5px 12px;
    font-size: 13px;
}


/* Modal background overlay */
.scrum-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Modal glass window */
.scrum-modal {
    background: rgba(255,255,255,0.13);
    border-radius: 22px;
    padding: 24px 28px;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 25px rgba(0,0,0,0.25);
}

/* Modal title */
.scrum-modal h2 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #fff;
}

/* Form rows spacing */
.scrum-modal .scrum-form-row {
    margin-bottom: 16px;
}


/* Inputs / textarea – consistent glass UI */
.scrum-input,
.scrum-textarea,
.scrum-select {
    background: rgba(10,25,50,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 12px;
    width: 100%;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.scrum-textarea {
    resize: vertical;
}

.scrum-input:focus,
.scrum-textarea:focus,
.scrum-select:focus {
    border-color: rgba(0,150,255,0.7);
    box-shadow: 0 0 6px rgba(0,150,255,0.6);
}

/* remove Safari auto-fill icons inside fields */
input::-webkit-contacts-auto-fill-button {
    visibility: hidden;
    display: none !important;
}

/* ===== Scrum Projects Table with sticky header & filters ===== */

.scrum-project-list-panel {
    margin-top: 24px;
}

/* 标题 + Create Project */
.scrum-project-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* 滚动容器：只滚 tbody 内容 */
.scrum-projects-table-wrapper {
    max-height: 260px;      /* 大约 5 行；需要的话可以微调 */
    overflow-y: auto;
    padding-right: 4px;
}

/* 表格本体 */
.scrum-projects-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* 表头：sticky + 背景 */
.scrum-projects-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(90deg, rgba(20,40,56,0.98), rgba(12,30,44,0.98)) !important;
    color: #f7fbff !important;
    box-shadow: inset 0 -6px 18px rgba(8,16,26,0.08), 0 1px 0 rgba(255,255,255,0.03) !important;
    border-bottom: 4px solid rgba(0,0,0,0.08) !important;
}

/* 表头内部布局：标题 + filter 控件 垂直排列 */
.scrum-header-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
}

.scrum-header-label {
    font-weight: 600;
    font-size: 14px;
    color: #e8f0ff;
}

/* 通用 filter 控件样式 */
.scrum-filter-control {
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(3, 20, 55, 0.9);
    color: #f3f6ff;
    padding: 3px 8px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.scrum-filter-control::placeholder {
    color: rgba(230, 235, 255, 0.6);
}

.scrum-filter-control:focus {
    border-color: #4da3ff;
    box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.5);
}

/* 表 body 单元格 */
.scrum-projects-table tbody td {
    padding: 10px 16px;
    font-size: 15px;
    color: #f3f6ff;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap; /* 如果希望描述能换行，就把这行删掉 */
}

/* Name / Description 稍宽 */
.scrum-projects-table th:nth-child(1),
.scrum-projects-table td:nth-child(1) {
    width: 20%;
}
.scrum-projects-table th:nth-child(2),
.scrum-projects-table td:nth-child(2) {
    width: 30%;
}

/* 其它列自动分配 */
.scrum-projects-table th:nth-child(n+3),
.scrum-projects-table td:nth-child(n+3) {
    width: auto;
}

/* hover 行高亮 */
.scrum-projects-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* 滚动条细一点（可选） */
.scrum-projects-table-wrapper::-webkit-scrollbar {
    width: 6px;
}
.scrum-projects-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.scrum-projects-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
}


/* ===== Daily & Analytics 默认收起/展开控制 ===== */

/* 默认展开时的 body 状态（可以根据你现有的调） */
.scrum-window-body {
    max-height: 1000px;
    padding-top: 16px;
    padding-bottom: 16px;
    transition: max-height 0.25s ease, padding-top 0.2s ease, padding-bottom 0.2s ease;
    overflow: hidden;
}

/* ✅ collapsed 状态：隐藏内容，只保留 header 高度 */
.scrum-daily-window.collapsed .scrum-window-body,
.scrum-analytics-window.collapsed .scrum-window-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* 可选：外层 window 收起时整体更扁一点 */
.scrum-daily-window.collapsed,
.scrum-analytics-window.collapsed {
    padding-bottom: 16px;
}

/* 通用窗口 body 默认展开状态 */
.scrum-window-body {
    max-height: 1000px;
    padding-top: 16px;
    padding-bottom: 16px;
    transition: max-height 0.25s ease,
                padding-top 0.2s ease,
                padding-bottom 0.2s ease;
    overflow: hidden;
}

/* ✅ 顶部主窗口收起时：隐藏 body，只留 header */
.scrum-window.collapsed .scrum-window-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Daily / Analytics 继续保留各自的 collapsed 行为 */
.scrum-daily-window.collapsed .scrum-window-body,
.scrum-analytics-window.collapsed .scrum-window-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.scrum-daily-window.collapsed,
.scrum-analytics-window.collapsed {
    padding-bottom: 16px;
}

.scrum-sprint-backlog-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.scrum-sprint-list-panel {
    flex: 0 0 36%;
}

.scrum-backlog-list-panel {
    flex: 1 0 0;
}

/* Sprint table wrapper: similar to projects */
.scrum-sprint-table-wrapper {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.scrum-sprint-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.scrum-sprint-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(20,40,56,0.98), rgba(12,30,44,0.98)) !important;
    color: #f7fbff !important;
    box-shadow: inset 0 -6px 18px rgba(8,16,26,0.08) !important;
    border-bottom: 4px solid rgba(0,0,0,0.08) !important;
}

/* reuse .scrum-header-cell, .scrum-header-label, .scrum-filter-control
   that you already have for project list */
.scrum-sprint-table tbody td {
    padding: 8px 12px;
    font-size: 14px;
    color: #f3f6ff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.scrum-sprint-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

/* --- Force left & right panels same width --- */

.scrum-sprint-backlog-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

/* Both use 50% width, equal spacing */
.scrum-sprint-list-panel,
.scrum-backlog-list-panel {
    flex: 1 1 0;
    width: 50%;
    min-width: 0; /* prevent overflow */
}

/* Optional: make them same height visually */
.scrum-sprint-list-panel,
.scrum-backlog-list-panel {
    display: flex;
    flex-direction: column;
}

/* === Sprint + Backlog row: equal width (we already discussed) === */
.scrum-sprint-backlog-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.scrum-sprint-list-panel,
.scrum-backlog-list-panel {
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* === Sprint timeline bar === */
.scrum-sprint-timeline {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
}

.scrum-sprint-timeline-label {
    margin-bottom: 4px;
    color: #e8f0ff;
}

.scrum-sprint-timeline-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-bottom: 4px;
}

.scrum-sprint-timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #40c4ff, #00e676);
    transition: width 0.25s ease;
}

.scrum-sprint-timeline-dates {
    display: flex;
    justify-content: space-between;
    color: rgba(230, 235, 255, 0.8);
}

/* === Sprint list header === */
.scrum-sprint-list-header,
.scrum-backlog-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* === Backlog table layout (similar to projects/sprints) === */
.scrum-backlog-table-wrapper {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.scrum-backlog-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.scrum-backlog-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(20,40,56,0.98), rgba(12,30,44,0.98)) !important;
    color: #f7fbff !important;
    box-shadow: inset 0 -6px 18px rgba(8,16,26,0.08) !important;
    border-bottom: 4px solid rgba(0,0,0,0.08) !important;
}

/* We reuse .scrum-header-cell, .scrum-header-label, .scrum-filter-control from project list */

.scrum-backlog-table tbody td {
    padding: 8px 12px;
    font-size: 14px;
    color: #f3f6ff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scrum-backlog-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Wider scrum modals for project / sprint / story */
.scrum-modal {
    width: 80vw;          /* 视口宽度的 80% */
    max-width: 960px;     /* 最大 960px */
    min-width: 640px;     /* 最小 640px，避免太窄 */
    padding: 24px 28px;   /* 稍微加一点内边距，看起来更舒服 */
}

/* Horizontal action buttons for modals */
.scrum-form-actions {
    display: flex;
    justify-content: flex-end;     /* 按钮整体靠右 */
    align-items: center;
    gap: 12px;                      /* 按钮之间的距离 */
    margin-top: 16px;
}

/* 如果 message 想放在右侧按钮左边，可这样 */
.scrum-form-actions .scrum-message {
    margin-left: auto;  /* 可选：把 message 挤到最左侧 */
}

/* Inner container: Cancel + Save horizontally */
.scrum-form-actions .scrum-form-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

/* Buttons themselves: do not stretch full width */
.scrum-form-actions .scrum-form-buttons .primary-button,
.scrum-form-actions .scrum-form-buttons .secondary-button {
    display: inline-flex;
    width: auto;
}

/* Message on its own line under the buttons, right aligned */
.scrum-form-actions .scrum-message {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.85;
    text-align: right;
}

/* ===== High-specificity overrides to force dark table headers =====
   These rules target the Data Management modal and any tables using
   the `.app-table` global class. They use !important and very specific
   selectors to override legacy `style.css` rules that were making the
   header too light. If this still doesn't take effect, the legacy CSS
   may be loaded after this file — we can then either move the include
   order or patch `style.css` directly. */

#dataModal .dm-table thead,
#dataModal .dm-table thead tr,
#dataModal .dm-table thead th,
#dataModal .app-table thead th,
.app-table thead th,
.window-modal .app-table thead th {
    background: linear-gradient(90deg, rgba(6,12,20,0.98), rgba(10,18,28,0.98)) !important;
    background-image: none !important;
    color: #dff6ff !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    box-shadow: none !important;
    font-weight: 600 !important;
}

#dataModal .dm-table thead th a,
#dataModal .dm-table thead th span,
.app-table thead th a,
.app-table thead th span {
    color: inherit !important;
}


#dataModal .dm-table tbody td,
#dataModal .app-table tbody td,
.app-table tbody td {
    color: #e6eef6 !important;
    opacity: 1 !important;
}

/* If table header still shows a pale gradient from legacy styles, remove it explicitly */
#dataModal .dm-table thead th::before,
.app-table thead th::before {
    display: none !important;
    content: none !important;
}

/* Blue-gray header variant: slightly darker than background, high-contrast */
/* Applies to Data Management modal and any table using `.app-table`. */
#dataModal .dm-table.app-table thead th,
#dataModal .app-table thead th,
.app-table thead th,
.window-modal .app-table thead th {
    background: linear-gradient(90deg, rgba(20,40,56,0.98), rgba(12,30,44,0.98)) !important;
    color: #f7fbff !important;
    font-weight: 600 !important;
    padding: 12px 16px !important;
    text-transform: none !important;
    letter-spacing: 0.015em !important;
    border-bottom: 4px solid rgba(0,0,0,0.12) !important;
    box-shadow: inset 0 -6px 20px rgba(8,16,26,0.12) !important;
}

/* Slight rounding on outer header cells to match panel corners */
.app-table thead th:first-child {
    border-top-left-radius: 6px !important;
}
.app-table thead th:last-child {
    border-top-right-radius: 6px !important;
}

/* Ensure header links/controls inherit the header color */
.app-table thead th a,
.app-table thead th span {
    color: inherit !important;
}

