/* =====================================================
   SIPENA - Professional Educational Theme
   Elegant, Simple, Inspiring
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #10b981;
    --accent-dark: #059669;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== LANDING PAGE ========== */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-header {
    background: var(--bg-topbar, var(--primary));
    color: white;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.landing-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 800;
}

.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hero .tagline {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.btn-cta {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-install-pwa {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    cursor: pointer;
}

.btn-install-pwa:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-install-pwa.installed {
    background: #10b981;
    border-color: #10b981;
    color: white;
    cursor: default;
    pointer-events: none;
}

.section {
    padding: 3.5rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.75rem;
    height: 100%;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #dbeafe, #d1fae5);
    color: var(--primary);
}

.feature-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.steps {
    counter-reset: step;
}

.step-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    align-items: flex-start;
}

.step-number {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h6 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.step-content p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* Sticky Footer — selalu tampil di bawah saat scroll */
.sticky-footer {
    background: var(--bg-footer, var(--bg-topbar, #2563eb));
    color: #94a3b8;
    padding: 1rem 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.sticky-footer a {
    color: #cbd5e1;
    text-decoration: none;
}

.sticky-footer a:hover {
    color: white;
}

/* Ruang agar konten tidak tertutup footer tetap */
.landing,
.user-page {
    padding-bottom: 70px;
}

/* ========== USER PAGE ========== */
.user-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 40%);
}

.user-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.user-card .card-header {
    background: var(--bg-topbar, var(--primary));
    color: white;
    padding: 1.25rem 1.5rem;
    border: none;
}

.collapse-form {
    border-top: 1px solid var(--border);
}

.password-toggle {
    cursor: pointer;
    user-select: none;
}

.eye-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.table-users th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

/* ========== APP LAYOUT (Sidebar) ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar, #0f172a);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #1e293b;
}

.sidebar-brand .logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}

.sidebar-brand span {
    font-weight: 700;
    color: white;
    font-size: 1.15rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.85rem 0.4rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #1e293b;
    color: white;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link i, .nav-link svg {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #1e293b;
    font-size: 0.8rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-topbar, var(--primary));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content {
    padding: 1.5rem;
    padding-bottom: 5rem;
    flex: 1;
    background: var(--bg-canvas, #f1f5f9);
}

/* Footer aplikasi — selalu tampil di bawah */
.app-footer-fixed {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #fff;
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

@media (max-width: 991.98px) {
    .app-footer-fixed {
        left: 0;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Cards */
.card-app {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-app .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-app .card-body {
    padding: 1.25rem;
}

/* Stats */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
}

.table thead th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.925rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

/* Mobile sidebar */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text);
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 1rem;
    }
    .hero {
        padding: 2.5rem 0 2rem;
    }
    .section {
        padding: 2.5rem 0;
    }
}

/* DataTables custom */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Form */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Badge status */
.badge-status {
    font-weight: 500;
    padding: 0.35em 0.7em;
    border-radius: 6px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Color picker */
.color-preview {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
}

/* Print */

/* Footer seragam (center) — semua halaman */
.footer-unified,
.sticky-footer.footer-unified,
.app-footer-fixed.footer-unified {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: #0f172a;
    color: #94a3b8;
    padding: 0.85rem 1rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    border-top: none;
    font-size: 0.85rem;
}
.footer-unified .footer-brand {
    color: #fff;
    font-weight: 600;
}
.footer-unified .container {
    text-align: center !important;
}
/* Di layout aplikasi: footer full-width (abaikan sidebar offset lama) */
.app-footer-fixed.footer-unified {
    left: 0 !important;
    margin: 0;
}

@media print {
    .sidebar, .topbar, .sidebar-toggle, .no-print,
    .app-footer-fixed, .sticky-footer {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        padding-bottom: 1rem !important;
    }
}
