/* =====================================================
   SIMUTU — Sistem Informasi Penjaminan Mutu Internal
   Modern App-Launcher Theme
   ===================================================== */

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #4cc9f0;
    --accent: #f72585;
    --success: #2ec4b6;
    --warning: #ffb703;
    --danger: #e63946;
    --dark: #14213d;
    --light: #f8f9fc;
    --gray: #6c757d;
    --white: #ffffff;
    --radius: 14px;
    --shadow-sm: 0 2px 8px rgba(20, 33, 61, 0.06);
    --shadow-md: 0 8px 24px rgba(20, 33, 61, 0.10);
    --shadow-lg: 0 16px 40px rgba(20, 33, 61, 0.16);
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
::-webkit-scrollbar-track { background: var(--light); }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, .35); }
    50% { box-shadow: 0 0 0 14px rgba(67, 97, 238, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInRight { from { opacity:0; transform: translateX(40px);} to {opacity:1; transform:translateX(0);} }
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.aos { opacity: 0; }
.aos.in { animation: fadeInUp .7s ease forwards; }
.aos-fade.in { animation: fadeIn .8s ease forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .25s; }
.delay-3 { animation-delay: .4s; }
.delay-4 { animation-delay: .55s; }

/* ===================== NAVBAR ===================== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 6%;
    transition: var(--transition);
    background: rgba(255,255,255,0.0);
}
.navbar.scrolled {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 12px 6%;
}
.navbar .logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.4rem; color: var(--primary-dark);
}
.navbar .logo i { font-size: 1.6rem; color: var(--accent); }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
    font-weight: 500; color: var(--dark); position: relative; padding: 4px 0;
    transition: var(--transition);
}
.nav-links a::after {
    content:''; position:absolute; left:0; bottom:-4px; width:0; height:2px;
    background: var(--primary); transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 28px; border: none; border-radius: 50px;
    font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: var(--transition);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 6px 18px rgba(67,97,238,.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(67,97,238,.45); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-block { width: 100%; }
.btn:active { transform: scale(.97); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; z-index: 1100; }
.hamburger span { width: 26px; height: 3px; background: var(--dark); border-radius: 2px; transition: var(--transition); }

/* ===================== HERO ===================== */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: space-between;
    padding: 120px 6% 60px;
    background: linear-gradient(-45deg, #eef2ff, #e0f7fa, #fdf2f8, #eef2ff);
    background-size: 400% 400%;
    animation: gradientMove 16s ease infinite;
    gap: 40px; flex-wrap: wrap;
    position: relative; overflow: hidden;
}
.hero-content { flex: 1 1 480px; max-width: 600px; z-index: 2; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--white); padding: 8px 18px; border-radius: 50px;
    font-size: .85rem; font-weight: 600; color: var(--primary);
    box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-badge i { color: var(--accent); }
.hero h1 { font-size: 3rem; line-height: 1.2; font-weight: 800; margin-bottom: 20px; color: var(--dark); }
.hero h1 span { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.1rem; color: var(--gray); margin-bottom: 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats div h3 { font-size: 1.8rem; color: var(--primary-dark); font-weight: 800; }
.hero-stats div p { color: var(--gray); font-size: .9rem; }

.hero-visual { flex: 1 1 420px; position: relative; min-height: 380px; z-index: 2; }
.hero-visual .float-card {
    position: absolute; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 16px 20px; display: flex; gap: 12px; align-items: center;
    animation: floatY 5s ease-in-out infinite;
}
.hero-visual .card-1 { top: 10%; left: 5%; animation-delay: 0s; }
.hero-visual .card-2 { top: 45%; right: 0; animation-delay: 1.2s; }
.hero-visual .card-3 { bottom: 5%; left: 15%; animation-delay: 2.4s; }
.hero-visual .float-card i { font-size: 1.6rem; color: var(--primary); background: #eef1ff; padding: 12px; border-radius: 12px; }
.hero-visual .float-card strong { display:block; font-size: .95rem; }
.hero-visual .float-card span { font-size: .78rem; color: var(--gray); }
.hero-visual .main-illustration {
    width: 100%; height: 100%; min-height: 380px; border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
}
.hero-visual .main-illustration i { font-size: 8rem; color: rgba(255,255,255,.9); animation: floatY 6s ease-in-out infinite; }

/* ===================== SECTIONS ===================== */
.section { padding: 100px 6%; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 60px; }
.section-head .tag {
    color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: 1.5px;
}
.section-head h2 { font-size: 2.2rem; font-weight: 800; margin: 12px 0 14px; }
.section-head p { color: var(--gray); font-size: 1.05rem; }

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px;
}
.feature-card {
    background: var(--white); border-radius: var(--radius); padding: 32px 26px;
    box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid transparent;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: rgba(67,97,238,.2); }
.feature-icon {
    width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); font-size: 1.5rem;
    margin-bottom: 20px; transition: var(--transition);
}
.feature-card:hover .feature-icon { transform: rotate(-8deg) scale(1.08); }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.feature-card p { color: var(--gray); font-size: .95rem; line-height: 1.6; }

.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 30px; counter-reset: step; }
.how-step { text-align: center; position: relative; padding: 20px; }
.how-step .num {
    width: 52px; height: 52px; border-radius: 50%; background: var(--dark); color: var(--white);
    display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 18px;
    font-size: 1.2rem;
}
.how-step h4 { margin-bottom: 8px; }
.how-step p { color: var(--gray); font-size: .9rem; }

.cta-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 28px; padding: 70px 6%; text-align: center; color: var(--white);
    margin: 0 6% 100px; position: relative; overflow: hidden;
}
.cta-banner h2 { font-size: 2rem; margin-bottom: 14px; font-weight: 800; }
.cta-banner p { opacity: .9; margin-bottom: 30px; }
.cta-banner .btn-primary { background: var(--white); color: var(--primary-dark); box-shadow: none; }
.cta-banner .btn-primary:hover { background: #eef1ff; }

footer {
    background: var(--dark); color: rgba(255,255,255,.75); padding: 60px 6% 24px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { color: var(--white); margin-bottom: 16px; }
.footer-grid .logo { color: var(--white); font-weight: 700; font-size: 1.3rem; margin-bottom: 12px; display:flex; align-items:center; gap:8px;}
.footer-grid li { margin-bottom: 10px; }
.footer-grid a:hover { color: var(--secondary); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }

/* ===================== MODAL (LOGIN & CRUD) — Full Responsive ===================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,33,61,.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
    opacity: 0; visibility: hidden; transition: var(--transition); padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
body.modal-open { overflow: hidden; }

.modal-box {
    background: var(--white); border-radius: 20px; width: 420px; max-width: 100%;
    max-height: min(88vh, 760px); display: flex; flex-direction: column; overflow: hidden;
    position: relative; box-shadow: var(--shadow-lg);
    transform: translateY(40px) scale(.96); opacity: 0; transition: var(--transition);
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); opacity: 1; }
.modal-box > .modal-icon,
.modal-box > h2,
.modal-box > .sub,
.modal-box > form { padding-left: 34px; padding-right: 34px; }
.modal-box > .modal-icon { margin-top: 40px; }
.modal-box > form { padding-bottom: 40px; overflow-y: auto; }

.modal-close {
    position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
    background: var(--light); display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: var(--transition); border: none; font-size: 1rem; flex-shrink: 0; z-index: 2;
}
.modal-close:hover { background: var(--danger); color: var(--white); transform: rotate(90deg); }
.modal-box .modal-icon {
    width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 1.8rem; margin-bottom: 18px;
}
.modal-box h2 { font-size: 1.5rem; margin-bottom: 6px; }
.modal-box .sub { color: var(--gray); font-size: .9rem; margin-bottom: 26px; }

.form-group { margin-bottom: 18px; position: relative; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--dark); }
.input-wrap { position: relative; }
.input-wrap i.field-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray); font-size: .95rem;
}
.form-control {
    width: 100%; padding: 12px 14px; border: 1.5px solid #e4e7ee; border-radius: 10px;
    font-size: 16px; font-family: inherit; transition: var(--transition); background: var(--light); color: var(--dark);
}
.input-wrap .form-control { padding-left: 40px; }
.form-control:focus { outline: none; border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 4px rgba(67,97,238,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--gray); margin-top: 5px; }
.toggle-pass { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--gray); }
.form-check { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: .85rem; }
.form-check a { color: var(--primary); font-weight: 600; }
.form-msg { padding: 10px 14px; border-radius: 10px; font-size: .85rem; margin-bottom: 16px; display: none; align-items:center; gap:8px; }
.form-msg.error { background: #fde8e8; color: var(--danger); }
.form-msg.success { background: #e3fbf8; color: var(--success); }
.form-msg.show { display: flex; animation: fadeIn .3s ease; }

.spinner {
    width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite; display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { display: none; }

/* ===================== DASHBOARD LAYOUT (APP LAUNCHER) ===================== */
.app-wrapper { min-height: 100vh; }

.app-topbar {
    display: flex; align-items: center; justify-content: space-between; background: var(--dark);
    color: var(--white); padding: 0 24px; height: 64px; box-shadow: var(--shadow-sm);
    position: fixed; top: 0; left: 0; right: 0; z-index: 1200;
}
.topbar-left { display: flex; align-items: center; gap: 18px; }
.launcher-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.08);
    color: var(--white); font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.launcher-btn:hover { background: rgba(255,255,255,.18); transform: rotate(90deg); }
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--white); }
.topbar-brand i { color: var(--secondary); font-size: 1.3rem; }
.topbar-pagetitle { border-left: 1px solid rgba(255,255,255,.15); padding-left: 18px; margin-left: 4px; display: none; }
.topbar-pagetitle .page-title { font-weight: 600; font-size: .95rem; }
.topbar-pagetitle .breadcrumb { font-size: .74rem; color: #a7afc2; }
@media (min-width: 640px) { .topbar-pagetitle { display: block; } }

.topbar-right { display: flex; align-items: center; gap: 20px; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.user-chip .name, .user-chip .role { color: var(--white); }
.user-chip .role { color: #a7afc2 !important; }

/* ===== App Launcher Panel (grid ala Google Apps / Odoo) ===== */
.launcher-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,33,61,.35); backdrop-filter: blur(2px); z-index: 1250; }
.launcher-backdrop.active { display: block; }
.launcher-panel {
    position: fixed; top: 64px; left: 24px; width: 380px; max-width: calc(100vw - 32px); max-height: min(70vh, 620px);
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 1300;
    opacity: 0; visibility: hidden; transform: translateY(-12px); transition: var(--transition);
    display: flex; flex-direction: column; overflow: hidden;
}
.launcher-panel.active { opacity: 1; visibility: visible; transform: translateY(0); }
.launcher-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #eef0f5; color: var(--gray); }
.launcher-search input { border: none; outline: none; flex: 1; font-size: .92rem; font-family: inherit; }
.launcher-body { overflow-y: auto; padding: 8px 16px 18px; }
.launcher-group { margin-top: 14px; }
.launcher-group-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); font-weight: 700; margin-bottom: 10px; }
.launcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.launcher-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 12px 6px;
    border-radius: 12px; transition: var(--transition); color: var(--dark);
}
.launcher-tile:hover { background: var(--light); transform: translateY(-2px); }
.launcher-tile.active { background: #eef1ff; }
.launcher-tile span { font-size: .74rem; font-weight: 600; line-height: 1.25; }
.launcher-icon {
    width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    color: var(--white); font-size: 1.15rem; box-shadow: var(--shadow-sm);
}

.main-content { margin-left: 0; margin-top: 64px; min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.topbar .menu-toggle { display: none; }
.user-chip img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.user-chip .name { font-size: .88rem; font-weight: 600; }
.user-chip .role { font-size: .72rem; color: var(--gray); }
.user-dropdown {
    position: absolute; top: 52px; right: 0; background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg);
    width: 200px; padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: var(--transition);
}
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: .87rem; color: var(--dark); }
.user-dropdown a:hover { background: var(--light); }

.page-body { padding: 28px; flex: 1; }
.overlay-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1100; }
.overlay-backdrop.active { display: block; }

/* Cards / Stats */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-bottom: 28px; }
.stat-card {
    background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 16px; transition: var(--transition); border-left: 4px solid var(--primary);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card .icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--white); }
.stat-card h3 { font-size: 1.5rem; font-weight: 800; }
.stat-card p { color: var(--gray); font-size: .82rem; }
.bg-blue { background: linear-gradient(135deg,#4361ee,#3a0ca3); }
.bg-green { background: linear-gradient(135deg,#2ec4b6,#0aa89c); }
.bg-orange { background: linear-gradient(135deg,#ffb703,#fb8500); }
.bg-pink { background: linear-gradient(135deg,#f72585,#b5179e); }

.card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 24px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.card-header h3 { font-size: 1.05rem; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid #eef0f5; border-radius: 14px; -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: #dfe3ee; border-radius: 10px; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data-table th { text-align: left; padding: 12px 14px; background: var(--light); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--gray); white-space: nowrap; }
table.data-table td { padding: 13px 14px; border-bottom: 1px solid #eef0f5; font-size: .88rem; vertical-align: middle; }
table.data-table tr { transition: var(--transition); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #f7f9ff; }
.badge { padding: 5px 12px; border-radius: 50px; font-size: .74rem; font-weight: 600; display: inline-block; }
.badge-success { background: #e3fbf8; color: var(--success); }
.badge-danger { background: #fde8e8; color: var(--danger); }
.badge-info { background: #e7f1ff; color: var(--primary); }
.badge-warning { background: #fff6e0; color: #ad7c00; }

.action-btns { display: flex; gap: 8px; }
.icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); font-size: .85rem;
}
.icon-btn.edit { background: #e7f1ff; color: var(--primary); }
.icon-btn.delete { background: #fde8e8; color: var(--danger); }
.icon-btn:hover { transform: scale(1.12); }

.search-box { position: relative; }
.search-box input { padding: 10px 14px 10px 38px; border-radius: 10px; border: 1.5px solid #e4e7ee; font-size: .87rem; width: 240px; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray); }

/* ===================== FILTER TOOLBAR (dipakai semua CRUD) ===================== */
.filter-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-toolbar select.form-control {
    width: auto; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #e4e7ee;
    font-size: .85rem; background: var(--light); font-family: inherit;
}
.filter-toolbar select.form-control:focus { outline: none; border-color: var(--primary); }

/* ===================== SORTABLE TABLE HEADERS ===================== */
table.data-table th[data-sort] { position: relative; padding-right: 24px; user-select: none; }
table.data-table th[data-sort]:hover { color: var(--primary); }
table.data-table th[data-sort]::after {
    content: '\f0dc'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; right: 8px;
    top: 50%; transform: translateY(-50%); font-size: .68rem; color: #c3c8d6;
}
table.data-table th[data-sort].sort-asc::after { content: '\f0de'; color: var(--primary); }
table.data-table th[data-sort].sort-desc::after { content: '\f0dd'; color: var(--primary); }

/* ===================== PAGINATION ===================== */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.pagination-info { font-size: .82rem; color: var(--gray); }
.pagination-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn {
    min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1.5px solid #e4e7ee; background: var(--white);
    color: var(--dark); font-size: .82rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.page-btn:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }
.page-dots { color: var(--gray); padding: 0 4px; }
.per-page-select {
    padding: 8px 10px; border-radius: 8px; border: 1.5px solid #e4e7ee; font-size: .82rem; font-family: inherit; background: var(--white);
}

/* Avatar table */
.table-user { display: flex; align-items: center; gap: 10px; }
.table-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Forms in dashboard */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; margin-bottom: 4px; }
.profile-photo-wrap { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.profile-photo-wrap img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }

/* Permission Matrix */
.matrix-table th, .matrix-table td { text-align: center; }
.matrix-table td:first-child, .matrix-table th:first-child { text-align: left; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #ccd2e0; border-radius: 34px; transition: var(--transition); }
.slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: var(--transition); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Toast Notification */
#toastContainer { position: fixed; top: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 12px; }
.toast {
    background: var(--white); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 14px 18px;
    display: flex; align-items: center; gap: 12px; min-width: 280px; border-left: 4px solid var(--success);
    animation: slideInRight .35s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { font-size: 1.2rem; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast .msg { font-size: .87rem; font-weight: 500; }

/* ===================== CRUD MODAL (Tambah/Edit) — header sticky + body scroll + footer sticky ===================== */
.crud-modal .modal-box { width: 560px; max-width: 100%; text-align: left; padding: 0; }

.crud-modal .modal-header {
    display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid #eef0f5;
    flex-shrink: 0;
}
.crud-modal .modal-header .modal-icon {
    width: 44px; height: 44px; border-radius: 12px; margin-bottom: 0; font-size: 1.15rem; flex-shrink: 0;
}
.crud-modal .modal-header h2 { flex: 1; font-size: 1.15rem; margin: 0; }
.crud-modal .modal-close { position: static; }

.crud-modal .modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.crud-modal .modal-body::-webkit-scrollbar { width: 6px; }
.crud-modal .modal-body::-webkit-scrollbar-thumb { background: #dfe3ee; border-radius: 10px; }

.crud-modal .modal-footer {
    display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    padding: 16px 24px; border-top: 1px solid #eef0f5; flex-shrink: 0; background: var(--white);
}
.crud-modal .modal-footer .btn { min-width: 130px; }
.crud-modal .modal-footer .btn-outline {
    background: var(--white); color: var(--gray); border: 1.5px solid #e4e7ee; min-width: auto; padding: 12px 20px;
}
.crud-modal .modal-footer .btn-outline:hover { border-color: var(--danger); color: var(--danger); }
.crud-modal form { margin: 0; }
.crud-modal .form-msg { margin: 0 24px 0; }
.crud-modal .modal-body .form-msg { margin: 0 0 16px; }

.loading-overlay {
    display: none; position: fixed; inset: 0; background: rgba(255,255,255,.7); z-index: 4000;
    align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner { display: block; width: 44px; height: 44px; border-width: 4px; border-color: rgba(67,97,238,.25); border-top-color: var(--primary); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--gray); }
.empty-state i { font-size: 3rem; margin-bottom: 14px; color: #d7dceb; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 992px) {
    .launcher-panel { left: 12px; right: 12px; width: auto; }
    .footer-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
    .launcher-grid { grid-template-columns: repeat(2, 1fr); }
    .app-topbar { padding: 0 14px; }
}
@media (max-width: 768px) {
    .nav-links { position: fixed; top: 0; right: -100%; width: 75%; height: 100vh; background: var(--white); flex-direction: column; justify-content: center; gap: 30px; transition: var(--transition); box-shadow: var(--shadow-lg); }
    .nav-links.active { right: 0; }
    .hamburger { display: flex; }
    .hero { flex-direction: column; text-align: center; padding-top: 140px; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero h1 { font-size: 2.2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .section { padding: 70px 6%; }
}
@media (max-width: 480px) {
    .modal-box { padding: 30px 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-check { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stat-cards { grid-template-columns: 1fr; }
}

/* ===== Modal full responsive: mode bottom-sheet di layar kecil ===== */
@media (max-width: 576px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box {
        width: 100%; max-width: 100%; max-height: 94vh; max-height: 94dvh;
        border-radius: 22px 22px 0 0; transform: translateY(100%);
    }
    .modal-overlay.active .modal-box { transform: translateY(0); }
    .modal-box > .modal-icon, .modal-box > h2, .modal-box > .sub, .modal-box > form { padding-left: 22px; padding-right: 22px; }
    .modal-box > .modal-icon { margin-top: 26px; }
    .crud-modal .modal-header { padding: 16px 18px; }
    .crud-modal .modal-body { padding: 16px 18px; }
    .crud-modal .modal-footer { padding: 12px 18px 18px; flex-direction: column-reverse; }
    .crud-modal .modal-footer .btn { width: 100%; min-width: 0; }
    /* handle bar kecil di atas modal, memberi kesan "bisa ditarik" ala bottom-sheet native */
    .crud-modal .modal-box::before {
        content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
        width: 40px; height: 4px; border-radius: 4px; background: #e2e5ee;
    }
}

/* ===================================================================
   TABEL FULL RESPONSIVE — mode kartu di layar tablet/HP
   Setiap <tr> berubah jadi kartu; setiap <td> menampilkan label kolom
   (dari atribut data-label) di sisi kiri agar tetap mudah dibaca tanpa
   perlu scroll ke samping.
   =================================================================== */
@media (max-width: 768px) {
    .card-header { align-items: stretch; }
    .card-header h3 { margin-bottom: 2px; }
    .card-header > .form-group { flex: 1 1 100%; min-width: 0 !important; }
    .filter-toolbar { width: 100%; }
    .filter-toolbar .search-box { flex: 1 1 100%; }
    .filter-toolbar .search-box input { width: 100%; }
    .filter-toolbar select.form-control { flex: 1 1 calc(50% - 5px); min-width: 0; }
    .filter-toolbar > .btn { width: 100%; }

    .table-wrap { overflow-x: visible; border: none; }
    table.data-table { min-width: 0; }
    table.data-table thead { display: none; }
    table.data-table, table.data-table tbody, table.data-table tr, table.data-table td { display: block; width: 100%; }
    table.data-table tbody tr {
        margin-bottom: 14px; border: 1px solid #eef0f5; border-radius: 14px; overflow: hidden;
        box-shadow: var(--shadow-sm); background: var(--white);
    }
    table.data-table tbody tr:hover { background: var(--white); }
    table.data-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        text-align: right; padding: 11px 14px; border-bottom: 1px dashed #eef0f5;
    }
    table.data-table td:last-child { border-bottom: none; }
    table.data-table td::before {
        content: attr(data-label); font-weight: 700; color: var(--gray); font-size: .7rem;
        text-transform: uppercase; letter-spacing: .5px; text-align: left; flex-shrink: 0;
    }
    table.data-table td:not([data-label])::before { content: none; }
    table.data-table td.empty-state {
        display: block; text-align: center; justify-content: center;
    }
    table.data-table td.empty-state::before { content: none; }
    table.data-table td .table-user { justify-content: flex-end; text-align: right; }
    table.data-table td .table-user div { text-align: right; }
    table.data-table .action-btns { justify-content: flex-end; }

    .pagination-bar { flex-direction: column; align-items: stretch; gap: 14px; }
    .pagination-bar > div { justify-content: space-between; }
    .pagination-controls { justify-content: center; flex: 1; }
}
