:root {
    --bg: #f3f6f7;
    --surface: #ffffff;
    --text: #0b2027;
    --muted: #4a616a;
    --accent: #0a7a6f;
    --accent-2: #f4b400;
    --danger: #9f2d2d;
    --ok: #206d34;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(11, 32, 39, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #d9ece9 0%, var(--bg) 42%);
}

.wrap { width: min(1080px, 92vw); margin: 0 auto; }
.page { padding: 28px 0 48px; }

.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #d9e4e8;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    min-height: 72px;
}

.brand {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--text);
}

.nav { display: flex; gap: 14px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }

.auth-box { display: flex; gap: 10px; align-items: center; }
.user-name { font-size: 0.92rem; color: var(--muted); }
.inline-form { margin: 0; }

.hero h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.hero p { margin-top: 8px; color: var(--muted); }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.month-group {
    margin-top: 22px;
}

.month-heading {
    margin: 0;
    font-size: 1.2rem;
    text-transform: capitalize;
    color: var(--text);
}

.month-table-wrap {
    margin-top: 12px;
    border: 1px solid #dce6ea;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.month-table {
    width: 100%;
    border-collapse: collapse;
}

.month-table th,
.month-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e6eef1;
    text-align: left;
    vertical-align: top;
    font-size: 0.94rem;
}

.month-table th {
    background: #f6fafb;
    color: var(--muted);
    font-weight: 700;
}

.month-table tbody tr:last-child td {
    border-bottom: none;
}

.table-description {
    margin-top: 4px;
    max-width: 560px;
}

.table-action {
    width: 1%;
    white-space: nowrap;
}

.card, .slot-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #dce6ea;
    padding: 18px;
}

.slot-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 12px;
}

.btn {
    appearance: none;
    border: none;
    background: linear-gradient(135deg, var(--accent), #0f9a8d);
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: 10px 16px;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.ghost {
    background: #eef4f6;
    color: var(--text);
}

.btn.danger {
    background: linear-gradient(135deg, #b42121, #8e1111);
    color: #fff;
}

.delete-details {
    display: inline-block;
    position: relative;
}

.delete-details > summary {
    list-style: none;
    cursor: pointer;
}

.delete-details > summary::-webkit-details-marker { display: none; }

.delete-reason-form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    background: var(--surface);
    border: 1px solid #dce6ea;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    min-width: 280px;
    display: grid;
    gap: 10px;
}

.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.meta { color: var(--muted); font-size: 0.92rem; }
.meta.strong { font-weight: 700; color: var(--text); }
.topic-head .meta strong { color: var(--text); }

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pill-green { background: #dff6e8; color: #1f6a35; }
.pill-orange { background: #fff1d6; color: #8a5a00; }
.pill-red { background: #fde2e2; color: #8a2222; }
.pill-ongoing {
    margin-left: 8px;
    background: #d9f4ff;
    color: #0b5f86;
}

.flash {
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-weight: 600;
}
.flash.success { background: #e5f6e9; color: var(--ok); }
.flash.error { background: #fde9e9; color: var(--danger); }
.flash.info { background: #e9f0ff; color: #1f4a8a; }
.flash.warning { background: #fff3dc; color: #7b4f00; }

.notice-box {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.notice-warning {
    background: #fff8e1;
    border-left: 4px solid #f5a623;
    color: #5a3e00;
}

.grid-form {
    display: grid;
    gap: 12px;
}

label { display: grid; gap: 6px; font-weight: 600; }
input, textarea {
    border: 1px solid #c9d9df;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
}

.admin-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
}

.two-col {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.topic-row {
    border-top: 1px solid #e3ecef;
    padding-top: 12px;
    margin-top: 12px;
}

.back-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 880px) {
    .header-grid {
        grid-template-columns: 1fr;
        padding: 12px 0;
    }
    .admin-grid { grid-template-columns: 1fr; }
    .slot-card { flex-direction: column; }
    .month-table thead { display: none; }
    .month-table,
    .month-table tbody,
    .month-table tr,
    .month-table td {
        display: block;
        width: 100%;
    }
    .month-table tr {
        border-bottom: 1px solid #e6eef1;
    }
    .month-table tbody tr:last-child {
        border-bottom: none;
    }
    .month-table td {
        border-bottom: none;
        padding: 8px 12px;
    }
}
