/* =========================================================
 * SIMDATADIK - Global Styles (2026)
 * File : public/css/main.css
 * ======================================================= */

/* ------------------------------
   1. Reset & Base
------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background: #020617; /* slate-950 */
    color: #e5e7eb;      /* slate-200 */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #60a5fa;      /* blue-400 */
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    color: #93c5fd;
}

/* ------------------------------
   2. Layout Shell & Background
------------------------------ */

.layout-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 0% 0%, rgba(59,130,246,0.2), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(16,185,129,0.18), transparent 55%),
        #020617;
}

/* ------------------------------
   3. Header
------------------------------ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(15,23,42,0.8);
    background: linear-gradient(
        to right,
        rgba(15,23,42,0.97),
        rgba(15,23,42,0.92)
    );
    backdrop-filter: blur(18px);
}

.app-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.45rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

/* Brand */

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-logo {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.9rem;
    background:
        radial-gradient(circle at 0 0, #38bdf8, transparent 55%),
        radial-gradient(circle at 100% 100%, #22c55e, transparent 55%),
        #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #f9fafb;
    box-shadow:
        0 8px 20px rgba(15,23,42,0.8),
        0 0 0 1px rgba(148,163,184,0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #e5e7eb;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Header Right */

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e5e7eb;
}

.header-user-role {
    font-size: 0.7rem;
    color: #9ca3af;
}

.avatar-initial {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, #60a5fa, #1d4ed8);
    color: #eff6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(15,23,42,0.7);
}

/* Top header buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.33rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: #e5e7eb;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.08s ease;
}

.btn-sm {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
}

.btn:hover {
    transform: translateY(-0.5px);
}

.btn-primary {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    border-color: transparent;
    color: #eff6ff;
    box-shadow: 0 8px 16px rgba(37,99,235,0.35);
}

.btn-primary:hover {
    background: linear-gradient(to right, #1d4ed8, #4338ca);
}

.btn-outline {
    border-color: rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.7);
    color: #e5e7eb;
}

.btn-outline:hover {
    border-color: #60a5fa;
    background: rgba(15,23,42,0.95);
}

.btn-danger {
    background: linear-gradient(to right, #dc2626, #b91c1c);
    border-color: transparent;
    color: #fee2e2;
    box-shadow: 0 8px 16px rgba(185,28,28,0.35);
}

.btn-danger:hover {
    background: linear-gradient(to right, #b91c1c, #991b1b);
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ------------------------------
   4. Main Layout
------------------------------ */

.app-main {
    flex: 1 1 auto;
    padding: 1.4rem 1.25rem 1.8rem;
}

.app-main-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

/* Saat user login, ada sidebar */
.layout-with-sidebar {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: flex-start;
}

/* Sidebar */

.sidebar {
    border-radius: 0.9rem;
    border: 1px solid rgba(15,23,42,0.85);
    padding: 0.85rem 0.75rem;
    background: radial-gradient(circle at 0 0, rgba(59,130,246,0.18), transparent 65%),
                rgba(15,23,42,0.96);
    box-shadow:
        0 18px 40px rgba(15,23,42,0.9),
        0 0 0 1px rgba(30,64,175,0.2);
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 0 0 0.45rem;
    padding: 0 0.2rem;
}

.sidebar-item {
    font-size: 0.8rem;
    color: #e5e7eb;
    margin: 0.2rem 0;
}

.sidebar-item a {
    color: inherit;
}

/* Bisa dipakai untuk list menu yang lebih kompleks */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #e5e7eb;
    padding: 0.34rem 0.55rem;
    border-radius: 0.6rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.sidebar-link span.label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-link small.badge {
    background: rgba(15,23,42,0.9);
    border-radius: 999px;
    padding: 0.06rem 0.45rem;
    font-size: 0.7rem;
    color: #9ca3af;
    border: 1px solid rgba(55,65,81,0.9);
}

.sidebar-link:hover {
    background: rgba(30,64,175,0.7);
    text-decoration: none;
    transform: translateY(-0.5px);
}

.sidebar-link-active {
    background: linear-gradient(135deg, rgba(37,99,235,0.8), rgba(22,163,74,0.8));
    border-radius: 0.6rem;
    box-shadow: 0 12px 28px rgba(15,23,42,0.9);
}

.sidebar-link-active span.label {
    color: #f9fafb;
}

/* ------------------------------
   5. Content Card & Typography
------------------------------ */

.page-card {
    border-radius: 1rem;
    border: 1px solid rgba(30,64,175,0.4);
    background:
        radial-gradient(circle at 0 0, rgba(37,99,235,0.15), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(16,185,129,0.12), transparent 60%),
        rgba(15,23,42,0.96);
    padding: 1.3rem 1.3rem 1.4rem;
    box-shadow:
        0 24px 60px rgba(15,23,42,0.95),
        0 0 0 1px rgba(15,23,42,0.9);
}

.page-title {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #f9fafb;
}

.page-subtitle {
    margin: 0 0 0.9rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.page-content {
    margin-top: 0.1rem;
}

/* ------------------------------
   6. Flash / Alerts
------------------------------ */

.alerts {
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.alert {
    border-radius: 0.7rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.alert-success {
    background: rgba(22,163,74,0.12);
    border-color: rgba(74,222,128,0.35);
    color: #bbf7d0;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    border-color: rgba(252,165,165,0.5);
    color: #fecaca;
}

.alert-info {
    background: rgba(59,130,246,0.13);
    border-color: rgba(147,197,253,0.55);
    color: #bfdbfe;
}

/* ------------------------------
   7. Cards, Badges, Sections
------------------------------ */

.dash-card {
    background: rgba(15,23,42,0.96);
    border-radius: 0.85rem;
    border: 1px solid rgba(31,41,55,0.95);
    padding: 0.95rem 1rem;
    box-shadow: 0 14px 35px rgba(15,23,42,0.9);
}

.dash-card-soft {
    background: rgba(30,64,175,0.15);
    border-radius: 0.85rem;
    border: 1px solid rgba(129,140,248,0.6);
    padding: 0.9rem 0.95rem;
    font-size: 0.8rem;
    color: #e0f2fe;
}

.dash-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #e5e7eb;
}

.dash-section-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0 0 0.6rem;
}

/* Soft badges */

.badge-soft-sky,
.badge-soft-green,
.badge-soft-amber,
.badge-soft-slate {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-soft-sky {
    background: rgba(56,189,248,0.2);
    color: #e0f2fe;
}

.badge-soft-green {
    background: rgba(34,197,94,0.22);
    color: #bbf7d0;
}

.badge-soft-amber {
    background: rgba(251,191,36,0.22);
    color: #fef3c7;
}

.badge-soft-slate {
    background: rgba(148,163,184,0.22);
    color: #e5e7eb;
}

/* ------------------------------
   8. Stats cards
------------------------------ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.stat-card {
    background: rgba(15,23,42,0.96);
    border-radius: 0.75rem;
    border: 1px solid rgba(31,41,55,0.95);
    padding: 0.7rem 0.8rem;
}

.stat-card.highlight {
    border-color: rgba(59,130,246,0.9);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.6);
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.18rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f9fafb;
}

.stat-caption {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ------------------------------
   9. Table
------------------------------ */

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table th,
.table td {
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid rgba(31,41,55,0.9);
    text-align: left;
}

.table th {
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.78rem;
    white-space: nowrap;
}

.table td {
    color: #e5e7eb;
    vertical-align: top;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(15,23,42,0.9);
}

/* ------------------------------
   10. Forms
------------------------------ */

.form-group {
    margin-bottom: 0.55rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #e5e7eb;
    display: block;
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.55rem;
    border: 1px solid rgba(55,65,81,0.9);
    font-size: 0.8rem;
    padding: 0.32rem 0.45rem;
    background: rgba(15,23,42,0.95);
    color: #e5e7eb;
    transition: border-color 0.12s ease, box-shadow 0.12s ease,
        background-color 0.12s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(59,130,246,0.7);
    background: #020617;
}

.form-textarea {
    min-height: 3.2rem;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.18rem;
}

.form-row-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #e5e7eb;
}

.form-checkbox-row input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
}

/* ------------------------------
   11. Status & Utility
------------------------------ */

.label-small {
    font-size: 0.72rem;
    color: #6b7280;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid transparent;
}

.status-draft {
    background: rgba(148,163,184,0.25);
    border-color: rgba(148,163,184,0.6);
    color: #e5e7eb;
}

.status-active {
    background: rgba(34,197,94,0.2);
    border-color: rgba(74,222,128,0.6);
    color: #bbf7d0;
}

.status-archived {
    background: rgba(31,41,55,0.9);
    border-color: rgba(75,85,99,0.9);
    color: #9ca3af;
}

/* User status */

.status-user-active {
    background: rgba(34,197,94,0.2);
    border-color: rgba(74,222,128,0.6);
    color: #bbf7d0;
}

.status-user-suspended {
    background: rgba(239,68,68,0.16);
    border-color: rgba(252,165,165,0.8);
    color: #fecaca;
}

.status-user-pending {
    background: rgba(251,191,36,0.22);
    border-color: rgba(252,211,77,0.8);
    color: #fef3c7;
}

.status-user-deleted {
    background: rgba(31,41,55,0.9);
    border-color: rgba(55,65,81,0.9);
    color: #9ca3af;
}

.empty-note {
    font-size: 0.8rem;
    color: #9ca3af;
}

.hint-box {
    margin-top: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.6rem;
    background: rgba(15,23,42,0.96);
    border: 1px dashed rgba(75,85,99,0.9);
    font-size: 0.78rem;
    color: #e5e7eb;
}

/* Grid helper (AcademicYear & UserManagement) */

.ay-grid,
.um-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 1.25rem;
}

.ay-main,
.ay-side,
.um-main,
.um-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ------------------------------
   12. Footer
------------------------------ */

.app-footer {
    border-top: 1px solid rgba(15,23,42,0.9);
    padding: 0.75rem 1.25rem 1.2rem;
    font-size: 0.78rem;
    color: #6b7280;
    background: rgba(15,23,42,0.98);
}

.app-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: rgba(31,41,55,0.9);
    color: #9ca3af;
}

/* ------------------------------
   13. Responsive
------------------------------ */

@media (max-width: 1024px) {
    .layout-with-sidebar {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .app-main-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: static;
        order: -1;
        margin-bottom: 0.3rem;
    }

    .ay-grid,
    .um-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .app-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .header-user-info {
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
