:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    --bg: #eef3ff;
    --surface: #ffffff;
    --surface-soft: #f5f6ff;
    --border: rgba(96, 108, 255, 0.16);
    --text: #24335b;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-soft: #eef2ff;
    --accent: #34d399;
    --accent-soft: #ecfdf5;
    --warning: #fbbf24;
    --danger: #fb7185;
    --radius: 24px;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.12) 0%, transparent 30%),
        radial-gradient(circle at bottom right, rgba(52, 211, 153, 0.14) 0%, transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eff5ff 100%);
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input,
select,
textarea {
    border-radius: 16px;
}

button,
input[type=submit],
input[type=button] {
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    padding: 14px 20px;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.18);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
button:focus,
input[type=submit]:hover,
input[type=button]:hover,
input[type=submit]:focus,
input[type=button]:focus {
    transform: translateY(-1px);
    background: #4338ca;
}

button.secondary {
    background: #fff;
    color: var(--text);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

button.outline,
.input-secondary,
select.input-secondary,
textarea.input-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    max-width: 1440px;
    margin: 32px auto;
    padding: 0 18px 32px;
}

@media (min-width: 1280px) {
    .layout {
        gap: 32px;
    }
}

.sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 28px;
    align-self: flex-start;
    width: 100%;
    max-width: 320px;
    min-width: 0;
    height: calc(100vh - 56px);
    padding: 26px 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(99, 102, 241, 0.14);
    border-radius: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.sidebar-inner {
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-inner::-webkit-scrollbar {
    width: 8px;
}

.sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.22);
    border-radius: 999px;
}

.sidebar-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.32);
}

.sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
}

.sidebar-close {
    display: none;
}

.mobile-menu-btn {
    display: none;
}

.sidebar .sidebar-brand {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.sidebar .brand-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
    border-radius: 20px;
}

.sidebar h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.sidebar-note {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #5661d8;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.sidebar li {
    border-radius: 18px;
    overflow: hidden;
}

.sidebar a {
    display: block;
    width: 100%;
    padding: 15px 18px;
    color: var(--text);
    background: linear-gradient(135deg, #f8fbff 0%, #f5f7ff 100%);
    border-radius: 20px;
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar a:hover,
.sidebar a:focus {
    background: #e6efff;
    transform: translateX(2px);
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(99, 102, 241, 0.16));
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.16);
}

.count-badge {
    display: inline-flex;
    min-width: 24px;
    padding: 0 8px;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    margin-left: 8px;
}

.content {
    display: grid;
    gap: 24px;
    min-width: 0;
    flex: 1 1 0;
    padding: 20px 0;
}

.content h1 {
    margin-top: 0;
    font-size: clamp(2rem, 2.2vw, 2.8rem);
    letter-spacing: -0.03em;
}

.content p {
    line-height: 1.75;
    color: var(--muted);
    max-width: 760px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: var(--text);
    font-size: 1.2rem;
}

.login-box {
    max-width: 420px;
    margin: 70px auto;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: var(--primary);
}

.login-box form {
    display: grid;
    gap: 16px;
}

.login-box p {
    margin: 16px 0 0;
    color: var(--muted);
}

.login-box a {
    color: var(--primary);
    font-weight: 700;
}

.form-group {
    display: grid;
    gap: 8px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text);
}

.info-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.card-grid {
    display: grid;
    gap: 18px;
}

.table-grid {
    display: grid;
    gap: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 880px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-card {
    background: linear-gradient(145deg, #eef2ff 0%, #f8fbff 100%);
    border-radius: 22px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 30%);
    pointer-events: none;
}

.dashboard-card strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
}

.dashboard-card p {
    margin: 0;
    font-size: 2.1rem;
    color: var(--primary);
}

.status-badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.status-pending { background: #ffedd5; color: #c2410c; }
.status-active { background: #dbeafe; color: #1e40af; }
.status-completed { background: #dcfce7; color: #166534; }

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    background: #f8fbff;
    border: 1px solid rgba(99, 102, 241, 0.14);
    color: var(--text);
    border-radius: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95rem;
}

thead tr {
    background: #eef2ff;
}

thead th,
tbody td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

thead th {
    color: var(--text);
    font-weight: 700;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

tbody tr:nth-child(odd) {
    background: rgba(243, 244, 255, 0.6);
}

tbody td:last-child,
thead th:last-child {
    text-align: center;
}

.table-compact th,
.table-compact td {
    padding: 12px 14px;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95rem;
}

.table-custom th,
.table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.table-custom th {
    background: #eef2ff;
    color: var(--text);
    font-weight: 700;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.table-custom tbody tr:nth-child(odd) {
    background: rgba(243, 244, 255, 0.6);
}

.table-custom td:last-child,
.table-custom th:last-child {
    text-align: center;
}

.calendar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.calendar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    background: #eef2ff;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.calendar-nav a:hover {
    background: #e0e7ff;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid th,
.calendar-grid td {
    border: 1px solid rgba(99, 102, 241, 0.16);
    padding: 14px;
    vertical-align: top;
    min-height: 100px;
}

.calendar-grid th {
    background: #f8fbff;
    color: var(--text);
    font-weight: 700;
}

.calendar-event {
    margin-bottom: 0.6rem;
    padding: 10px 12px;
    background: rgba(79, 70, 229, 0.08);
    border-radius: 14px;
    color: #1f2937;
}

.calendar-day-number {
    display: block;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.table-action button {
    min-width: 120px;
}

.read-row {
    background: #ffffff;
}

.new-row {
    background: rgba(253, 242, 242, 0.85);
}

.alert,
.error {
    display: block;
    padding: 14px 18px;
    margin: 0 0 18px;
    border-radius: 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

ul,
ol {
    padding-left: 20px;
    color: var(--muted);
}

@media (max-width: 1120px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto auto 0;
        width: 280px;
        max-width: 92vw;
        height: 100vh;
        z-index: 40;
        transform: translateX(-110%);
        opacity: 0;
        overflow-y: auto;
        top: 0;
        left: 0;
        margin: 0;
        border-radius: 0 0 0 30px;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        z-index: 35;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        opacity: 1;
    }

    .sidebar .sidebar-brand {
        justify-content: space-between;
        gap: 12px;
    }

    .sidebar-close {
        display: inline-flex;
        position: absolute;
        top: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
        border: none;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 16px;
        color: var(--primary);
        font-size: 1.1rem;
        cursor: pointer;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
        align-items: center;
        justify-content: center;
    }

    .sidebar-close:hover {
        background: #fff;
    }

    .content {
        padding-top: 76px;
    }

    .mobile-menu-btn {
        position: fixed;
        top: 18px;
        left: 18px;
        width: 52px;
        height: 52px;
        border-radius: 18px;
        background: var(--surface);
        border: 1px solid rgba(99, 102, 241, 0.14);
        display: grid;
        place-items: center;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
        z-index: 45;
    }

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
    }

    .top-status {
        display: none;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .mobile-menu-btn {
        display: grid;
    }
}

@media (max-width: 760px) {
    .layout {
        margin: 12px auto;
        gap: 16px;
        padding: 0 14px 28px;
    }

    .sidebar,
    .card {
        padding: 20px;
    }

    .dashboard-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .sidebar a {
        padding: 14px 16px;
    }

    .content {
        gap: 18px;
    }
}

@media (max-width: 520px) {
    body {
        background: #f7f9ff;
    }

    .sidebar {
        padding: 18px;
        border-radius: 24px;
    }

    .card {
        padding: 18px;
    }

    button {
        width: 100%;
        padding: 16px;
    }

    .mobile-menu-btn {
        left: 14px;
        top: 14px;
    }
}

@media (max-width: 520px) {
    body {
        background: #f7f9ff;
    }

    .sidebar {
        padding: 18px;
        border-radius: 24px;
    }

    .card {
        padding: 18px;
    }

    button {
        width: 100%;
        padding: 16px;
    }
}

.alert,
.error {
    display: block;
    padding: 14px 18px;
    margin: 0 0 18px;
    border-radius: 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.page-intro {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.page-intro h1 {
    margin: 0;
    font-size: clamp(2.1rem, 2.4vw, 3rem);
}

.page-intro p {
    margin: 0;
    color: var(--muted);
    max-width: 700px;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.card-list {
    display: grid;
    gap: 16px;
}

.card-list .card {
    padding: 20px;
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(99, 102, 241, 0.1));
    color: var(--primary);
}

.progress-pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e40af;
    font-size: 0.95rem;
    font-weight: 700;
}

.progress-pill span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #4f46e5;
}

.main-overview {
    display: grid;
    gap: 18px;
}

.main-overview .hero-card {
    padding: 28px;
    border-radius: 32px;
    background: linear-gradient(135deg, #eef2ff 0%, #f4f3ff 100%);
    border: 1px solid rgba(79, 70, 229, 0.16);
}

.main-overview .hero-card h2 {
    margin-top: 0;
    font-size: 1.8rem;
    color: var(--text);
}

.main-overview .hero-card p {
    color: #475569;
}

.form-group {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
