:root {
    --bg: #0b1220;
    --panel: rgba(255,255,255,0.06);
    --panel2: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.10);
    --text: rgba(255,255,255,0.92);
    --muted: rgba(255,255,255,0.68);
    --muted2: rgba(255,255,255,0.55);

    --ok: #22c55e;
    --warn: #f59e0b;
    --down: #ef4444;
    --info: #38bdf8;

    --chip: rgba(255,255,255,0.06);
    --chipHover: rgba(255,255,255,0.10);
    --shadow: 0 18px 60px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background:
        radial-gradient(1200px 700px at 15% -10%, rgba(56,189,248,0.18), transparent 55%),
        radial-gradient(900px 500px at 95% 0%, rgba(34,197,94,0.14), transparent 55%),
        radial-gradient(1000px 700px at 70% 110%, rgba(239,68,68,0.12), transparent 50%),
        var(--bg);
    color: var(--text);
}

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

/* In the tasks table, show links clearly (subtle underline), like professional dashboards */
.table td a {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255,255,255,0.15);
}
.table td a:hover {
    color: var(--info);
    text-decoration-color: rgba(56,189,248,0.65);
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 18px 18px 28px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.brand { display:flex; align-items:center; gap:12px; }
.brand .logo {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(56,189,248,0.95), rgba(34,197,94,0.85));
    box-shadow: 0 10px 24px rgba(56,189,248,0.14);
}
.brand h1 { margin: 0; font-size: 16px; letter-spacing: 0.2px; }
.brand .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.top-actions { display:flex; align-items:center; gap:10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.10); }
.btn.primary {
    border-color: rgba(56,189,248,0.28);
    background: linear-gradient(90deg, rgba(56,189,248,0.22), rgba(34,197,94,0.18));
}

.grid {
    margin-top: 14px;
    display: grid;
    gap: 14px;
    grid-template-columns: 1.35fr 0.85fr;
    align-items: start;
}

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

.card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-h {
    padding: 12px 14px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card-h .title { font-size: 13px; font-weight: 650; letter-spacing: 0.2px; }
.card-h .hint { font-size: 12px; color: var(--muted); }
.card-b { padding: 14px; }

.row { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }

.chip {
    display:inline-flex;
    gap: 8px;
    align-items:center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--chip);
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
}
.chip:hover { background: var(--chipHover); }
.chip[data-active="1"] { border-color: rgba(56,189,248,0.55); box-shadow: 0 0 0 3px rgba(56,189,248,0.10); }
.chip.disabled {
    pointer-events: none;
    opacity: 0.55;
}

/* Tasks table loading skeleton */
.skeleton {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.06),
        rgba(255,255,255,0.12),
        rgba(255,255,255,0.06)
    );
    background-size: 240% 100%;
    animation: sk 1.1s ease-in-out infinite;
}

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

tr.loading-row td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.30); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.down { background: var(--down); }
.dot.info { background: var(--info); }

.badge {
    display:inline-flex;
    align-items:center;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    white-space: nowrap;
}
.badge.ok { border-color: rgba(34,197,94,0.35); color: rgba(34,197,94,0.95); }
.badge.warn { border-color: rgba(245,158,11,0.35); color: rgba(245,158,11,0.92); }
.badge.down { border-color: rgba(239,68,68,0.38); color: rgba(239,68,68,0.95); }
.badge.info { border-color: rgba(56,189,248,0.38); color: rgba(56,189,248,0.95); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th {
    text-align:left;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.table td {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: top;
}
.table tr:hover td { background: rgba(255,255,255,0.04); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.muted { color: var(--muted); }
.muted2 { color: var(--muted2); }

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Right panel: chat */
.chat {
    height: calc(100vh - 110px);
    display:flex;
    flex-direction: column;
}
@media (max-width: 1024px) {
    .chat { height: auto; }
}

.chat-body {
    padding: 12px 14px;
    flex: 1 1 auto;
    overflow: auto;
}
.chat-msgs { display:flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; border:1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.05); line-height: 1.35; }
.msg.user { align-self: flex-end; border-color: rgba(56,189,248,0.22); background: rgba(56,189,248,0.10); }
.msg.assistant { align-self: flex-start; }
.msg .meta { margin-top: 6px; font-size: 11px; color: var(--muted2); }
.msg a { color: var(--info); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.msg a:hover { color: #60d5ff; text-decoration-color: rgba(56,189,248,0.8); }

.chat-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.12);
}
.composer { position: relative; }
.composer textarea {
    width: 100%;
    resize: none;
    min-height: 46px;
    max-height: 180px;
    padding: 10px 12px;
    padding-right: 92px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    outline: none;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}
.composer textarea:focus { border-color: rgba(56,189,248,0.55); box-shadow: 0 0 0 3px rgba(56,189,248,0.12); }
.composer .send {
    position:absolute;
    right: 8px;
    bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(56,189,248,0.35);
    background: rgba(56,189,248,0.14);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}
.composer .send:hover { background: rgba(56,189,248,0.20); }

.cmd {
    margin-top: 10px;
    display:flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cmd .q {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}
.cmd .q:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.cmd-help {
    display:none;
    margin-top: 10px;
    border: 1px dashed rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.12);
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--muted);
}
.cmd-help code { color: rgba(56,189,248,0.95); }

/* Chart placeholder */
.chart-box {
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: 14px;
    background: rgba(0,0,0,0.12);
    height: 220px;
    padding: 12px;
    display:flex;
    align-items: flex-end;
    gap: 10px;
    overflow: hidden;
}
.bar { width: 100%; border-radius: 10px; background: rgba(56,189,248,0.22); border: 1px solid rgba(56,189,248,0.18); position: relative; }
.bar span { position:absolute; top: -18px; left: 0; font-size: 11px; color: var(--muted2); }

.kpi {
    display:grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 860px) { .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi .box {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 10px;
}
.kpi .box .v { font-size: 18px; font-weight: 700; }
.kpi .box .k { margin-top: 4px; font-size: 12px; color: var(--muted); }

.footer-line {
    margin-top: 14px;
    color: var(--muted2);
    font-size: 12px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.search {
    display:flex;
    gap: 8px;
    align-items:center;
}
.search input {
    width: 360px;
    max-width: 55vw;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    outline: none;
    font-size: 13px;
}
.search input:focus { border-color: rgba(56,189,248,0.55); box-shadow: 0 0 0 3px rgba(56,189,248,0.12); }

/* Issue summary card styles */
.issue-list { display:flex; flex-direction:column; gap:10px; font-size:13px; }
.issue-card {
    padding:10px 12px;
    border-radius:10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    display:flex;
    gap:12px;
    align-items:flex-start;
}
.issue-card .left { width:72px; flex-shrink:0; }
.issue-card .left .id { font-weight:700; font-size:13px; color:var(--info); }
.issue-card .body { flex:1; }
.issue-card .body h4 { margin:0 0 6px 0; font-size:14px; font-weight:700; }
.issue-card .meta { color:var(--muted2); font-size:12px; display:flex; gap:8px; flex-wrap:wrap; }
.issue-card a { color:inherit; text-decoration:none; border-bottom:1px dashed rgba(255,255,255,0.04); }
.issue-card a:hover { color:var(--info); }
.issue-card .priority { font-weight:600; color:var(--muted); }
.issue-card + .issue-card { margin-top: 6px; }

/* Fullscreen chat styles */
.chat.fullscreen {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    height: auto !important;
    z-index: 12000 !important;
    max-width: none !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    /* Make fullscreen background fully opaque (no translucency) */
    background-color: var(--bg) !important;
    opacity: 1 !important;
    /* optional: stronger border to separate from page */
    border: 1px solid rgba(255,255,255,0.06) !important;
}
.chat.fullscreen .chat-body { flex: 1 1 auto; max-height: none; overflow: auto; }
/* Ensure header and footer are also non-transparent when fullscreen */
.chat.fullscreen .card-h, .chat.fullscreen .chat-footer {
    z-index: 12010;
    background-color: rgba(11,18,32,1) !important; /* same as var(--bg) */
}
body.chat-fullscreen-lock { overflow: hidden; }

/* Redmine Tasks Card Collapse/Expand Styles */
#redmineTasksCard.collapsed #redmineTasksContent {
    display: none;
}
#redmineTasksCard.collapsed {
    /* Optional: Make the card smaller when collapsed */
    /* You can adjust or remove this if you want to keep the same height */
}

/* Chat Card Collapse/Expand Styles */
#chatCard.collapsed #chatContent {
    display: none;
}
#chatCard.collapsed .chat-footer {
    display: none;
}

/* ========================================
   Productivity Tools Styles
   ======================================== */

.productivity-widget {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

/* Pomodoro Timer Styles */
.pomodoro-display {
    text-align: center;
    padding: 20px 0;
}

.pomodoro-time {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text);
    line-height: 1;
}

.pomodoro-status {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
}

.pomodoro-display.working {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(245,158,11,0.1));
    border-radius: 8px;
}

.pomodoro-display.working .pomodoro-time {
    color: var(--warn);
}

.pomodoro-display.break {
    background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(56,189,248,0.1));
    border-radius: 8px;
}

.pomodoro-display.break .pomodoro-time {
    color: var(--ok);
}

/* Habit Item Styles */
.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.habit-item:hover {
    background: var(--chipHover);
}

.habit-item.completed {
    opacity: 0.7;
}

.habit-item .habit-name {
    flex: 1;
    color: var(--text);
    font-size: 14px;
}

.habit-item.completed .habit-name {
    text-decoration: line-through;
    color: var(--muted);
}

.habit-item .habit-streak {
    font-size: 12px;
    color: var(--warn);
    margin: 0 10px;
    font-weight: 600;
}

.habit-item .habit-actions {
    display: flex;
    gap: 6px;
}

.habit-item .habit-check {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid var(--border);
    background: var(--panel2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.habit-item .habit-check:hover {
    border-color: var(--ok);
    background: rgba(34,197,94,0.1);
}

.habit-item.completed .habit-check {
    background: var(--ok);
    border-color: var(--ok);
}

.habit-item .habit-check::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.habit-item.completed .habit-check::after {
    opacity: 1;
}

.habit-item .habit-delete {
    padding: 4px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.habit-item .habit-delete:hover {
    background: var(--down);
    border-color: var(--down);
    color: #fff;
}

/* Notes Styles */
.note-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.note-item:hover {
    background: var(--chipHover);
}

.note-item .note-time {
    font-size: 11px;
    color: var(--muted2);
    font-family: monospace;
    white-space: nowrap;
    min-width: 50px;
}

.note-item .note-content {
    flex: 1;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.note-item .note-delete {
    padding: 2px 6px;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.note-item .note-delete:hover {
    background: var(--down);
    border-color: var(--down);
    color: #fff;
}

/* Productivity Card Collapse */
#productivityCard.collapsed #productivityContent {
    display: none;
}

/* Focus Mode Indicator Animation */
#focusModeIndicator {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Toast notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Changelog Widget Styles */
.changelog-list {
    display: grid;
    gap: 10px;
}

.changelog-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
    border-left: 3px solid var(--info);
}

.changelog-item:hover {
    background: var(--panel2);
    border-left-color: var(--ok);
    transform: translateX(2px);
}

.changelog-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.changelog-version {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    font-family: 'Courier New', monospace;
}

.changelog-date {
    color: var(--muted);
    font-size: 12px;
}

.changelog-title {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.changelog-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-released {
    background: rgba(34, 197, 94, 0.2);
    color: var(--ok);
    border: 1px solid var(--ok);
}

.status-beta {
    background: rgba(56, 189, 248, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}

.status-upcoming {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warn);
    border: 1px solid var(--warn);
}

.changelog-changes {
    color: var(--muted2);
    font-size: 12px;
}

.changelog-empty {
    text-align: center;
    padding: 20px;
    color: var(--muted2);
    font-size: 14px;
}

/* Developer Tools Cards */
.tool-card:hover {
    background: var(--chipHover) !important;
    border-color: var(--info) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.tool-card:active {
    transform: translateY(-1px);
}

