@import url('https://fonts.googleapis.com/css2?family=MonteCarlo&display=swap');

:root {
    --bg: #f3f7fb;
    --panel: #ffffff;
    --ink: #102033;
    --muted: #62748a;
    --line: #d9e3ee;
    --primary: #0b57d0;
    --primary-dark: #083b8a;
    --secondary: #eef4fb;
    --danger: #b42318;
    --success: #0f8a5f;
    --shadow: 0 18px 40px rgba(16, 32, 51, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(11, 87, 208, 0.08), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4f9 100%);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin-top: 0; }
input, select, textarea, button {
    font: inherit;
}
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
textarea { resize: vertical; }
label span {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0c2442, #143760);
    color: #fff;
    padding: 20px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform: translateX(0);
}
.sidebar-toggle {
    position: absolute;
    top: 18px;
    right: -18px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.22);
    background: #0c2442;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(16, 32, 51, 0.24);
}
.sidebar-toggle-icon {
    font-size: 16px;
    line-height: 1;
}
.brand {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: flex-start;
}
.brand-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.96);
    padding: 4px;
    flex-shrink: 0;
}
.brand h1 {
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.15;
}
.brand p {
    color: rgba(255,255,255,0.75);
    margin: 0;
    font-size: 13px;
}
.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nav a {
    color: rgba(255,255,255,0.9);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.25;
}
.nav a:hover {
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.content {
    flex: 1;
    padding: 28px;
    transition: padding 0.25s ease;
}
.content-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}
.content-auth {
    display: grid;
    place-items: center;
}
.login-panel {
    width: 100%;
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
}
.login-card {
    width: min(460px, 100%);
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(217,227,238,0.8);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}
.login-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    margin: 0 auto 18px;
}
.page-head, .row-between, .actions, .actions-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dashboard-hero {
    flex: 1;
    text-align: center;
    margin-top: -8px;
}
.dashboard-hero h2 {
    font-size: 42px;
    margin-bottom: 10px;
}
.dashboard-hero p {
    font-size: 21px;
    color: var(--muted);
    margin-bottom: 0;
}
.actions-inline { justify-content: flex-start; }
.cards-grid, .grid-two, .form-grid, .task-grid {
    display: grid;
    gap: 18px;
}
.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 20px;
}
.grid-two {
    grid-template-columns: 2fr 1fr;
}
.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.span-2 {
    grid-column: span 2;
}
.panel, .stat-card, .task-card, .member-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 34px;
}
.stack, .stack-lg, .plain-list, .member-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.stack-lg { gap: 20px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.btn-secondary {
    background: var(--secondary);
    color: var(--ink);
}
.btn-danger {
    background: #fee4e2;
    color: var(--danger);
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.table th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-slate { background: #e2e8f0; color: #334155; }
.muted { color: var(--muted); }
.flash {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.comment span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 8px;
}
.notes-box {
    white-space: pre-wrap;
}
.text-button {
    border: 0;
    background: transparent;
    color: var(--danger);
    padding: 0;
    cursor: pointer;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-row input {
    width: auto;
}
.checkbox-row span {
    margin: 0;
}
.task-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.task-number {
    margin: 0;
    font-size: 18px;
}
.signature-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.signature-preview {
    min-height: 64px;
    display: flex;
    align-items: flex-end;
    padding: 12px 0 4px;
    font-family: "MonteCarlo", cursive;
    font-size: 36px;
    color: #111111;
    border-bottom: 2px solid var(--line);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}
.calendar-head, .calendar-cell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    min-height: 84px;
}
.calendar-head {
    min-height: auto;
    font-weight: 700;
    text-align: center;
}
.calendar-cell.empty {
    background: transparent;
    border-style: dashed;
}
.calendar-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #16a34a;
    border-radius: 999px;
    margin: 8px 0;
}
.calendar-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}
.active-link {
    font-weight: 700;
}
body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-100% + 46px));
    overflow: visible;
}
body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .nav a {
    opacity: 0;
    pointer-events: none;
}
body.sidebar-collapsed .brand {
    justify-content: center;
}
body.sidebar-collapsed .sidebar-toggle {
    right: 4px;
}
@media (max-width: 980px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        overflow-y: visible;
    }
    .sidebar-toggle {
        display: none;
    }
    .grid-two {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .content { padding: 18px; }
    .task-grid, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .page-head, .row-between, .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .dashboard-hero {
        text-align: left;
    }
    .dashboard-hero h2 {
        font-size: 32px;
    }
    .dashboard-hero p {
        font-size: 17px;
    }
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
