@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Modern Premium Palette */
    --bg: #f3f4f6; /* Soft gray background */
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #e2e8f0;
    
    --text-dark: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    
    /* Gradients & Primary Colors */
    --primary: #4f46e5;      /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-soft: #e0e7ff;
    
    --secondary: #10b981;    /* Emerald 500 */
    --secondary-hover: #059669;
    
    --line: #e2e8f0;
    
    --green: #10b981;
    --green-soft: #d1fae5;
    --yellow: #f59e0b;
    --yellow-soft: #fef3c7;
    --red: #ef4444;
    --red-soft: #fee2e2;
    
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 15px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 25px rgba(79, 70, 229, 0.15);
    
    --glass: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(12px);
}

* { box-sizing: border-box; }

html { 
    background: var(--bg); 
}

body {
    margin: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; }

/* Filter Buttons */
.filter-btn {
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--surface-3);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-soft);
    color: var(--primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Glassmorphism Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 64px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--glass);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
}

.brand-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.brand-mark::before { content: "P"; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.app-eyebrow { display: block; }
.app-subtitle { display: block; }
.topbar h1 { display: none; }

/* Main Container */
.container { 
    width: 95%; 
    max-width: 900px; 
    margin: 0 auto; 
    padding: 24px 16px 100px; 
}

/* Glassmorphism Bottom Nav */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around;
    background: var(--glass);
    border-top: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
}
.bottom-nav a {
    flex: 1;
    padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--muted); font-size: 12px; font-weight: 600;
    transition: all 0.3s;
}
.bottom-nav a:hover, .bottom-nav a.active {
    color: var(--primary);
}
.bottom-nav svg { width: 22px; height: 22px; fill: currentColor; transition: transform 0.3s; }
.bottom-nav a:hover svg, .bottom-nav a.active svg {
    transform: translateY(-2px);
}

/* Premium Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 30px;
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
/* Subtle decorative circles in hero */
.hero::before, .hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.hero::before { width: 200px; height: 200px; top: -50px; left: -50px; }
.hero::after { width: 300px; height: 300px; bottom: -100px; right: -50px; }

.hero-stats {
    display: flex; gap: 16px; justify-content: center; margin-top: 20px;
    position: relative; z-index: 2; flex-wrap: wrap;
}
.hero-stat { text-align: center; flex: 1; min-width: 90px; }
.hero-stat .val { font-size: 28px; font-weight: 800; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.hero-stat .lbl { font-size: 11px; font-weight: 600; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 8px;}

/* Custom Progress Bar in Hero */
.progress {
    height: 12px; background: rgba(0,0,0,0.2); border-radius: 100px;
    overflow: hidden; margin: 25px auto 10px; width: 100%; max-width: 500px;
    position: relative; z-index: 2;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.progress-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar.red { background: #fb7185; }
.progress-bar.yellow { background: #fcd34d; }
.progress-bar.green { background: #34d399; }
.progress-bar.blue { background: #38bdf8; }

.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 25px; position: relative; z-index: 2; }

/* Floating Cards / Panels */
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s, box-shadow 0.3s;
}
.panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.section-title { margin: 0 0 20px 0; font-size: 18px; font-weight: 700; color: var(--text-dark); }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* Modernized Tables */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th {
    text-align: left; padding: 14px 12px;
    border-bottom: 2px solid var(--line);
    color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
}
td {
    padding: 16px 12px; border-bottom: 1px solid var(--line);
    vertical-align: middle; transition: background 0.2s;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* Bolder text for numbers */
td strong { color: var(--text-dark); font-weight: 700; font-size: 15px; }

/* Inputs & Forms */
.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text-dark); }
.input {
    width: 100%; padding: 12px 16px;
    background: var(--surface-2); border: 1px solid var(--surface-3);
    border-radius: var(--radius-sm); font-size: 15px;
    transition: all 0.2s; outline: none;
    color: var(--text-dark); font-weight: 500;
}
.input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled { background: var(--surface-3); opacity: 0.7; }

.input-row { display: flex; gap: 12px; }
.input-row > div { flex: 1; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; text-align: center;
    border: 1px solid transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { 
    background: var(--primary); color: #fff; 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35); }

.btn-success { 
    background: var(--secondary); color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { background: var(--secondary-hover); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35); }

.btn-light { background: var(--surface-2); color: var(--text-dark); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-light:hover { background: var(--surface-3); border-color: var(--muted-2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; gap: 4px; }

.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--muted-2); }

.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 700;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-red { background: var(--red-soft); color: var(--red); }
.status-neutral { background: var(--surface-3); color: var(--muted); }
.status-danger { background: var(--red-soft); color: var(--red); }
.status-warn { background: var(--yellow-soft); color: var(--yellow); }
.status-ok { background: var(--green-soft); color: var(--green); }
.status-info { background: var(--primary-soft); color: var(--primary); }

/* Quick Action Row */
.action-row { display: flex; gap: 8px; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Responsive Adjustments */
@media(max-width: 480px){
    .container { padding-left: 12px; padding-right: 12px; }
    .hero { padding: 24px 16px; }
    .hero-stats { gap: 16px; }
    .hero-stat .val { font-size: 26px; }
    th, td { padding: 12px 8px; font-size: 13px; }
}

/* Search bar modern styling */
.search-wrapper { position: relative; margin-bottom: 20px; }
.search-wrapper input { padding-left: 40px; border-radius: 100px; }
.search-wrapper::before {
    content: "🔍";
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: var(--muted);
    pointer-events: none;
}

/* Grid Stats & Hero Card mappings */
.hero-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 20px; /* Dikurangi agar tidak kebesaran */
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 20px; /* Dikurangi */
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05);
    width: 200px; height: 200px; top: -50px; left: -50px;
}
.hero-card::after {
    content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05);
    width: 300px; height: 300px; bottom: -100px; right: -50px;
}
.hero-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 4px; position:relative; z-index:2; }
.hero-title { font-size: 24px; font-weight: 800; margin: 0 0 6px 0; position:relative; z-index:2; text-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.hero-text { font-size: 13px; opacity: 0.9; margin: 0; position:relative; z-index:2; }

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Mengecilkan ukuran kartu stat */
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm); /* Flatten */
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary-soft); color: var(--primary);
    display: grid; place-items: center; font-size: 16px;
    margin-bottom: 8px;
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-value { font-size: 20px; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: 4px; }
.stat-note { font-size: 11px; font-weight: 500; color: var(--muted-2); }

/* Rekap Compact View */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.rekap-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rekap-card { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; } /* Flatten: removed border/radius/shadow */
.rekap-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--primary); font-size: 14px; }
.rekap-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.rekap-note { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.rekap-value { text-align: right; font-weight: 800; font-size: 16px; color: var(--text-dark); }
.rekap-sub { font-size: 11px; font-weight: 600; color: var(--primary); }

/* Rombongan Input Cards */
.card-list { display: flex; flex-direction: column; gap: 16px; }
.rombongan-card { background: var(--surface); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); } /* Flattened */

.rombongan-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
.rombongan-identity { display: flex; gap: 12px; align-items: center; }
.rombongan-no { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.rombongan-title { font-size: 15px; font-weight: 700; color: var(--text-dark); margin: 0 0 2px 0; }
.rombongan-lokasi { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.rombongan-lokasi::before { content: "📍"; font-size: 11px; }

/* Flattened Presensi Summary */
.presensi-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; margin-bottom: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mini-box { text-align: center; border-right: 1px solid var(--line); }
.mini-box:last-child { border-right: none; }
.mini-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.mini-value { font-size: 16px; font-weight: 800; color: var(--text-dark); }

/* Custom Inputs */
.number-row { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px; border: 1px solid var(--line); }
.qty-btn { width: 32px; height: 32px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 16px; font-weight: 600; color: var(--text); display: grid; place-items: center; }
.number-input { width: 44px; height: 32px; padding: 0; text-align: center; background: transparent; border: none; font-size: 14px; font-weight: 700; color: var(--text-dark); -moz-appearance: textfield; }
.number-input::-webkit-outer-spin-button, .number-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.number-input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--primary-soft); }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); }

/* Quick Action Row fixes */
.action-row { display: flex; gap: 8px; }
.action-row > * { flex: 1; } /* Membuat tombol dalam satu baris sejajar */
.btn-full { width: 100%; }

/* Hero Buttons (High Contrast for Gradient Background) */
.hero-btn-primary { background: #ffffff; color: var(--primary) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.hero-btn-primary:hover { background: #f8fafc; color: var(--primary-hover) !important; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.hero-btn-secondary { background: rgba(255,255,255,0.15); color: #ffffff !important; border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-btn-secondary:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }

/* Mobile optimization */
@media(max-width: 480px){
    .container { padding-left: 12px; padding-right: 12px; padding-bottom: 100px; }
    .hero-title { font-size: 20px; }
    .hero-card { padding: 16px; margin-bottom: 16px; }
    .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .rekap-compact { grid-template-columns: 1fr; }
    .rombongan-head { flex-direction: column; align-items: flex-start; }
    .presensi-summary { gap: 4px; padding: 8px 0; }
    .mini-value { font-size: 14px; }
    .qty-btn { width: 36px; height: 36px; }
    .number-input { height: 36px; width: 50px; }
}

