@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-soft: rgba(37, 99, 235, 0.08);
    --color-accent: #f97316;
    --color-accent-soft: rgba(249, 115, 22, 0.12);
    --color-bg: #eef1f7;
    --color-bg-muted: #f5f7fb;
    --color-surface: #ffffff;
    --color-surface-alt: #f8faff;
    --color-text: #1f2937;
    --color-muted: #64748b;
    --color-border: rgba(226, 232, 240, 0.9);

    --spacing-xxs: 0.25rem;
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.25rem;
    --spacing-2xl: 3rem;

    --radius-sm: 0.5rem;
    --radius-md: 0.85rem;
    --radius-lg: 1.25rem;
    --radius-full: 999px;

    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 18px 36px rgba(15, 23, 42, 0.14);
    --shadow-soft: 0 18px 36px rgba(15, 23, 42, 0.1);

    --sidebar-width-desktop: 272px;
    --sidebar-width-tablet: 240px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-base);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    animation: fade-page 0.2s ease-in;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0f172a, var(--color-primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.brand-info strong {
    display: block;
    font-size: 1.02em;
    letter-spacing: 0.3px;
}

.brand-info span {
    font-size: 0.88em;
    opacity: 0.85;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 900;
}

.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

.sidebar.sidebar--open {
    transform: translateX(0);
}

.sidebar-open .nav-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.sidebar-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.sidebar-open .nav-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.main {
    display: flex;
    flex: 1;
    gap: clamp(20px, 2vw, 36px);
}

.sidebar {
    width: 240px;
    background: var(--color-surface);
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    padding: 28px 0;
}

.sidebar-title {
    margin: 0 0 10px;
    padding: 0 20px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
}

.menu--simple {
    list-style: none;
    margin: 0;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu--simple .menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 6px 8px;
}

.menu--simple .menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.menu--simple .menu-link .sidebar-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.menu--simple .menu-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-primary-dark);
    transform: translateX(2px);
}

.menu--simple .menu-link.active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--color-primary-dark);
    border-color: rgba(37, 99, 235, 0.35);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu a {
    --sidebar-link-color: #475569;
    --sidebar-link-hover-bg: rgba(37, 99, 235, 0.12);
    --sidebar-link-hover-color: var(--color-primary-dark);
    --sidebar-link-active-bg: var(--color-primary-soft);
    --sidebar-link-active-color: var(--color-primary-dark);
    --sidebar-link-active-border: var(--color-primary);

    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    color: var(--sidebar-link-color);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border-left: 4px solid transparent;
    border-radius: 1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.menu a i {
    width: 18px;
    text-align: center;
}

.menu a:hover {
    background: var(--sidebar-link-hover-bg);
    color: var(--sidebar-link-hover-color);
}

.menu a.active {
    background: var(--sidebar-link-active-bg);
    color: var(--sidebar-link-active-color);
    border-left-color: var(--sidebar-link-active-border);
    font-weight: 600;
}

.menu-link {
    position: relative;
}

.menu-link__icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: currentColor;
    transition: transform 0.2s ease;
}

.menu a:hover .menu-link__icon,
.menu a:focus-visible .menu-link__icon {
    transform: translateX(2px);
}

.menu-link__label {
    flex: 1;
    line-height: 1.4;
}

.menu-link__indicator {
    position: absolute;
    inset: 10px -4px 10px auto;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.sidebar--admin {
    padding: 0;
    border-right: none;
    background: linear-gradient(180deg, #0f172a 0%, #132347 40%, #1e293b 100%);
    color: rgba(226, 232, 240, 0.9);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.25);
}

.sidebar--admin::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.35), transparent 55%);
    pointer-events: none;
}

.sidebar--admin .sidebar-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100%;
    padding: 36px 24px 28px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px;
}

.sidebar--admin .sidebar-brand {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
}

.sidebar-brand__title {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 700;
    color: #e2e8f0;
}

.sidebar-brand__subtitle {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: rgba(203, 213, 225, 0.8);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section__title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.65);
}

.sidebar--admin .menu {
    gap: 8px;
}

.sidebar--admin .menu a {
    --sidebar-link-color: rgba(226, 232, 255, 0.9);
    --sidebar-link-hover-bg: rgba(59, 130, 246, 0.18);
    --sidebar-link-hover-color: #ffffff;
    --sidebar-link-active-bg: rgba(59, 130, 246, 0.22);
    --sidebar-link-active-color: #ffffff;
    --sidebar-link-active-border: rgba(59, 130, 246, 0.6);

    border-left-width: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    line-height: 1.35;
    border: 1px solid transparent;
    backdrop-filter: blur(2px);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar--admin .menu a:hover {
    transform: translateX(6px);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.sidebar--admin .menu a.active {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
}

.menu-link__label {
    flex: 1;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.015em;
}

.sidebar--admin .menu-link__icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar--admin .menu a:hover .menu-link__icon,
.sidebar--admin .menu a.active .menu-link__icon {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    transform: translateX(0);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
}

.sidebar-meta {
    font-size: 0.75rem;
    color: rgba(203, 213, 225, 0.7);
    margin: 0;
}

.content {
    flex: 1;
    padding: 24px clamp(18px, 4vw, 36px);
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-content {
    gap: 40px;
}

.hero {
    background: var(--color-surface);
    border-radius: 22px;
    padding: 32px 36px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 70%);
    top: -110px;
    right: -90px;
}

.hero h1 {
    margin: 0;
    font-size: 2.1em;
    font-weight: 700;
    color: #0f172a;
    position: relative;
    z-index: 1;
}

.hero p {
    margin: 12px 0 0;
    color: #596273;
    line-height: 1.6;
    max-width: 680px;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    margin-top: 8px;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hero-meta {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Compact filter forms */
.filter-form.compact {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-form.compact input[type="search"] {
    min-width: 240px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}
.filter-form.compact .btn {
    padding: 10px 16px;
    border-radius: 12px;
}

.bulk-box {
    margin-top: 20px;
    padding: 16px;
    border: 1px dashed var(--color-border);
    border-radius: 16px;
    background: var(--color-surface-alt);
}

.hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-main .greeting {
    font-size: 0.92em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0;
}

.meta-pill {
    background: #eef5ff;
    padding: 8px 16px;
    border-radius: 999px;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.9em;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.38);
}

.btn-secondary {
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background: rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.08em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #0f172a;
}

.section-heading p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.92em;
    max-width: 520px;
}

.section-header {
    border-bottom: 1px solid #eef1f6;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.data-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
    border: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    bottom: -70px;
    right: -60px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 70%);
}

.stat-card .icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    position: relative;
    z-index: 1;
}

.stat-card .value {
    font-size: 2.2em;
    font-weight: 700;
    color: #0f172a;
    position: relative;
    z-index: 1;
}

.stat-card .label {
    font-size: 0.92em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
}

.summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 20px;
    background: var(--color-surface);
    border: 1px solid rgba(226, 232, 240, 0.75);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    top: -90px;
    right: -90px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 70%);
}

.summary-card .text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.summary-card .value {
    font-size: 2em;
    font-weight: 700;
    color: #0f172a;
}

.summary-card .label {
    font-size: 0.95em;
    color: var(--color-muted);
}

.summary-card i {
    font-size: 2.4em;
    color: var(--color-primary);
    position: relative;
    z-index: 1;
}

.summary-card.hadir {
    border-color: rgba(16, 185, 129, 0.4);
}

.summary-card.hadir i {
    color: #059669;
}

.summary-card.sakit {
    border-color: rgba(59, 130, 246, 0.3);
}

.summary-card.sakit i {
    color: #2563eb;
}

.summary-card.izin {
    border-color: rgba(251, 191, 36, 0.35);
}

.summary-card.izin i {
    color: #b45309;
}

.summary-card.alpa {
    border-color: rgba(239, 68, 68, 0.35);
}

.summary-card.alpa i {
    color: #b91c1c;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
}

.overview-card {
    background: var(--color-surface);
    border-radius: 18px;
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.overview-card span {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
    font-weight: 600;
}

.overview-card strong {
    font-size: 2.1rem;
    color: #0f172a;
    font-weight: 700;
}

.overview-card small {
    color: var(--color-muted);
    font-size: 0.9em;
}

.calendar-card {
    background: var(--color-surface);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.85);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calendar-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.6em;
    color: #0f172a;
}

.calendar-header p {
    margin: 0;
    font-size: 0.96em;
    color: var(--color-muted);
    max-width: 520px;
    line-height: 1.6;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: 0;
}

.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-md);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.chart-card h3 {
    margin: 0 0 8px;
}

.chart-card canvas {
    display: block;
    margin-bottom: 0;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.panel-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--color-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-header .filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: flex-start;
}

.calendar-header .filter-form select,
.calendar-header .filter-form button {
    flex: 1 1 180px;
    max-width: 220px;
}

.filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(241, 245, 255, 0.96), rgba(229, 234, 255, 0.92));
    border: 1px solid rgba(195, 207, 255, 0.65);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.filter-container input[type="search"],
.filter-container select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #ffffff;
    font-size: 0.95em;
    color: #1e293b;
    padding: 12px 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-container input[type="search"]::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.filter-container input[type="search"]:focus,
.filter-container select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.filter-container button {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 0.96em;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.filter-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(37, 99, 235, 0.38);
}

.filter-container button:active {
    transform: translateY(0);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.filter-container button i {
    font-size: 0.9em;
}

.message {
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.message ul {
    margin: 8px 0 0;
    padding-left: 20px;
    font-weight: 500;
    letter-spacing: 0;
    color: inherit;
}

.message ul li {
    margin: 4px 0;
    font-size: 0.92em;
    font-weight: 500;
}

.message.success {
    background: rgba(25, 135, 84, 0.12);
    color: #166534;
    border: 1px solid rgba(25, 135, 84, 0.25);
}

.message.error {
    background: rgba(220, 53, 69, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(220, 53, 69, 0.28);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.action-btn i {
    font-size: 0.9em;
}

.action-btn:hover,
.action-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
    outline: none;
}

.action-btn--delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.action-btn--delete:hover,
.action-btn--delete:focus-visible {
    box-shadow: 0 16px 32px rgba(239, 68, 68, 0.28);
}

.card {
    background: var(--color-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
    overflow: hidden;
    scroll-margin-top: 160px;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    align-items: stretch;
}

.panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 22px 26px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.panel-meta {
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(148, 163, 184, 0.85);
}

.text-muted {
    color: rgba(148, 163, 184, 0.85);
    font-style: italic;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
}

.panel-body--flush {
    padding: 0;
}

.panel-grid table thead th {
    padding: 12px 18px;
}

.panel-grid table tbody td {
    padding: 12px 18px;
}

.panel-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s, box-shadow 0.2s;
}

.panel-action i { font-size: 0.9em; }

.panel-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.32);
}

.card-header {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.18em;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header .card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.anchor-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.card-body {
    padding: 24px 28px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-subtitle {
    margin: 0;
    font-size: 0.92em;
    color: var(--color-muted);
    line-height: 1.6;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    background: #f8fbff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    font-size: 0.95em;
}

table caption {
    padding: 18px 22px 12px;
    text-align: left;
    font-size: 0.9em;
    color: var(--color-muted);
    letter-spacing: 0.02em;
}

thead th {
    padding: 16px 20px;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

tbody tr {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.55);
}

tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.9);
}

tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

.presensi-grid {
    min-width: 720px;
}

.presensi-grid th,
.presensi-grid td {
    text-align: center;
}

.presensi-grid td:first-child {
    text-align: left;
    font-weight: 600;
    color: #0f172a;
}

.status-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(248, 250, 252, 0.8);
    color: #0f172a;
    white-space: normal;
    line-height: 1.4;
}

.status-chip strong {
    font-size: 0.95em;
}

.status-chip__meta {
    font-size: 0.88em;
    font-weight: 600;
    color: inherit;
    opacity: 0.85;
}

.status-chip.status-hadir {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #0f766e;
}

.status-chip.status-sakit {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.4);
    color: #1d4ed8;
}

.status-chip.status-izin {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(217, 119, 6, 0.35);
    color: #b45309;
}

.status-chip.status-alpa {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}

.status-chip.status-empty {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    border-style: dashed;
}

.desktop-view {
    display: block;
}

.mobile-view {
    display: none;
}

.rekap-card,
.day-card {
    background: var(--color-surface);
    border-radius: 18px;
    padding: 20px 22px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.rekap-card h3 {
    margin: 0 0 8px;
    font-size: 1.1em;
    color: #0f172a;
}

.rekap-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95em;
    line-height: 1.6;
}

.day-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-card-header {
    font-weight: 600;
    color: #0f172a;
    font-size: 1em;
}

.presensi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.presensi-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    font-size: 0.95em;
    color: #1f2937;
}

.status-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    line-height: 1.35;
}

.status-tag strong {
    font-size: 0.95em;
}

.status-tag__meta {
    font-size: 0.82em;
    font-weight: 600;
    opacity: 0.85;
    color: inherit;
}

.status-tag.status-hadir {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #047857;
}

.status-tag.status-sakit {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.32);
    color: #1d4ed8;
}

.status-tag.status-izin {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(217, 119, 6, 0.32);
    color: #b45309;
}

.status-tag.status-alpa {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.32);
    color: #b91c1c;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 12px 0 18px;
    font-size: 0.92rem;
    color: #475569;
}

.status-legend__title {
    font-weight: 700;
    color: #1f2937;
}

.status-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.8);
    font-weight: 600;
}

.status-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
}

.status-legend__item.status-hadir { color: #0f766e; }
.status-legend__item.status-sakit { color: #1d4ed8; }
.status-legend__item.status-izin { color: #b45309; }
.status-legend__item.status-alpa { color: #b91c1c; }

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}

.class-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: 20px;
    background: var(--color-surface);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.09);
    color: #0f172a;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.class-card i {
    font-size: 1.8em;
    color: var(--color-primary);
}

.class-card strong {
    font-size: 1.1em;
}

.class-card span {
    color: var(--color-muted);
    font-size: 0.9em;
}

.class-card .btn {
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.class-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.16);
}

.class-card:hover .btn {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.32);
}

.input-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.input-step {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: #fff;
    align-items: center;
}

.input-step__index {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-text);
}

.input-step__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.input-step__title {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--color-text);
}

.input-step__title i {
    color: var(--color-primary);
}

.input-step.is-active {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
}

.input-step.is-active .input-step__index {
    border-color: rgba(37, 99, 235, 0.5);
    color: var(--color-primary);
}

.input-step.is-complete {
    opacity: 0.9;
    border-style: dashed;
}

.input-presensi-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.meta-card {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
}

.meta-card__label {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin: 0;
}

.meta-card strong {
    font-size: 1.3rem;
}

.meta-card span {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.meta-card--hint {
    background: #f9fafb;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.status-legend__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-select--compact {
    min-width: 160px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    font-size: 0.96rem;
}

.form-card {
    background: var(--color-surface);
    border-radius: 22px;
    padding: 26px 28px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.student-list {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

.student-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    background: rgba(248, 250, 252, 0.6);
}

.student-row:nth-child(odd) {
    background: rgba(248, 250, 252, 0.9);
}

.student-row:last-child {
    border-bottom: none;
}

.student-name {
    font-weight: 600;
    color: #0f172a;
    flex: 1 1 200px;
}

.status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-pill {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.status-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-pill span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #f8fafc;
    padding: 6px 14px;
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.status-pill span:hover {
    border-color: rgba(37, 99, 235, 0.45);
}

.status-pill input:checked + span {
    border-color: rgba(37, 99, 235, 0.55);
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.status-pill input:focus-visible + span {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.assignment-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.85);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.assignment-card h3 {
    margin: 0;
    font-size: 1.05em;
    color: #0f172a;
}

.assignment-card span {
    font-size: 0.9em;
    color: var(--color-muted);
}

.assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assignment-actions .btn-primary,
.assignment-actions .btn-secondary,
.assignment-actions .btn-ghost {
    font-size: 0.85em;
    padding: 8px 14px;
}

.auth-body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--color-text);
}

.login-shell {
    width: min(1020px, 100%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 26px;
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    overflow: hidden;
}

.login-hero {
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    padding: clamp(28px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.login-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 65%);
    bottom: -120px;
    right: -120px;
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hero-header img {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.35);
    padding: 10px;
    object-fit: contain;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.38);
}

.hero-body,
.hero-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-footer {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-footer .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.25);
    font-size: 0.85em;
    font-weight: 600;
}

.login-form {
    background: rgba(255, 255, 255, 0.96);
    padding: clamp(26px, 4vw, 42px);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-title h2 {
    margin: 0;
    font-size: 1.8em;
    color: #0f172a;
}

.login-title p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-size: 0.95em;
    font-weight: 600;
    color: #334155;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    color: #1e293b;
}

.input-field:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    background: #fff;
}

.input-warning {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(248, 113, 113, 0.08);
}

.input-warning:focus {
    border-color: rgba(248, 113, 113, 0.85);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.22);
    background: #fff;
}

.form-field__hint--alert {
    color: #ef4444;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
}

.error-message {
    border-radius: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.32);
    font-weight: 600;
}

.footer-note {
    font-size: 0.85em;
    color: #64748b;
    text-align: center;
}

.login-shell .btn-submit {
    width: 100%;
}

.page-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.78));
    z-index: 9999;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-card {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #f8fafc;
    text-align: center;
    padding: 24px;
}

.loader-card p {
    margin: 0;
    font-size: 0.92em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.loader-spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid rgba(248, 250, 252, 0.35);
    border-top-color: #bfdbfe;
    animation: loader-spin 0.9s linear infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-spinner {
        animation: none;
    }
    .page-loader {
        transition: none;
    }
}

.simple-body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.simple-card {
    width: min(720px, 100%);
    background: var(--color-surface);
    border-radius: 22px;
    padding: 32px clamp(18px, 4vw, 40px);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.85);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.simple-card h1 {
    margin: 0;
    font-size: 1.8em;
    color: #0f172a;
}

.simple-card p {
    margin: 0;
    color: var(--color-muted);
}

.simple-card form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.simple-card form label {
    width: 100%;
    font-weight: 600;
    color: #475569;
}

.simple-card form input {
    flex: 1 1 260px;
}

.simple-card .table-wrapper {
    background: var(--color-surface);
}

.student-table th:nth-child(1) { width: 32%; }
.student-table th:nth-child(2) { width: 40%; }
.student-table th:nth-child(3) { width: 28%; text-align: center; }
.student-table td:nth-child(2) { font-weight: 600; color: #0f172a; letter-spacing: 0.01em; }
.student-table td:nth-child(3) { text-align: center; }
.student-table .kelas-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.82em;
    letter-spacing: 0.04em;
}

.teacher-name { display: flex; flex-direction: column; gap: 8px; }
.teacher-name__title { font-weight: 600; color: #0f172a; letter-spacing: 0.01em; }
.teacher-name__meta { display: flex; flex-direction: column; gap: 4px; }
.teacher-name__meta-row { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8em; color: #475569; letter-spacing: 0.02em; }
.teacher-name__meta-label { font-size: 0.72em; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.12em; }
.meta-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.meta-badge {
    padding: 6px 12px;
    background: rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    font-size: 0.8em;
    color: #1f2937;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid rgba(148, 163, 184, 0.28);
}
.meta-badge--muted {
    background: rgba(226, 232, 240, 0.7);
    border-color: rgba(203, 213, 225, 0.9);
    color: #475569;
}

.teacher-table th:nth-child(1) { width: 32%; }
.teacher-table th:nth-child(2) { width: 32%; }
.teacher-table th:nth-child(3) { width: 36%; }
.teacher-table td { vertical-align: top; }
.class-table th:nth-child(1) { width: 60%; }
.class-table th:nth-child(2) { width: 40%; text-align: center; }
.class-table td:nth-child(2) { text-align: center; font-weight: 600; color: #0f172a; }
.mapel-table th,
.mapel-table td { text-align: left; }

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-group,
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label,
.form-field__label {
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
}

.form-field__label {
    font-size: 0.72em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.form-field__hint {
    font-size: 0.78em;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: #f8fafc;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    min-height: 46px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.btn-submit,
button[type="submit"] {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    align-self: flex-end;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.32);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
}

.alert.success {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.32);
}

.empty-state {
    padding: 18px;
    border-radius: 14px;
    background: rgba(226, 232, 240, 0.55);
    color: #64748b;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.6);
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: flex;
    }
    .topbar {
        gap: 12px;
    }
    .topbar .brand {
        flex: 1;
    }
    .logout-btn {
        order: 3;
    }
    .main {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(80vw, 280px);
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        padding-top: 96px;
        z-index: 905;
        box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
    }
    .sidebar .menu {
        flex-direction: column;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
    .content {
        padding: 28px 20px 48px;
    }
}

@media (max-width: 960px) {
    .main {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    }
    .menu {
        flex-direction: row;
        overflow-x: auto;
    }
    .menu a {
        border-left: none;
        border-bottom: 4px solid transparent;
        flex: 1;
        justify-content: center;
    }
    .menu a.active {
        border-bottom-color: var(--color-primary);
    }
    .sidebar--admin {
        width: min(80vw, 280px);
        border-bottom: none;
    }
    .sidebar--admin .menu {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: calc(100vh - 180px);
    }
    .sidebar--admin .menu a {
        border-bottom: none;
        justify-content: flex-start;
    }
    .desktop-view {
        display: none;
    }
    .mobile-view {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .student-row {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }
    .student-name {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 24px 18px 32px;
    }
    .topbar {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .hero h1 {
        font-size: 1.8em;
    }
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    text-align: left;
    margin-top: 12px;
}

.table-actions form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-actions form button {
    margin: 0;
}

.meta-muted {
    font-size: 0.82em;
    color: #64748b;
}

.attendance-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 768px) {
    .attendance-actions {
        flex-direction: row;
        align-items: center;
    }
}

.attendance-actions__form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.attendance-actions__form select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #fff;
    font-size: 0.9em;
    color: #1f2937;
}

.attendance-actions__form button {
    margin: 0;
}

.btn-ghost {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.7);
    color: #475569;
}

.btn-ghost:hover {
    background: rgba(241, 245, 249, 0.9);
    transform: translateY(-1px);
}

.btn-danger {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
    transform: translateY(-1px);
}

.pagination,
[data-pagination] {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px;
    margin: 20px 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(79, 70, 229, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.pagination__status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(241, 245, 255, 0.95), rgba(219, 234, 254, 0.85));
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pagination__total {
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 0.8rem;
    font-weight: 500;
}

.pagination__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination__pages {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.pagination__pages li {
    list-style: none;
}

.pagination__pages li::marker {
    content: "";
}

nav[data-pagination] ul,
nav.pagination ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav[data-pagination] li,
nav.pagination li {
    list-style: none;
}

nav[data-pagination] li::marker,
nav.pagination li::marker {
    content: "";
}

.pagination__page {
    display: inline-flex;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.5rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.pagination__btn:hover,
.pagination__btn:focus-visible {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(59, 130, 246, 0.16));
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.24);
    outline: none;
}

.pagination__btn--active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
    cursor: default;
}

.pagination__btn[aria-disabled="true"] {
    background: rgba(226, 232, 240, 0.6);
    border-color: rgba(203, 213, 225, 0.7);
    color: rgba(100, 116, 139, 0.75);
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

.pagination__btn--icon {
    width: 2.45rem;
    padding: 0;
    font-size: 0.9rem;
}

.pagination__btn--icon i {
    pointer-events: none;
}

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    font-weight: 600;
    color: rgba(71, 85, 105, 0.85);
}

@media (max-width: 600px) {
    .pagination,
    [data-pagination] {
        padding: 16px;
    }

    .pagination__controls {
        gap: 8px;
    }

    .pagination__btn {
        min-width: 2.3rem;
        padding: 0.45rem 0.8rem;
    }
}

.panel-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.panel-controls__form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.panel-controls__form label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.panel-controls__form select {
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.9rem;
}

.panel-controls .cache-indicator {
    margin-top: 0;
}

.cache-indicator {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.01em;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(226, 232, 240, 0.65);
}

.cache-indicator--hit {
    color: #047857;
}

.filter-form {
    width: 100%;
}
    .filter-container {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .filter-container button {
        width: 100%;
    }
    .auth-body {
        padding: 24px 12px;
    }
    .login-shell {
        grid-template-columns: 1fr;
    }
.hero-footer {
    flex-direction: column;
    align-items: flex-start;
}

/* Admin dashboard redesign */
.dashboard-overview {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-alert {
    margin-bottom: 12px;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(30, 64, 175, 0.08));
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.12);
    padding: clamp(24px, 4vw, 36px);
    display: grid;
    gap: 28px;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 45%);
    pointer-events: none;
}

.dashboard-hero__content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.74em;
    color: #1d4ed8;
    font-weight: 700;
}

.dashboard-hero__title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.dashboard-hero__description {
    margin: 0;
    font-size: 0.98em;
    color: rgba(30, 41, 59, 0.85);
    max-width: 600px;
    line-height: 1.65;
}

.dashboard-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-hero__snapshot {
    position: relative;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    padding: 24px;
    display: grid;
    gap: 18px;
    box-shadow: 0 26px 42px rgba(15, 23, 42, 0.12);
}

.dashboard-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: 0.06em;
}

.dashboard-hero__stat {
    display: grid;
    gap: 6px;
}

.dashboard-hero__stat-label {
    font-size: 0.78em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.92);
    font-weight: 600;
}

.dashboard-hero__stat-value {
    font-size: 1.05em;
    font-weight: 700;
    color: #0f172a;
}

.dashboard-hero__timestamp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
    font-size: 0.82em;
    font-weight: 600;
    width: fit-content;
}

@media (min-width: 980px) {
    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: stretch;
    }

    .dashboard-hero__snapshot {
        align-self: center;
    }
}

.dashboard-metrics {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
    background: var(--color-surface);
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.12), transparent 45%);
    pointer-events: none;
}

.metric-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #0f172a;
    font-size: 1.35rem;
    background: rgba(37, 99, 235, 0.14);
    flex-shrink: 0;
}

.metric-card__info {
    display: grid;
    gap: 8px;
}

.metric-card__label {
    font-size: 0.84em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.9);
    font-weight: 600;
}

.metric-card__value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.metric-card__hint {
    font-size: 0.82em;
    color: rgba(100, 116, 139, 0.85);
}

.metric-card--students .metric-card__icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.18));
}

.metric-card--teachers .metric-card__icon {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.18));
}

.metric-card--classes .metric-card__icon {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.18));
}

.metric-card--subjects .metric-card__icon {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.22), rgba(232, 121, 249, 0.2));
}

.dashboard-panels {
    display: grid;
    gap: 26px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
    grid-auto-flow: dense;
    grid-auto-rows: minmax(0, 1fr);
}

.data-card {
    background: var(--color-surface);
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 28px 54px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px;
    max-height: 560px;
    height: 100%;
}

.data-card--full {
    grid-column: 1 / -1;
    max-height: 440px;
}

.data-card__header {
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.data-card__title {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.data-card__title-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 1.1rem;
}

.data-card__title h2 {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: #0f172a;
}

.data-card__subtitle {
    margin: 4px 0 0;
    font-size: 0.82em;
    color: rgba(100, 116, 139, 0.85);
}

.data-card__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.82em;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.data-card__action i {
    font-size: 0.9em;
}

.data-card__action:hover,
.data-card__action:focus-visible {
    background: rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.data-card__body {
    padding: 22px 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.data-card__scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    max-height: 100%;
}

.data-card__scroll::-webkit-scrollbar {
    width: 6px;
}

.data-card__scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.data-card__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
}

.data-card__empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 34px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.9);
    background: rgba(241, 245, 249, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 18px;
}

.data-card table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

.data-card thead th {
    padding: 12px 16px;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.data-card tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    font-size: 0.92em;
    color: #1f2937;
}

.data-card tbody tr:last-child td {
    border-bottom: none;
}

.data-card tbody tr:hover {
    background: rgba(248, 250, 252, 0.8);
}

.dashboard-table--compact td {
    font-size: 0.9em;
}

.dashboard-table--center td:last-child,
.dashboard-table--center th:last-child {
    text-align: center;
}

@media (max-width: 768px) {
    .dashboard-hero__snapshot {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .dashboard-panels {
        gap: 20px;
        grid-auto-rows: auto;
    }

    .data-card {
        max-height: none;
    }

    .data-card--full {
        grid-column: auto;
    }
}

/* ------------------------------------------------------------------ */
/* Minimal UI refresh                                                  */
/* ------------------------------------------------------------------ */
:root {
    --color-bg: #f6f7fb;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-soft: rgba(37, 99, 235, 0.08);
    --shadow-soft: 0 10px 32px rgba(15, 23, 42, 0.08);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
}

.layout {
    background: transparent;
}

.topbar {
    background: #fff;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
    padding: 16px clamp(18px, 4vw, 32px);
}

.brand img {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.brand-info strong {
    color: var(--color-text);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.88em;
}

.brand-info span {
    color: var(--color-muted);
    opacity: 1;
}

.logout-btn {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    box-shadow: none;
}

.logout-btn:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.nav-toggle {
    background: #fff;
    border-color: var(--color-border);
    color: var(--color-text);
}

.main {
    background: transparent;
    gap: 0;
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--color-border);
    padding: 24px 0;
    box-shadow: none;
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.4);
}

.sidebar--admin {
    background: #fff;
    color: var(--color-text);
    box-shadow: none;
}

.sidebar--admin::after {
    display: none;
}

.sidebar--admin .sidebar-inner {
    padding: 28px 22px;
    gap: 22px;
}

.sidebar-brand__title {
    color: var(--color-text);
    letter-spacing: 0.18em;
    font-size: 0.82em;
}

.sidebar-brand__subtitle {
    color: var(--color-muted);
}

.sidebar-section__title {
    color: #a1a1aa;
    letter-spacing: 0.14em;
}

.sidebar--admin .menu {
    gap: 6px;
}

.sidebar--admin .menu a {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    color: #4b5563;
    font-weight: 500;
}

.sidebar--admin .menu a:hover {
    background: #f5f6fb;
    border-color: var(--color-border);
    box-shadow: none;
    color: var(--color-text);
    transform: none;
}

.sidebar--admin .menu a.active {
    background: #eef2ff;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: none;
    color: var(--color-text);
    font-weight: 600;
}

.menu-link__icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: transparent;
    color: inherit;
}

.menu-link__indicator {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

.sidebar-logout {
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: transparent;
    color: var(--color-text);
    padding: 8px 14px;
}

.sidebar-logout:hover {
    background: #f4f6fb;
    transform: none;
}

.sidebar-meta {
    color: var(--color-muted);
}

.content {
    background: transparent;
    padding: 32px clamp(20px, 4vw, 48px) 48px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.hero,
.dashboard-hero,
.stat-card,
.summary-card,
.metric-card,
.data-card,
.calendar-card,
.form-card,
.assignment-card,
.simple-card,
.card,
.panel,
.overview-card,
.rekap-card,
.day-card {
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: none;
}

.hero {
    padding: 28px 32px;
}

.hero::after,
.dashboard-hero::after,
.summary-card::after,
.stat-card::after,
.metric-card::after {
    content: none;
}

.hero-main .greeting {
    color: #9ca3af;
    letter-spacing: 0.18em;
}

.hero p {
    color: var(--color-muted);
}

.hero-meta {
    gap: 10px;
}

.meta-pill {
    background: #f5f6fb;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 500;
}

.dashboard-hero {
    border-radius: 20px;
    padding: 28px;
    background: #fff;
}

.dashboard-hero__content {
    gap: 16px;
}

.dashboard-hero__badge {
    background: #f4f6fb;
    color: var(--color-muted);
    font-weight: 500;
}

.dashboard-hero__description {
    color: var(--color-muted);
}

.dashboard-hero__snapshot {
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.dashboard-hero__timestamp {
    background: #f4f6fb;
    color: var(--color-muted);
}

.dashboard-metrics {
    gap: 16px;
}

.metric-card {
    padding: 18px 20px;
    gap: 14px;
}

.metric-card::after {
    content: none;
}

.metric-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eef2ff;
    color: #312e81;
    box-shadow: none;
}

.metric-card__value,
.summary-card .value,
.stat-card .value {
    color: var(--color-text);
    font-weight: 600;
}

.metric-card__label,
.summary-card .label,
.stat-card .label {
    color: var(--color-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78em;
}

.summary-grid {
    gap: 16px;
}

.summary-card {
    padding: 18px 20px;
}

.summary-card i {
    color: var(--color-muted);
    font-size: 1.4em;
}

.panel-action,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-text,
.btn-submit,
button[type="submit"] {
    box-shadow: none;
}

.btn-primary {
    background: var(--color-text);
    border: 1px solid var(--color-text);
    color: #fff;
}

.btn-primary:hover {
    background: #111111;
    transform: none;
}

.btn-secondary {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #f3f4f6;
    transform: none;
}

.btn-ghost,
.btn-text {
    background: transparent;
    color: var(--color-muted);
    padding: 8px 12px;
}

.btn-ghost:hover,
.btn-text:hover {
    background: #f5f5f5;
    transform: none;
}

.panel-action {
    border-radius: 999px;
    padding: 8px 16px;
    background: var(--color-text);
    color: #fff;
}

.section-heading h2 {
    color: var(--color-text);
}

.section-heading p {
    color: var(--color-muted);
}

.table-wrapper {
    border: 1px solid var(--color-border);
    background: #fff;
}

table {
    background: transparent;
}

thead th {
    background: #f9fafb;
    color: #6b7280;
    letter-spacing: 0.1em;
}

tbody tr {
    background: transparent;
    transform: none;
    box-shadow: none;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:hover {
    background: #eef2ff;
    transform: none;
    box-shadow: none;
}

tbody td {
    border-bottom: 1px solid var(--color-border);
}

.status-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
    padding: 8px 12px;
    line-height: 1.4;
}

.status-chip.status-hadir {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.status-chip.status-sakit {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.status-chip.status-izin {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.status-chip.status-alpa {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.calendar-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
}

.day-card {
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: none;
}

.form-group label,
.form-field__label {
    color: var(--color-muted);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.btn-submit,
button[type="submit"] {
    background: var(--color-text);
    color: #fff;
    border: 1px solid var(--color-text);
    padding: 12px 20px;
    border-radius: 12px;
    align-self: flex-start;
}

.alert {
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.alert.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.alert.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.empty-state {
    background: #f9fafb;
    border: 1px dashed var(--color-border);
    color: var(--color-muted);
}

.auth-body {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 60px 16px;
}

.login-shell {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.login-hero {
    background: #f9fafb;
    color: var(--color-text);
}

.login-hero::after {
    content: none;
}

.hero-footer .tag {
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
}

.login-form {
    background: #fff;
}

.input-field {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.error-message {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.footer-note {
    color: var(--color-muted);
}

.page-loader {
    background: rgba(246, 247, 251, 0.95);
}

.loader-card {
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: none;
    color: var(--color-text);
}

.loader-spinner {
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
}

.simple-body {
    background: var(--color-bg);
}

.simple-card {
    box-shadow: none;
}

.data-card tbody tr:hover {
    background: #eef2ff;
}

.dashboard-table--compact td {
    font-size: 0.9em;
}

/* Admin minimal dashboard */
.admin-minimal {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.admin-minimal__alert {
    margin: 0;
}

.admin-intro {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #fff;
}

.admin-intro__text {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-intro__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9ca3af;
    margin: 0;
}

.admin-intro__text h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.admin-intro__description {
    margin: 0;
    color: var(--color-muted);
}

.admin-intro__meta {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.admin-intro__meta-item {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.meta-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a1a1aa;
}

.meta-value {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 4px;
}

.account-panel {
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.account-panel .card-header {
    border-bottom: 1px solid var(--color-border);
}

.account-panel__body {
    display: block;
}

.account-panel.is-collapsible:not(.is-open) .account-panel__body {
    display: none;
}

.account-panel__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: 999px;
    color: var(--color-text);
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
}

.account-panel__toggle i {
    transition: transform 0.2s ease;
}

.account-panel.is-collapsible:not(.is-open) .account-panel__toggle i {
    transform: rotate(-90deg);
}

.account-panel.is-open .account-panel__toggle i {
    transform: rotate(0deg);
}

.account-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.admin-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-section-header__eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9ca3af;
    margin: 0;
}

.admin-section-header h2 {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.admin-section-header__hint {
    font-size: 0.85rem;
    color: var(--color-muted);
}

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

.shortcut-card {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
}

.shortcut-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f4f6fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    font-size: 1.05em;
}

.shortcut-card__body h3 {
    margin: 0;
    font-size: 1.05rem;
}

.shortcut-card__body p {
    margin: 6px 0 0;
    color: var(--color-muted);
}

.shortcut-card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-muted);
}

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

.admin-update-card {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-update-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.admin-update-card__eyebrow {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #9ca3af;
}

.admin-update-card__header h3 {
    margin: 2px 0 0;
    font-size: 1rem;
}

.admin-update-card__total {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.admin-update-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-update-card__list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-update-card__list strong {
    font-size: 0.95rem;
}

.admin-update-card__list span {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.admin-update-card__empty {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .admin-intro {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-intro__meta {
        width: 100%;
    }
}

/* -------------------------------------------------------------
   Portal interface refresh overrides
------------------------------------------------------------- */

:root {
    --sidebar-width-desktop: 272px;
    --sidebar-width-tablet: 240px;
}

.portal-layout,
.layout {
    background: var(--color-bg);
    color: var(--color-text);
}

.layout-shell,
.main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: clamp(1.5rem, 3vw, 2.75rem);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.portal-content,
.content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    padding: 0;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.portal-topbar,
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    padding: 12px 20px;
    background: linear-gradient(120deg, var(--color-primary-dark), #0f172a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.portal-topbar .brand,
.topbar .brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.portal-topbar .brand img,
.topbar .brand img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.portal-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
}

.portal-sidebar,
.sidebar {
    flex: 0 0 var(--sidebar-width-desktop);
    width: 240px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    border-radius: 0;
    padding: var(--spacing-xl) 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 0px);
    box-shadow: var(--shadow-sm);
}

.layout.sidebar-collapsed .sidebar {
    display: none;
}

.portal-sidebar .sidebar-inner,
.sidebar .sidebar-inner {
    padding-inline: clamp(1rem, 2vw, 1.5rem);
}

.portal-sidebar .sidebar-brand,
.sidebar .sidebar-brand {
    padding-inline: clamp(1rem, 2vw, 1.5rem);
}

.portal-sidebar .menu a,
.sidebar .menu a {
    border-radius: var(--radius-md);
    border-left-width: 0;
    padding: 0.75rem 1rem;
}

.portal-sidebar .menu a.active,
.sidebar .menu a.active {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.portal-sidebar .sidebar-footer,
.sidebar .sidebar-footer {
    margin-top: auto;
    padding: var(--spacing-lg) clamp(1rem, 2vw, 1.5rem);
    border-top: 1px solid var(--color-border);
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, 0.65);
}

.card,
.panel,
.dashboard-hero,
.calendar-card,
.shortcut-card,
.data-card,
.admin-intro,
.hero,
.simple-card,
.stage-card,
.form-card {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
    padding: clamp(1.25rem, 3vw, 2rem);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card,
.stat-card,
.metric-card {
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.panel:hover,
.dashboard-hero:hover,
.calendar-card:hover,
.shortcut-card:hover,
.data-card:hover,
.admin-intro:hover,
.hero:hover,
.simple-card:hover,
.stage-card:hover,
.form-card:hover,
.summary-card:hover,
.stat-card:hover,
.metric-card:hover {
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.panel-header,
.section-heading {
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.panel-header h2,
.section-heading h2 {
    margin: 0;
}

@keyframes fade-page {
    from { opacity: 0; }
    to { opacity: 1; }
}

.backup-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-lg);
}

.backup-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.backup-meta {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #e5edf8;
    color: #1f2937;
    font-size: 0.95rem;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-text,
.btn-danger,
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-base);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn {
    background: transparent;
    color: var(--color-text);
}

.btn-primary,
.btn-submit {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.25);
}

.btn-secondary:hover {
    background: rgba(37, 99, 235, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.btn-secondary.btn-compact {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary-dark);
    border-color: rgba(37, 99, 235, 0.3);
}

.btn-save-mapel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-form.compact {
    gap: 6px;
}

.inline-form input[type="text"] {
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    min-width: 180px;
}

.compact-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-actions .inline-form input[type="text"] {
    min-width: 160px;
}

.btn-compact {
    padding: 6px 10px;
    border-radius: 10px;
}

.mapel-name {
    display: inline-block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.btn-save-kelas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.table-kelas tbody tr:hover {
    background: #f8faff;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-ghost,
.btn-text {
    background: transparent;
    color: inherit;
    border-color: transparent;
}

.btn-ghost:hover,
.btn-text:hover {
    background: rgba(255, 255, 255, 0.12);
}

.portal-topbar .btn-ghost,
.topbar .btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    padding: var(--spacing-md);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.alert-success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.alert-warning {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.warning-text {
    font-size: 0.9rem;
    color: #92400e;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table thead th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--color-muted);
    padding: 0.85rem 1rem;
    background: var(--color-bg-muted);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-header-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    color: #94a3b8;
}

.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.table-presensi-input td.sticky-col,
.table-presensi-input th.sticky-col {
    position: sticky;
    left: 0;
    background: var(--color-surface);
    z-index: 2;
}

.table-presensi-input .sticky-nisn {
    left: 60px;
}

.table-presensi-input .sticky-nama {
    left: 160px;
}

.table-presensi-input .sticky-no {
    left: 0;
    z-index: 3;
}

.table-presensi-input tbody tr:nth-child(even) td.sticky-col {
    background: var(--color-surface-alt);
}

.table-presensi-input tbody tr.row-status-hadir {
    background: #ecfdf3;
}

.table-presensi-input tbody tr.row-status-izin {
    background: #fff7e6;
}

.table-presensi-input tbody tr.row-status-sakit {
    background: #eaf4ff;
}

.table-presensi-input tbody tr.row-status-alpa {
    background: #fff1f2;
}

.table-presensi-input tbody tr td.sticky-col.row-status-hadir,
.table-presensi-input tbody tr td.sticky-col.row-status-izin,
.table-presensi-input tbody tr td.sticky-col.row-status-sakit,
.table-presensi-input tbody tr td.sticky-col.row-status-alpa {
    background: inherit;
}

.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-top: 8px;
}

.save-indicator .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.table tbody tr:nth-child(even) {
    background: var(--color-surface-alt);
}

.table tbody tr:hover {
    background: var(--color-primary-soft);
}

.table-row-hover:hover {
    background: #f8faff;
}

.table-guru thead th {
    border-bottom: 1px solid #eef1f5;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5edff;
    color: #1d4ed8;
    font-weight: 700;
    margin-right: 10px;
    font-size: 0.95rem;
}

.table-mapel tbody tr:hover {
    background: #f9fbff;
    transition: 0.15s ease;
}

.table-penugasan tbody tr:hover {
    background: #f8faff;
    transition: 0.15s ease;
}

.btn-kelola:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.table-presensi thead th {
    border-bottom: 1px solid #eef1f5;
}

.laporan-presensi thead tr:nth-child(2) th,
.laporan-presensi .tanggal-head {
    background: #eef2ff;
}

.laporan-presensi .sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
}

.laporan-presensi td,
.laporan-presensi th {
    white-space: nowrap;
}

.laporan-presensi .today-col {
    background: #e0f2fe;
    color: #0f172a;
}

.status-chip.mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 4px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.status-empty {
    background: #f3f4f6;
    color: #94a3b8;
}
.filter-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
    padding: 10px 12px;
    background: #f8fbff;
    border: 1px solid #e5edf8;
    border-radius: 12px;
}

.filter-badge-title {
    font-weight: 600;
    color: #1d4ed8;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: #e7f1ff;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-badge-reset {
    margin-left: auto;
    color: #ef4444;
    font-weight: 600;
}

.table-siswa thead th {
    border-bottom: 1px solid #eef1f5;
}

.throttle-table th {
    text-align: left;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-full);
    background: #e9f3ff;
    color: #1a4a7a;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge--warning {
    background: #fff4d6;
    color: #975f00;
}

.status-badge--danger {
    background: #ffe5e5;
    color: #8b1a1a;
}

.status-badge--success {
    background: #e2f8ef;
    color: #0f5132;
}

.event-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.event-badge--success {
    background: #dcfce7;
    color: #166534;
}

.event-badge--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.event-badge--info {
    background: #e0f2fe;
    color: #075985;
}

.event-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.event-badge--neutral {
    background: #e5e7eb;
    color: #374151;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    font-size: 0.85rem;
}

.audit-row__toggle {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.audit-detail-row {
    display: none;
    background: #f8fafc;
}

.audit-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 12px;
    font-size: 0.95rem;
}

.audit-meta-note {
    grid-column: 1 / -1;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.cache-indicator {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: var(--spacing-md);
}

.cache-indicator--hit {
    color: #047857;
}

.table-empty {
    text-align: center;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.action-form {
    margin-bottom: var(--spacing-xs);
}

.action-form:last-child {
    margin-bottom: 0;
}

.simple-body {
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    font-family: var(--font-base);
}

.simple-card {
    width: min(720px, 100%);
    padding: var(--spacing-xl);
    gap: var(--spacing-lg);
}

.simple-card form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.simple-card .input-field {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 0.85rem 1rem;
    font-family: inherit;
}

.simple-card .input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.auth-layout {
    min-height: 100vh;
    padding: clamp(2rem, 6vw, 5rem);
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.08), transparent),
        var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-base);
}

.auth-panel {
    width: min(420px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.auth-brand img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 2px solid rgba(37, 99, 235, 0.25);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.auth-form .input-field {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
}

.auth-form .input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.auth-tagline {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0 0 var(--spacing-md);
    text-align: center;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
    display: inline-block;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    color: var(--color-muted);
}

.auth-support {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--color-muted);
}

.auth-support a {
    color: var(--color-primary);
    font-weight: 600;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    align-items: center;
}

.filters input[type="search"],
.filters select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-family: inherit;
}

.filters input[type="search"]:focus,
.filters select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    outline: none;
}

@media (max-width: 1600px) {
    :root {
        --sidebar-width-desktop: 248px;
    }

    .portal-content,
    .content {
        max-width: 1100px;
    }

    .layout-shell,
    .main {
        padding: clamp(1.25rem, 3vw, 2.5rem);
    }

    .card,
    .panel,
    .hero,
    .form-card,
    .simple-card {
        padding: clamp(1.15rem, 3vw, 1.85rem);
    }
}

@media (max-width: 1400px) {
    :root {
        --sidebar-width-desktop: 220px;
    }

    body {
        font-size: 14.5px;
    }

    .portal-content,
    .content {
        max-width: 1000px;
    }

    .portal-topbar,
    .topbar {
        padding: var(--spacing-md) clamp(1.25rem, 4vw, 2rem);
        gap: var(--spacing-md);
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: var(--spacing-md);
    }

    .filters,
    .filter-form,
    .form-grid {
        gap: var(--spacing-sm);
    }

    .filter-form select,
    .filter-form input {
        min-width: 150px;
    }
}

@media (max-width: 1366px) {
    :root {
        --sidebar-width-desktop: 190px;
    }

    body {
        font-size: 14px;
    }

    .portal-topbar,
    .topbar {
        padding: var(--spacing-sm) clamp(1rem, 4vw, 1.5rem);
    }

    .portal-topbar .brand img,
    .topbar .brand img {
        width: 40px;
        height: 40px;
    }

    .brand-info strong {
        font-size: 1rem;
    }

    .layout-shell,
    .main {
        padding: clamp(1rem, 3vw, 1.75rem);
    }

    .portal-content,
    .content {
        max-width: 940px;
        gap: var(--spacing-lg);
    }

    .card,
    .panel,
    .hero,
    .form-card,
    .simple-card {
        padding: clamp(1rem, 4vw, 1.5rem);
    }

    .hero h1 {
        font-size: clamp(1.5rem, 4vw, 1.9rem);
    }

    .summary-grid,
    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .filter-form {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .filter-form > * {
        flex: 1 1 220px;
        min-width: 200px;
    }

    .table-wrapper {
        margin-top: var(--spacing-md);
        overflow-x: auto;
    }

    table,
    .table {
        min-width: 720px;
        table-layout: auto;
    }

    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 0.92rem;
    }

    .meta-pill {
        font-size: 0.82rem;
    }
}

@media (max-width: 1023px) {
    .layout-shell,
    .main {
        flex-direction: column;
        padding: var(--spacing-lg);
    }

    .portal-sidebar,
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(80vw, 320px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: var(--spacing-xl) var(--spacing-md);
        z-index: 910;
    }

    .portal-sidebar.sidebar--open,
    .sidebar.sidebar--open {
        transform: translateX(0);
    }

    .portal-topbar,
    .topbar {
        flex-wrap: wrap;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .portal-topbar__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .nav-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: visible;
    }

    .table-wrapper table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .table-wrapper table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .table-wrapper table tbody {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .table-wrapper table tbody tr {
        display: flex;
        flex-direction: column;
        gap: 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        background: #fff;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    }

    .table-wrapper table tbody td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        font-size: 0.95rem;
        padding: 0;
    }

    .table-wrapper table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-size: 0.78rem;
        flex: 0 0 auto;
        max-width: none;
    }

    .table-wrapper table tbody td > *:not(:only-child) {
        flex: 1;
        min-width: 0;
    }

    .table-wrapper table tbody td select,
    .table-wrapper table tbody td input,
    .table-wrapper table tbody td .btn,
    .table-wrapper table tbody td button {
        width: 100%;
    }

    .table-wrapper table tbody td .form-grid {
        width: 100%;
        gap: 12px;
    }

    .form-grid--two {
        grid-template-columns: 1fr;
    }

    .table-wrapper table tbody td.table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .table-wrapper table tbody td.table-actions::before {
        flex: 0 0 auto;
        max-width: none;
        margin-bottom: 6px;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .table-actions form {
        width: 100%;
    }

    .table-actions form button {
        width: 100%;
        justify-content: center;
    }

    /* Ringkas input presensi guru di mobile: sembunyikan kolom No & NISN */
    .table-presensi-input td[data-label^="No"],
    .table-presensi-input td[data-label^="NISN"] {
        display: none;
    }
}

@media (max-height: 780px) {
    .sidebar {
        overflow-y: auto;
    }
}

@media (max-width: 767px) {
    .portal-topbar,
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-content,
    .content {
        padding: 0;
    }

    .card,
    .simple-card {
        padding: var(--spacing-lg);
    }

    .auth-panel {
        padding: var(--spacing-lg);
    }

    .simple-body {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* Footbar styling */
.footbar {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 16px 24px;
}
.footbar__brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footbar__brand strong {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
}
.footbar__brand span {
    font-size: 14px;
    color: #475569;
}



