:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent: #111827;
    --accent-soft: #eef2ff;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 18px;
    --shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: #0f172a;
    color: #fff;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #f97316, #ec4899, #6366f1);
    font-weight: 800;
}
.brand span { display: block; color: #cbd5e1; font-size: 12px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: #cbd5e1;
    font-weight: 600;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.main { flex: 1; padding: 28px; min-width: 0; }
.page-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    margin-bottom: 18px;
}
.page-head h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.1; }
.page-head p { margin: 0; color: var(--muted); }
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row.full { grid-column: 1 / -1; }
label { font-size: 13px; color: #374151; font-weight: 700; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 11px 15px;
    font-weight: 800;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
}
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.success { background: var(--success); color: #fff; }
.btn.small { padding: 8px 10px; border-radius: 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f9fafb; }
td { font-size: 14px; }
.muted { color: var(--muted); }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-cyan { background: #cffafe; color: #0e7490; }
.badge-dark { background: #111827; color: #fff; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-muted { background: #e5e7eb; color: #6b7280; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.content-title { font-weight: 800; }
.subline { margin-top: 5px; color: var(--muted); font-size: 12px; }
.slide-box { border: 1px dashed #cbd5e1; background: #f8fafc; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.slide-head { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:10px; font-weight:800; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-name { font-size: 12px; font-weight: 800; color: var(--muted); text-align:center; }
.day-cell {
    min-height: 130px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    overflow: hidden;
}
.day-cell.other { opacity: .45; }
.day-num { font-weight: 900; margin-bottom: 8px; }
.calendar-item {
    display: block;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 12px;
}
.calendar-item strong { display: block; margin-bottom: 2px; }
.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.notice { padding: 12px 14px; border-radius: 14px; background: #ecfeff; color: #155e75; margin-bottom: 14px; font-weight: 700; }
@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: auto; height: auto; border-radius: 0 0 24px 24px; }
    .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main { padding: 18px; }
    .page-head { display: block; }
    .page-head .btn-row { margin-top: 14px; }
    .grid-2, .grid-3, .grid-4, .form-grid, .filters { grid-template-columns: 1fr; }
    .calendar-grid { grid-template-columns: 1fr; }
    .day-name { display: none; }
    .day-cell { min-height: auto; }
    table { min-width: 760px; }
}

.user-panel {
    margin-top: 24px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    color: #fff;
}
.user-panel-name { font-weight: 900; }
.user-panel-login { color: #cbd5e1; font-size: 12px; margin-top: 3px; }
.user-panel-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.user-panel-actions a {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(255,255,255,.10);
}
.user-panel-actions a:hover { background: rgba(255,255,255,.18); }
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(236,72,153,.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(99,102,241,.18), transparent 34%),
        var(--bg);
}
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}
.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 26px;
}
.auth-brand { margin-bottom: 18px; }
.auth-card h1 { margin: 0 0 8px; font-size: 30px; }
.auth-form { grid-template-columns: 1fr; margin-top: 20px; }
.auth-hint {
    margin-top: 16px;
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.notice-error { background: #fef2f2; color: #991b1b; }
.notice-success { background: #f0fdf4; color: #166534; }
