/* ============================================
   GLOBAL STYLES - SMK CIJANGKAR
   Reset | Variables | Typography | Components
   ============================================ */

/* CSS Variables */
:root {
    --primary: #3C540B;
    --primary-dark: #2a3d08;
    --primary-light: #4a660d;
    --secondary: #81B622;
    --secondary-dark: #6d9a1d;
    --accent: #589819;
    --accent-dark: #457a14;
    --highlight: #ECF87F;
    --highlight-dark: #d9e85c;
    --background: #F4F9E9;
    --background-alt: #E8F3D0;
    --white: #FFFFFF;
    --black: #1A1A1A;
    --gray-900: #2D3748;
    --gray-700: #4A5568;
    --gray-500: #718096;
    --gray-300: #CBD5E0;
    --gray-100: #F7FAFC;
    --text: #333333;
    --text-light: #666666;
    --surface: #FFFFFF;
    --surface-2: #FBFDF6;
    --surface-muted: #EFF6E0;
    --border-soft: rgba(60, 84, 11, 0.08);
    --border-strong: rgba(60, 84, 11, 0.16);
    --input-bg: #FFFFFF;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-width: 1080px;
    --header-height: 64px;
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Mode (hijau gelap modern) */
[data-theme="dark"] {
    color-scheme: dark;
    --primary: #B4D95B;
    --primary-dark: #9dc947;
    --primary-light: #c8e67d;
    --secondary: #AEDB55;
    --secondary-dark: #96c63f;
    --accent: #8FBF3F;
    --accent-dark: #7aa934;
    --highlight: #DDEB7F;
    --highlight-dark: #cfdf66;
    --background: #182215;
    --background-alt: #1e2b19;
    --gray-900: #F2F6EA;
    --gray-700: #D5E0C7;
    --gray-500: #ADBDA0;
    --gray-300: #6B7A5E;
    --gray-100: #2A3824;
    --text: #EDF3E4;
    --text-light: #C4D0B4;
    --surface: #232F1D;
    --surface-2: #27341F;
    --surface-muted: #2E3D26;
    --border-soft: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --input-bg: #1D2818;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Transisi halus saat ganti tema */
body,
.page-header,
.footer,
.navbar,
.navbar-menu,
.dropdown-menu,
input,
textarea,
select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    .skip-link,
    #back-to-top,
    .navbar,
    .footer,
    .btn,
    .sidebar,
    .dashboard-topbar,
    .sidebar-footer,
    .action-buttons,
    .page-header-actions {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .main-content,
    .dashboard-content {
        margin: 0;
        padding: 0;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .spmb-form-container {
        box-shadow: none;
        border: none;
    }
}

/* Focus visible styles */
:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

html {
    scrollbar-width: auto;
    scrollbar-color: var(--accent) var(--gray-100);
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--accent-dark));
    border-radius: 10px;
    border: 1px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-dark), var(--accent));
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h4 { font-size: clamp(1rem, 2vw, 1.2rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    border-radius: 2px;
}

.section-title p {
    max-width: 560px;
    margin: 1rem auto 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Main Content */
.main-content {
    min-height: 60vh;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(88, 152, 25, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 152, 25, 0.4);
}

.btn-secondary {
    background: var(--primary);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-spmb {
    background: linear-gradient(135deg, var(--highlight), var(--highlight-dark));
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(236, 248, 127, 0.4);
    animation: pulse 2s infinite;
}

.btn-spmb:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(236, 248, 127, 0.5);
}

.btn-login {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

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

/* Logo Component */
.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.logo-smk-nav {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-text small {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.navbar.scrolled {
    height: 60px;
    background: linear-gradient(90deg, rgba(42, 61, 8, 0.94), rgba(88, 152, 25, 0.9));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .navbar.scrolled {
    background: linear-gradient(90deg, rgba(42, 58, 34, 0.95), rgba(59, 82, 47, 0.92));
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: none;
    padding-left: 2rem;
    padding-right: 2rem;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-logo .logo-text strong,
.navbar-logo .logo-text small {
    color: var(--white);
}

/* Theme Toggle */
/* Theme Toggle (selalu tampil, pojok kanan bawah) */
.theme-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 999;
    cursor: pointer;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    background: var(--surface-muted);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
}

.theme-toggle .icon-moon { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--primary-light);
}

/* Back to Top (muncul saat scroll) */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .back-to-top {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.14);
}

.nav-link-sm {
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
}

.navbar-nav .nav-item.active .nav-link {
    position: relative;
}

.navbar-nav .nav-item.active > .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    background: var(--highlight);
    border-radius: 2px;
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border-top: 3px solid var(--secondary);
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: var(--surface-muted);
    color: var(--accent);
    padding-left: 1.5rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-actions .btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Hamburger Menu */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

.navbar-toggle.active .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 100px 0 50px;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header::after {
    content: '';
    position: absolute;
    top: -110px;
    right: -60px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(236, 248, 127, 0.28), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-title {
    color: var(--white);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Breadcrumb */
.breadcrumb {
    display: inline-block;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-item a {
    color: var(--highlight);
}

.breadcrumb-item a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    color: var(--white);
    position: relative;
    padding-top: 60px;
}

[data-theme="dark"] .footer {
    background: linear-gradient(180deg, #223019, #2A3A22);
}

.footer-wave {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 40px;
    overflow: hidden;
    line-height: 0;
}

.footer-wave svg {
    width: 100%;
    height: 100%;
    fill: var(--background);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    padding: 2rem 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.footer-logo .logo-text strong,
.footer-logo .logo-text small {
    color: var(--white);
}

.footer-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

.footer-links h4,
.footer-contact h4 {
    color: var(--highlight);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.footer-links ul li,
.footer-contact ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--highlight);
    padding-left: 5px;
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-contact ul li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.footer-credit {
    color: rgba(236, 248, 127, 0.7);
    font-size: 0.75rem;
    font-style: italic;
    margin-bottom: 0;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 4.6s forwards;
    max-width: 350px;
}

.flash-success {
    background: rgba(129, 182, 34, 0.95);
    color: var(--white);
}

.flash-error {
    background: rgba(229, 62, 62, 0.95);
    color: var(--white);
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    overflow: hidden;
    flex-shrink: 0;
}

.navbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.logout-form {
    margin: 0;
}

.logout-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 1.25rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.logout-button:hover {
    background: var(--background);
    color: #e53e3e;
    padding-left: 1.5rem;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

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

/* Keyframes */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Utility Helpers */
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-light); }
.text-sm { font-size: 0.9rem; }
.flex-1 { flex: 1; }
.items-end { align-items: flex-end; }
.no-scroll { overflow: hidden; }
.mb-0 { margin-bottom: 0; }

/* Welcome Page */
.welcome-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 2rem;
    text-align: center;
    color: var(--white);
}

.welcome-page h1 {
    color: var(--white);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 1rem;
}

.welcome-page p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.welcome-page .btn {
    margin: 0.25rem;
}

/* ── Utility classes untuk menggantikan inline style= (strict CSP) ── */

/* Object fit / gambar */
.obj-cover { object-fit: cover; }
.size-18 { width: 18px; height: 18px; }
.size-20 { width: 20px; height: 20px; }
.w-40 { width: 40px; }
.min-w-120 { min-width: 120px; }
.img-avatar-45 { width: 45px; height: 45px; object-fit: cover; border-radius: 50%; }
.img-avatar-150 { max-width: 150px; max-height: 150px; border-radius: 8px; }
.img-avatar-150-circle { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 3px solid var(--primary); }
.thumbnail-200 { max-height: 200px; object-fit: cover; }
.max-h-200 { max-height: 200px; }
.logo-footer { width: 48px; height: auto; }
.beranda-logo { width: 96px; height: auto; display: block; margin: 0 auto; margin-bottom: 8px; }
.qr-preview { max-height: 120px; border: 1px solid #ddd; padding: 5px; }
.kepsek-foto-preview { max-height: 260px; border: 1px solid #ddd; padding: 5px; border-radius: 10px; }

/* Layout flex */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-center-gap5 { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.flex-center-gap12 { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.flex-row-gap10 { margin: 15px 0; display: flex; gap: 10px; align-items: center; }
.flex-row-gap10-wrap { margin: 15px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-mt10 { display: inline; margin-top: 10px; }

/* Spasi */
.mt-20 { margin-top: 20px; }
.mt-2rem { margin-top: 2rem; }
.mt-1-5rem { margin-top: 1.5rem; }
.mt-2-5rem { margin-top: 2.5rem; }
.mt-4rem { margin-top: 4rem; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-1rem { margin-bottom: 1rem; }
.mr-8 { margin-right: 8px; }
.my-20 { margin: 20px 0; }

/* Teks */
.text-0-7 { font-size: 0.7rem; }
.sr-text { font-size: 1px; }

/* Komponen khusus */
.backup-file-input { width: 100px; display: inline-block; height: 30px; padding: 2px 6px; font-size: 0.8rem; }
.pk-header-bar { padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.error-page { padding: 4rem 1rem; text-align: center; }
.error-code { font-size: 4rem; color: var(--primary); margin-bottom: 1rem; }
.error-desc { color: var(--gray-500); margin-bottom: 2rem; }
.err-page { padding: 4rem 1rem; text-align: center; }
.err-code { font-size: 4rem; color: var(--primary); margin-bottom: 1rem; }
.err-mb { margin-bottom: 1rem; }
.err-desc { color: var(--gray-500); margin-bottom: 2rem; }

/* Admin konten website */
.misi-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.misi-row .form-control { flex: 1; }
.mt-10 { margin-top: 0.625rem; }
.mb-10 { margin-bottom: 0.625rem; }
.tree-root { list-style: none; padding: 0; margin: 0; }
.tree-children { list-style: none; margin: 0.5rem 0 0.75rem 1.5rem; padding-left: 1rem; border-left: 2px solid var(--gray-120, #e5e7eb); }
.tree-node { margin-bottom: 0.5rem; }
.tree-node-card { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-120, #e5e7eb); border-radius: 0.5rem; flex-wrap: wrap; }
.tree-node-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tree-jabatan { font-weight: 600; }
.tree-nama { color: var(--gray-500, #6b7280); font-size: 0.85rem; }
.tree-actions { display: flex; align-items: center; gap: 0.35rem; }
.tree-badge { display: inline-block; padding: 0.1rem 0.5rem; font-size: 0.7rem; border-radius: 999px; background: var(--gray-120, #e5e7eb); color: var(--gray-600, #4b5563); }
.tree-slot-badge { display: inline-block; padding: 0.1rem 0.5rem; font-size: 0.7rem; border-radius: 999px; background: #dcfce7; color: #15803d; font-weight: 600; }
.ikon-badge { font-size: 1.25rem; line-height: 1; white-space: nowrap; }
.thumb-list { width: 120px; font-size: 0.85rem; }
.cell-nowrap { white-space: nowrap; }

/* Galeri foto eskul (admin) */
.foto-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.foto-list:empty { display: none; }
.foto-row { display: flex; align-items: center; gap: 0.5rem; }
.foto-row-inputs { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.foto-item { display: flex; align-items: center; gap: 0.9rem; padding: 0.6rem; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-120, #e5e7eb); border-radius: 0.5rem; }
.foto-item-img { width: 90px; height: 65px; object-fit: cover; border-radius: 0.375rem; border: 1px solid var(--gray-120, #e5e7eb); }
.foto-item-info { display: flex; flex-direction: column; gap: 0.3rem; }
.foto-item-keterangan { font-size: 0.85rem; color: var(--gray-600, #4b5563); }
.foto-item-hapus { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--red-600, #dc2626); cursor: pointer; }

/* Empty state full width (di dalam grid publik) */
.empty-state-wide { grid-column: 1 / -1; }

/* ── Dark mode: penyesuaian komponen ── */
[data-theme="dark"] .navbar-user-avatar {
    color: var(--black);
}

[data-theme="dark"] .logo-icon {
    color: var(--black);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover {
    color: var(--black);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .btn-secondary {
    background: var(--primary-light);
    color: var(--black);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--primary);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(90deg, #2A3A22, #3B522F);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .navbar-menu {
    background: #2A3A22;
}

[data-theme="dark"] .btn-spmb {
    color: #2a3d08;
}

[data-theme="dark"] .section-title h2 {
    color: var(--primary-light);
}

[data-theme="dark"] .breadcrumb-item a {
    color: var(--highlight);
}

[data-theme="dark"] input.form-control,
[data-theme="dark"] select.form-control,
[data-theme="dark"] textarea.form-control {
    background: var(--input-bg);
    border-color: var(--border-strong);
    color: var(--text);
}

[data-theme="dark"] ::placeholder {
    color: var(--gray-500);
}

[data-theme="dark"] .footer-wave svg {
    fill: var(--background);
}

/* Ikon kartu pada latar hijau muda agar tetap kontras di dark */
[data-theme="dark"] .prestasi-trophy {
    color: #3C540B;
}

[data-theme="dark"] .statistik-icon {
    background: rgba(255, 255, 255, 0.14);
    color: var(--highlight);
}

[data-theme="dark"] .kontak-icon,
[data-theme="dark"] .jurusan-card-image {
    color: var(--black);
}

[data-theme="dark"] .pengumuman {
    background: linear-gradient(135deg, var(--highlight-dark), var(--highlight));
}

[data-theme="dark"] .pengumuman-text h2,
[data-theme="dark"] .pengumuman-text p {
    color: #2a3d08;
}

[data-theme="dark"] .statistik {
    background: linear-gradient(135deg, #3d5a24, #5a7c2e);
}

[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, #3d5a24, #4a6a28);
}
