/* FSA Tasks — liquid glass theme matching fsasystems.net */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a1420;
    color: white;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.8s ease;
}
body.page-ready { opacity: 1; }

#bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #0f1c2e 0%, #000000 100%);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: opacity;
}
#bg-layer.visible { opacity: 1; }
/* static gradient layer behind everything so there's no flash before the image loads */
#bg-base {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(180deg, #0f1c2e 0%, #000000 100%);
}

.page-content { flex-grow: 1; display: block; }

/* ── Top bar ─────────────────────────────────────────────── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 10px 30px;
    min-height: 70px;
    background: linear-gradient(135deg, rgba(50,70,100,0.75) 0%, rgba(20,35,55,0.8) 100%);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.25),
        inset 1px 1px 0 rgba(255,255,255,0.4),
        inset -1px -1px 0 rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo-container { display: flex; align-items: center; gap: 14px; }
.logo { height: auto; max-height: 50px; max-width: 100%; object-fit: contain; }
.site-title { font-size: 24px; letter-spacing: 1px; text-shadow: 0 0 8px rgba(255,255,255,0.3); white-space: nowrap; }
.site-title strong { color: #4facfe; }

.overall-progress { display: flex; align-items: center; gap: 12px; flex: 1; max-width: 480px; }
.overall-bar {
    flex: 1; height: 12px; border-radius: 6px; overflow: hidden;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
}
.overall-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    box-shadow: 0 0 10px rgba(79,172,254,0.7);
    transition: width 0.6s ease;
}
.overall-pct { font-size: 15px; font-weight: 600; min-width: 42px; }

/* ── Buttons ─────────────────────────────────────────────── */
button {
    background: rgba(255,255,255,0.14);
    color: white;
    padding: 9px 18px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    text-shadow: 0 0 4px rgba(255,255,255,0.3);
}
button:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); box-shadow: 0 0 15px rgba(255,255,255,0.2); }
button:active { background: rgba(255,255,255,0.25); transform: scale(0.98); }
button.primary { background: rgba(79,172,254,0.25); border-color: rgba(79,172,254,0.6); }
button.primary:hover { background: rgba(79,172,254,0.4); box-shadow: 0 0 15px rgba(79,172,254,0.4); }
button.ghost { background: transparent; box-shadow: none; }
button.icon { padding: 4px 9px; font-size: 12px; box-shadow: none; }
button.danger:hover { background: rgba(255,80,80,0.3); border-color: rgba(255,80,80,0.6); }
.nav-buttons { display: flex; gap: 10px; align-items: center; }

/* Glass look on the dashboard top bar with zero scroll cost:
   a pre-blurred copy of the fixed background image is clipped inside the
   bar. Both are viewport-static, so the blur renders once — no per-frame
   backdrop re-blurring while content scrolls underneath. */
.dash-page .top-bar { background: transparent; }
.topbar-glass {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}
.topbar-glass::before {
    content: '';
    position: absolute;
    inset: -60px;
    background-image: var(--glass-bg, none);
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    filter: blur(18px) saturate(180%);
}
.topbar-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 100%);
}
html.theme-light .topbar-glass::after {
    background: linear-gradient(135deg, rgba(226,230,237,0.5) 0%, rgba(204,211,220,0.4) 100%);
}

/* ── Notification bell ───────────────────────────────────── */
.notif-wrap { position: relative; display: flex; }
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 9px;
}
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: rgba(255,60,60,0.9);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    pointer-events: none;
}
.notif-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 14px;
    background: rgba(15,28,46,0.96);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 200;
}
.notif-head {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.08); transform: none; }
.notif-icon { font-size: 16px; line-height: 1.3; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: #eee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-sub { font-size: 11.5px; color: rgba(255,255,255,0.55); }
.notif-critical .notif-title { color: #ffc4c4; }
.notif-urgent .notif-title { color: #ffd9b0; }
.notif-warning .notif-title { color: #ffe9b0; }
.notif-empty { padding: 22px 16px; font-size: 13px; color: rgba(255,255,255,0.55); text-align: center; }

/* ── Due banners ─────────────────────────────────────────── */
#banners { display: flex; flex-direction: column; gap: 8px; margin: 16px 30px 0; }
.banner {
    position: relative;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.banner .banner-icon { font-size: 18px; }
.banner-notice  { background: rgba(23,55,88,0.92); border-color: rgba(79,172,254,0.5); }
.banner-warning { background: rgba(72,58,20,0.92); border-color: rgba(255,200,60,0.55); color: #ffe9b0; }
.banner-urgent  {
    background: rgba(84,44,16,0.93); border-color: rgba(255,140,50,0.75); color: #ffd9b0;
    box-shadow: 0 0 14px rgba(255,140,50,0.4);
    animation: pulse-soft 2.5s ease-in-out infinite;
}
.banner-critical {
    background: rgba(94,22,22,0.94); border-color: rgba(255,60,60,0.9); color: #ffc4c4;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(255,60,60,0.55);
    animation: pulse-hard 1.2s ease-in-out infinite;
}
/* opacity-only pulses stay on the compositor (no per-frame repaint) */
@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.78; } }
@keyframes pulse-hard { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }

/* ── Dashboard tiles ─────────────────────────────────────── */
#dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    grid-auto-rows: 10px; /* fine-grained rows; tiles span rows to their height (masonry) */
    gap: 20px;
    padding: 20px 30px 40px;
    align-items: start;
}
.tile {
    background: linear-gradient(135deg, rgba(45,65,95,0.58) 0%, rgba(15,28,46,0.68) 100%);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 1px 1px 0 rgba(255,255,255,0.15);
    padding: 18px 20px;
    overflow: hidden;
}
.tile.wide { grid-column: 1 / -1; }
.tile h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.tile h2 .muted { font-weight: 400; font-size: 13px; color: #aaa; }

/* Overview tile */
.ring-wrap { display: flex; align-items: center; gap: 24px; }
.ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring-bg { stroke: rgba(255,255,255,0.12); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; filter: drop-shadow(0 0 6px rgba(79,172,254,0.7)); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label .big { font-size: 26px; font-weight: 700; }
.ring-label .small { font-size: 11px; color: #bbb; }
.type-breakdown { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.type-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.type-row .type-name { width: 90px; color: #ccc; }
.mini-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.mini-fill { height: 100%; background: linear-gradient(90deg, #4facfe, #00f2fe); transition: width 0.5s ease; }
.type-row .type-pct { width: 40px; text-align: right; font-weight: 600; }

/* Due soon tile */
.due-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.due-item { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.due-item .due-when { margin-left: auto; font-size: 12px; white-space: nowrap; }
.due-overdue .due-when { color: #ff7b7b; font-weight: 700; }
.due-today .due-when { color: #ffb366; font-weight: 600; }
.due-soon .due-when { color: #ffe08a; }
.due-later .due-when { color: #9ad0ff; }
.due-item .due-topic { color: #999; font-size: 12px; }

/* Grades tile */
.grade-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 14px; }
.grade-row:last-child { border-bottom: none; }
.grade-row .grade-name { flex: 1; }
.grade-badge { font-size: 16px; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); }
.grade-ok { color: #7bffb0; border-color: rgba(120,255,170,0.4); }
.grade-close { color: #ffe08a; border-color: rgba(255,220,120,0.4); }
.grade-behind { color: #ff8a8a; border-color: rgba(255,120,120,0.4); }
.grade-meta { font-size: 12px; color: #aaa; }

/* Topics tile / tree */
.topic-card {
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
}
.topic-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; }
.topic-header:hover { background: rgba(255,255,255,0.05); }
.topic-caret { transition: transform 0.25s ease; font-size: 12px; color: #9ad0ff; }
.topic-open .topic-caret { transform: rotate(90deg); }
.topic-title { font-size: 16px; font-weight: 600; }
.type-badge {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    padding: 3px 9px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.08);
}
.type-class    { color: #9ad0ff; border-color: rgba(79,172,254,0.5); }
.type-personal { color: #b3ffcc; border-color: rgba(120,255,170,0.4); }
.type-job      { color: #ffd9a0; border-color: rgba(255,190,100,0.45); }
.type-project  { color: #e0b3ff; border-color: rgba(200,120,255,0.45); }
.type-general  { color: #ddd; }
.topic-progress { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 160px; }
.topic-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.topic-fill { height: 100%; background: linear-gradient(90deg, #4facfe, #00f2fe); transition: width 0.5s ease; }
.topic-pct { font-size: 13px; font-weight: 600; min-width: 38px; text-align: right; }
.topic-count {
    font-size: 12px; font-weight: 600; color: #9ad0ff;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(79,172,254,0.12); border: 1px solid rgba(79,172,254,0.35);
    white-space: nowrap;
}
.topic-grade-chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); }
.topic-body { padding: 4px 16px 14px; display: none; }
.topic-open .topic-body { display: block; }
.topic-desc { color: #aaa; font-size: 13px; margin: 0 0 8px; }
.topic-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Task tree */
.task-tree, .task-children { list-style: none; margin: 0; padding: 0; }
.task-children { margin-left: 26px; border-left: 1px solid rgba(255,255,255,0.12); padding-left: 12px; }
.task-item { padding: 5px 0; }
.task-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.task-row input[type="checkbox"] {
    appearance: none; width: 18px; height: 18px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.4); border-radius: 5px;
    background: rgba(255,255,255,0.06); cursor: pointer; position: relative;
    transition: all 0.2s ease;
}
.task-row input[type="checkbox"]:checked { background: rgba(79,172,254,0.5); border-color: #4facfe; box-shadow: 0 0 8px rgba(79,172,254,0.5); }
.task-row input[type="checkbox"]:checked::after {
    content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: white;
}
.task-title { font-size: 14px; }
.task-done > .task-row .task-title { text-decoration: line-through; color: #888; }
.task-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15); color: #bbb; }
.badge-due-overdue { color: #ff8a8a; border-color: rgba(255,120,120,0.5); font-weight: 600; }
.badge-due-today { color: #ffb366; border-color: rgba(255,170,100,0.5); }
.badge-due-soon { color: #ffe08a; border-color: rgba(255,220,130,0.4); }
.badge-prio-high { color: #ff8a8a; border-color: rgba(255,120,120,0.5); }
.badge-prio-medium { color: #ffe08a; }
.badge-prio-low { color: #9ad0ff; }
.badge-points { color: #b3ffcc; }
.task-notes { font-size: 12px; color: #999; margin: 2px 0 0 27px; }
.task-tools { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.task-row:hover .task-tools { opacity: 1; }
.subtask-count { font-size: 11px; color: #9ad0ff; }

/* Recently completed tile */
.done-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #bbb; display: flex; flex-direction: column; gap: 6px; }
.done-list .when { color: #777; font-size: 11px; margin-left: 6px; }

.empty-hint { color: #999; font-size: 13px; font-style: italic; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
    width: 100%; max-width: 440px;
    background: linear-gradient(135deg, rgba(40,60,90,0.96) 0%, rgba(15,28,46,0.97) 100%);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5), inset 1px 1px 0 rgba(255,255,255,0.25);
    padding: 24px 26px;
    max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 19px; }
.modal label { display: block; font-size: 13px; color: #ccc; margin-bottom: 12px; }
.modal input, .modal select {
    display: block; width: 100%; margin-top: 4px;
    padding: 9px 12px; font-size: 14px; font-family: inherit;
    color: white; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px;
    outline: none; transition: border-color 0.2s ease;
}
.modal input:focus, .modal select:focus { border-color: rgba(79,172,254,0.7); box-shadow: 0 0 8px rgba(79,172,254,0.3); }
.modal select option { background: #16243a; color: #eee; }
.modal input[type="datetime-local"] { color-scheme: dark; }
.points-row { display: flex; gap: 12px; }
.points-row label { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.hint { font-size: 13px; color: #aaa; margin: 0 0 12px; }
.hidden { display: none !important; }

/* Customize tile list */
.tile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tile-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
    font-size: 14px;
}
.tile-list li .tile-move { margin-left: auto; display: flex; gap: 4px; }
.tile-list input[type="checkbox"] { width: auto; margin: 0; accent-color: #4facfe; }

/* ── Request portal ──────────────────────────────────────── */
.portal-wrap { display: flex; justify-content: center; padding: 50px 20px; }
.portal-card { width: 100%; max-width: 560px; }
.portal-card textarea {
    display: block; width: 100%; margin-top: 4px; resize: vertical;
    padding: 9px 12px; font-size: 14px; font-family: inherit;
    color: white; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; outline: none;
}
.portal-card textarea:focus { border-color: rgba(79,172,254,0.7); box-shadow: 0 0 8px rgba(79,172,254,0.3); }
.portal-card label { display: block; font-size: 13px; color: #ccc; margin-bottom: 12px; }
.portal-card input, .portal-card select {
    display: block; width: 100%; margin-top: 4px;
    padding: 9px 12px; font-size: 14px; font-family: inherit;
    color: white; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; outline: none;
}
.portal-card input:focus, .portal-card select:focus { border-color: rgba(79,172,254,0.7); box-shadow: 0 0 8px rgba(79,172,254,0.3); }
.portal-card select option { background: #16243a; color: #eee; }
.portal-card input[type="datetime-local"] { color-scheme: dark; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#hp-website { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.success-panel { text-align: center; padding: 20px 0; }
.success-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #7bffb0;
    background: rgba(120,255,170,0.12); border: 1px solid rgba(120,255,170,0.5);
    box-shadow: 0 0 20px rgba(120,255,170,0.3);
}

/* ── Request inbox tile ──────────────────────────────────── */
.inbox-count {
    font-size: 12px; font-weight: 700; color: #0f1c2e;
    background: #4facfe; border-radius: 12px; padding: 2px 9px;
    box-shadow: 0 0 10px rgba(79,172,254,0.6);
}
.request-item {
    padding: 12px 14px; margin-bottom: 10px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
}
.request-item.req-new { border-color: rgba(79,172,254,0.5); box-shadow: 0 0 12px rgba(79,172,254,0.15); }
.request-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.request-title { font-weight: 600; font-size: 14px; }
.request-meta { font-size: 12px; color: #aaa; margin-top: 4px; }
.request-details { font-size: 13px; color: #ccc; margin-top: 6px; white-space: pre-wrap; }
.request-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.request-actions select {
    padding: 5px 8px; font-size: 12px; font-family: inherit;
    color: white; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 6px;
}
.request-actions select option { background: #16243a; color: #eee; }
.badge-urgency-high { color: #ff8a8a; border-color: rgba(255,120,120,0.5); font-weight: 600; }
.badge-urgency-low { color: #9ad0ff; }
.badge-status-accepted { color: #7bffb0; border-color: rgba(120,255,170,0.4); }
.badge-status-done { color: #7bffb0; }
.badge-status-rejected { color: #ff8a8a; }
.cat-manage { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cat-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; padding: 4px 10px; border-radius: 14px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
}
.cat-chip button { padding: 0 4px; font-size: 11px; border: none; background: none; box-shadow: none; color: #ff8a8a; }
.cat-add-row { display: flex; gap: 8px; }
.cat-add-row input {
    flex: 1; padding: 7px 10px; font-size: 13px; font-family: inherit;
    color: white; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; outline: none;
}

/* ── Footer ──────────────────────────────────────────────── */
.contact-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 40px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-top: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
    font-size: 13px;
    margin-top: auto;
    width: 100%;
}
.contact-left a { color: white; text-decoration: none; transition: color 0.3s ease; }
.contact-left a:hover { color: #4facfe; }
.contact-right { color: #999; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .top-bar { flex-wrap: wrap; padding: 10px 15px; }
    .overall-progress { order: 3; flex-basis: 100%; max-width: none; }
    #dashboard { grid-template-columns: 1fr; padding: 15px; }
    #banners { margin: 12px 15px 0; }
    .topic-progress { min-width: 120px; }
    .task-tools { opacity: 1; }
    .contact-bar { flex-direction: column; gap: 8px; padding: 12px 20px; text-align: center; }
}

/* -- Light (daytime) theme --------------------------------- */
html.theme-light body { background: #d9dee5; color: #16222f; }
html.theme-light #bg-base { background: linear-gradient(180deg, #e2e6ec 0%, #b7c0cb 100%); }
html.theme-light .top-bar {
    background: linear-gradient(135deg, rgba(226,230,237,0.75) 0%, rgba(204,211,220,0.62) 100%);
    border-color: rgba(255,255,255,0.65);
    box-shadow: 0 8px 32px rgba(30,60,100,0.15), inset 1px 1px 0 rgba(255,255,255,0.7);
}
html.theme-light .site-title { text-shadow: none; }
html.theme-light .site-title strong { color: #1273d2; }
html.theme-light .overall-bar { background: rgba(20,50,90,0.12); border-color: rgba(20,50,90,0.2); }
html.theme-light .overall-fill { box-shadow: 0 0 8px rgba(18,115,210,0.5); }
html.theme-light button {
    background: rgba(226,230,237,0.68); color: #16222f;
    border-color: rgba(20,50,90,0.25); text-shadow: none;
    box-shadow: 0 1px 6px rgba(30,60,100,0.15);
}
html.theme-light button:hover { background: rgba(235,239,244,0.9); border-color: rgba(20,50,90,0.4); box-shadow: 0 2px 10px rgba(30,60,100,0.2); }
html.theme-light button.primary { background: rgba(18,115,210,0.14); border-color: rgba(18,115,210,0.5); color: #0d5cab; }
html.theme-light button.primary:hover { background: rgba(18,115,210,0.24); }
html.theme-light button.ghost { background: transparent; box-shadow: none; }
html.theme-light .notif-menu { background: rgba(234,238,243,0.97); border-color: rgba(20,50,90,0.15); box-shadow: 0 12px 40px rgba(30,60,100,0.3); }
html.theme-light .notif-head { color: rgba(20,40,60,0.5); border-bottom-color: rgba(20,50,90,0.1); }
html.theme-light .notif-item { border-bottom-color: rgba(20,50,90,0.08); }
html.theme-light .notif-item:hover { background: rgba(18,115,210,0.08); }
html.theme-light .notif-title { color: #16222f; }
html.theme-light .notif-sub { color: #5a6b7c; }
html.theme-light .notif-critical .notif-title { color: #c22525; }
html.theme-light .notif-urgent .notif-title { color: #b35600; }
html.theme-light .notif-warning .notif-title { color: #8a6d00; }
html.theme-light .notif-empty { color: #5a6b7c; }
html.theme-light .banner-notice  { background: rgba(217,234,250,0.96); border-color: rgba(18,115,210,0.45); color: #0d5cab; }
html.theme-light .banner-warning { background: rgba(252,240,198,0.96); border-color: rgba(180,140,0,0.5); color: #7a5c00; }
html.theme-light .banner-urgent  { background: rgba(253,226,200,0.96); border-color: rgba(200,100,20,0.6); color: #9c4a00; box-shadow: 0 0 14px rgba(255,140,50,0.3); }
html.theme-light .banner-critical { background: rgba(252,212,212,0.96); border-color: rgba(200,40,40,0.7); color: #b32020; box-shadow: 0 0 20px rgba(255,60,60,0.35); }
html.theme-light .tile {
    background: linear-gradient(135deg, rgba(224,229,236,0.58) 0%, rgba(198,206,216,0.68) 100%);
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(30,60,100,0.15), inset 1px 1px 0 rgba(255,255,255,0.65);
}
html.theme-light .tile h2 .muted { color: #5a6b7c; }
html.theme-light .empty-hint { color: #5a6b7c; }
html.theme-light .due-item { background: rgba(20,50,90,0.05); border-color: rgba(20,50,90,0.12); }
html.theme-light .due-overdue .due-when { color: #c22525; }
html.theme-light .due-today .due-when { color: #b35600; }
html.theme-light .due-soon .due-when { color: #8a6d00; }
html.theme-light .due-later .due-when { color: #0d5cab; }
html.theme-light .due-item .due-topic { color: #5a6b7c; }
html.theme-light .grade-row { border-bottom-color: rgba(20,50,90,0.1); }
html.theme-light .grade-badge { background: rgba(20,50,90,0.06); border-color: rgba(20,50,90,0.18); }
html.theme-light .grade-ok { color: #0d8a43; border-color: rgba(13,138,67,0.4); }
html.theme-light .grade-close { color: #8a6d00; border-color: rgba(180,150,0,0.4); }
html.theme-light .grade-behind { color: #c22525; border-color: rgba(194,37,37,0.4); }
html.theme-light .grade-meta { color: #5a6b7c; }
html.theme-light .topic-card { background: rgba(20,50,90,0.025); border-color: rgba(20,50,90,0.12); }
html.theme-light .topic-header:hover { background: rgba(18,115,210,0.06); }
html.theme-light .topic-caret { color: #0d5cab; }
html.theme-light .type-badge { background: rgba(20,50,90,0.05); border-color: rgba(20,50,90,0.25); }
html.theme-light .type-class    { color: #0d5cab; border-color: rgba(18,115,210,0.5); }
html.theme-light .type-personal { color: #0d8a43; border-color: rgba(13,138,67,0.4); }
html.theme-light .type-job      { color: #9c6200; border-color: rgba(200,140,40,0.5); }
html.theme-light .type-project  { color: #7b2fbf; border-color: rgba(150,80,220,0.45); }
html.theme-light .type-general  { color: #44525f; }
html.theme-light .topic-bar { background: rgba(20,50,90,0.12); }
html.theme-light .topic-grade-chip { background: rgba(20,50,90,0.06); border-color: rgba(20,50,90,0.2); }
html.theme-light .topic-count { color: #0d5cab; background: rgba(18,115,210,0.1); border-color: rgba(18,115,210,0.35); }
html.theme-light .topic-desc { color: #5a6b7c; }
html.theme-light .task-children { border-left-color: rgba(20,50,90,0.15); }
html.theme-light .task-row input[type="checkbox"] { border-color: rgba(20,50,90,0.4); background: rgba(255,255,255,0.7); }
html.theme-light .task-row input[type="checkbox"]:checked { background: rgba(18,115,210,0.85); border-color: #1273d2; }
html.theme-light .task-done > .task-row .task-title { color: #8a97a3; }
html.theme-light .task-badge { background: rgba(20,50,90,0.05); border-color: rgba(20,50,90,0.15); color: #44525f; }
html.theme-light .badge-due-overdue, html.theme-light .badge-prio-high { color: #c22525; border-color: rgba(194,37,37,0.5); }
html.theme-light .badge-due-today { color: #b35600; }
html.theme-light .badge-due-soon, html.theme-light .badge-prio-medium { color: #8a6d00; }
html.theme-light .badge-prio-low { color: #0d5cab; }
html.theme-light .badge-points { color: #0d8a43; }
html.theme-light .task-notes { color: #5a6b7c; }
html.theme-light .subtask-count { color: #0d5cab; }
html.theme-light .done-list { color: #44525f; }
html.theme-light .done-list .when { color: #8a97a3; }
html.theme-light .modal-overlay { background: rgba(40,60,90,0.35); }
html.theme-light .modal { background: #eef1f5; border-color: rgba(20,50,90,0.15); box-shadow: 0 16px 60px rgba(30,60,100,0.35); }
html.theme-light .modal label { color: #44525f; }
html.theme-light .modal input, html.theme-light .modal select { background: rgba(20,50,90,0.05); color: #16222f; border-color: rgba(20,50,90,0.25); }
html.theme-light .modal select option { background: #fff; color: #16222f; }
html.theme-light .modal input[type="datetime-local"] { color-scheme: light; }
html.theme-light .hint { color: #5a6b7c; }
html.theme-light .tile-list li { background: rgba(20,50,90,0.05); border-color: rgba(20,50,90,0.15); }
html.theme-light .portal-card input, html.theme-light .portal-card select, html.theme-light .portal-card textarea { background: rgba(20,50,90,0.05); color: #16222f; border-color: rgba(20,50,90,0.25); }
html.theme-light .portal-card select option { background: #fff; color: #16222f; }
html.theme-light .portal-card label { color: #44525f; }
html.theme-light .portal-card input[type="datetime-local"] { color-scheme: light; }
html.theme-light .request-item { background: rgba(20,50,90,0.04); border-color: rgba(20,50,90,0.12); }
html.theme-light .request-item.req-new { border-color: rgba(18,115,210,0.5); box-shadow: 0 0 12px rgba(18,115,210,0.12); }
html.theme-light .request-meta { color: #5a6b7c; }
html.theme-light .request-details { color: #44525f; }
html.theme-light .request-actions select { background: #fff; color: #16222f; border-color: rgba(20,50,90,0.25); }
html.theme-light .request-actions select option { background: #fff; color: #16222f; }
html.theme-light .badge-urgency-high { color: #c22525; border-color: rgba(194,37,37,0.5); }
html.theme-light .badge-urgency-low { color: #0d5cab; }
html.theme-light .badge-status-accepted, html.theme-light .badge-status-done { color: #0d8a43; }
html.theme-light .badge-status-rejected { color: #c22525; }
html.theme-light .cat-manage { border-top-color: rgba(20,50,90,0.12); }
html.theme-light .cat-chip { background: rgba(20,50,90,0.05); border-color: rgba(20,50,90,0.2); }
html.theme-light .cat-chip button { color: #c22525; }
html.theme-light .cat-add-row input { background: #fff; color: #16222f; border-color: rgba(20,50,90,0.25); }
html.theme-light .contact-bar {
    background: linear-gradient(135deg, rgba(224,229,236,0.68) 0%, rgba(202,210,219,0.55) 100%);
    border-top-color: rgba(20,50,90,0.12);
    box-shadow: 0 -4px 15px rgba(30,60,100,0.1);
}
html.theme-light .contact-left a { color: #16222f; }
html.theme-light .contact-left a:hover { color: #1273d2; }
html.theme-light .contact-right { color: #5a6b7c; }

/* -- Tile drag & drop -------------------------------------- */
.tile.dragging { opacity: 0.45; }
.tile h2 { cursor: grab; }

/* -- Toasts & inline confirms ------------------------------ */
#toast-wrap {
    position: fixed; top: 84px; right: 20px; z-index: 300;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
    pointer-events: none;
}
.toast {
    max-width: 340px; padding: 11px 16px; border-radius: 10px;
    font-size: 13.5px; color: #eee;
    background: rgba(23,40,62,0.96); border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
    opacity: 0; transform: translateX(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-warn  { background: rgba(84,58,16,0.96); border-color: rgba(255,200,60,0.55); color: #ffe9b0; }
.toast-error { background: rgba(94,22,22,0.96); border-color: rgba(255,60,60,0.7); color: #ffc4c4; }
.confirm-overlay {
    position: fixed; inset: 0; z-index: 290;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.confirm-box {
    max-width: 380px; width: 100%;
    background: linear-gradient(135deg, rgba(40,60,90,0.97) 0%, rgba(15,28,46,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 14px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    padding: 20px 22px;
}
.confirm-box p { margin: 0 0 16px; font-size: 14.5px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-yes { background: rgba(255,80,80,0.25); border-color: rgba(255,80,80,0.6); color: #ffc4c4; }
.confirm-yes:hover { background: rgba(255,80,80,0.4); border-color: rgba(255,80,80,0.8); }
html.theme-light .toast { background: rgba(240,243,247,0.98); border-color: rgba(20,50,90,0.25); color: #16222f; box-shadow: 0 8px 28px rgba(30,60,100,0.3); }
html.theme-light .toast-warn { background: rgba(252,240,198,0.98); border-color: rgba(180,140,0,0.5); color: #7a5c00; }
html.theme-light .toast-error { background: rgba(252,212,212,0.98); border-color: rgba(200,40,40,0.6); color: #b32020; }
html.theme-light .confirm-overlay { background: rgba(40,60,90,0.3); }
html.theme-light .confirm-box { background: #eef1f5; border-color: rgba(20,50,90,0.2); box-shadow: 0 16px 60px rgba(30,60,100,0.35); }
html.theme-light .confirm-yes { background: rgba(200,40,40,0.12); border-color: rgba(200,40,40,0.5); color: #b32020; }
html.theme-light .confirm-yes:hover { background: rgba(200,40,40,0.22); }

/* -- Inline SVG icons ------------------------------------- */
.ico { vertical-align: -3px; flex-shrink: 0; }
.tile h2 .ico { vertical-align: -2px; margin-right: 2px; color: #ff9a62; }
.banner-icon { display: inline-flex; align-items: center; }
.notif-icon { display: inline-flex; align-items: center; }
.notif-empty .ico { vertical-align: -4px; margin-right: 6px; color: #7bffb0; }
html.theme-light .notif-empty .ico { color: #1f9d55; }
html.theme-light .tile h2 .ico { color: #d9681e; }

/* -- Banner dismiss --------------------------------------- */
.banner-dismiss {
    margin-left: auto; flex-shrink: 0;
    width: 24px; height: 24px; padding: 0; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; color: inherit;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25);
    cursor: pointer; opacity: 0.75;
}
.banner-dismiss:hover { opacity: 1; background: rgba(255,255,255,0.2); }
html.theme-light .banner-dismiss { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.2); }
html.theme-light .banner-dismiss:hover { background: rgba(0,0,0,0.14); }

/* -- Topic reorder buttons -------------------------------- */
.topic-move { display: inline-flex; gap: 3px; margin-left: 6px; flex-shrink: 0; }
.move-btn {
    width: 22px; height: 22px; padding: 0; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    color: inherit; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2); cursor: pointer; opacity: 0.7;
}
.move-btn:hover:not(:disabled) { opacity: 1; background: rgba(255,255,255,0.18); }
.move-btn:disabled { opacity: 0.25; cursor: default; }
html.theme-light .move-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); }
html.theme-light .move-btn:hover:not(:disabled) { background: rgba(0,0,0,0.12); }

/* -- Task flags ------------------------------------------- */
.badge-flag { background: rgba(255,255,255,0.06); font-weight: 600; }
.flag-section { margin: 4px 0 10px; }
.flag-label { display: block; font-size: 12.5px; color: #bbb; margin-bottom: 6px; }
.flag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.flag-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px; border-radius: 999px; font-size: 12.5px;
    color: var(--flag-c); border: 1px solid var(--flag-c);
    background: rgba(255,255,255,0.04); cursor: pointer; user-select: none;
    opacity: 0.55; transition: opacity 0.15s ease, background 0.15s ease;
}
.flag-chip:hover { opacity: 0.85; }
.flag-chip.flag-on { opacity: 1; background: color-mix(in srgb, var(--flag-c) 18%, transparent); }
.flag-del {
    width: 15px; height: 15px; padding: 0; border: none; border-radius: 50%;
    background: transparent; color: inherit; font-size: 10px; line-height: 1;
    cursor: pointer; opacity: 0.6; display: flex; align-items: center; justify-content: center;
}
.flag-del:hover { opacity: 1; background: rgba(255,255,255,0.15); }
.flag-add { display: flex; gap: 6px; }
.flag-add input { flex: 1; min-width: 0; }
html.theme-light .flag-label { color: #5a6673; }
html.theme-light .flag-chip { background: rgba(0,0,0,0.03); }
html.theme-light .badge-flag { background: rgba(0,0,0,0.04); }
