/* ==========================================================================
   1. ROOT VARIABLES (Color Settings & Theme - Flat UI Accent Palette)
   ========================================================================== */
:root {
    /* Main Flat UI Color Palette */
    --green-main: #1abc9c;
    --blue-main: #3498db;
    --red-main: #e74c3c;
    --yellow-main: #f1c40f;
    --orange-main: #f39c12;
    --purple-main: #9b59b6;

    /* Semantic Mapping & States (Warna Utama: Green UI #1abc9c) */
    --primary: var(--green-main);         /* Hijau Toska Utama */
    --primary-hover: #16a085;             /* Versi lebih gelap untuk efek hover */
    --primary-light: #e8f8f5;             /* Latar belakang hijau muda (Paid Badge/Alert) */
    --primary-border: #d1fae5;            /* Garis pembatas komponen hijau */
    --primary-dark: #117a65;              /* Teks hijau kontras gelap */

    /* Neutral Colors (Light Mode Dashboard) */
    --background: #f8fafc;                /* Slate 50 (Background dasar aplikasi) */
    --surface: #ffffff;                   /* Putih murni (Card & Panel Utama) */
    --border: #e2e8f0;                    /* Slate 200 (Garis pembatas komponen) */
    --border-light: #f1f5f9;              /* Slate 100 (Garis antar baris tabel) */
    
    /* Text Typography Colors */
    --text-main: #334155;                 /* Slate 700 (Teks konten deskripsi) */
    --text-dark: #0f172a;                 /* Slate 900 (Judul tebal & teks utama) */
    --text-muted: #94a3b8;                /* Slate 400 (Teks sub-info/redup) */
    --text-input: #475569;                /* Slate 600 (Warna label formulir) */

    /* Accent & Semantic Status Mapping */
    --amber-bg: #fef9c3;                  /* Yellow/Amber 100 (Pending Badge) */
    --amber-text: #a16207;                /* Yellow/Amber 800 (Teks Pending) */
}

/* ==========================================================================
   2. RESET & BASE LAYOUT SETTINGS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Layout Settings dengan CSS Grid Global */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Konfigurasi Grid Panel Kiri & Konten Kanan */
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100dvh;
}

/* Atribut khusus: [pad] untuk memberikan default padding otomatis pada tag */
[pad] {
    padding: 1.5rem !important;
}

/* Kontainer Utama Sisi Kanan (Konten) */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    width: 100%; /* Memastikan lebar penuh 100% */
}

/* Area Konten Dinamis di bawah Header */
.content-body {
    flex: 1;
}

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.h-screen { height: 100vh; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* ==========================================================================
   3. GLOBAL TYPOGRAPHY (h1 - h4, p, font utils)
   ========================================================================== */
h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
}

h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

p {
    font-size: 0.875rem;
    color: var(--text-main);
    line-height: 1.6;
}

.font-semibold { font-weight: 600; }
.font-mono { 
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; 
    font-size: 0.75rem; 
}
.text-dark { color: var(--text-dark); }
.text-muted { color: var(--text-muted); }

/* ==========================================================================
   4. GLOBAL FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-input);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--background);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
}

.form-control:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ==========================================================================
   5. GLOBAL BUTTONS (Direct Tag Styles & Attributes)
   ========================================================================== */
button {
    width: 100%;
    background-color: var(--primary);
    color: #ffffff;
    font-family: inherit;
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.15); /* Bayangan disesuaikan ke komponen hijau toska */
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Efek Hover Default (Green UI) */
button:hover {
    background-color: var(--primary-hover);
}

/* Efek Aktif/Klik Default (Mengecil sedikit memberikan feedback) */
button:active {
    transform: scale(0.98);
}

/* Atribut khusus: [no-focus] menghilangkan animasi transform scale saat diklik */
button[no-focus]:active {
    transform: none;
}

/* Atribut khusus: [red] mengubah skema warna menjadi merah Flat UI Danger */
button[red] {
    background-color: var(--red-main);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

button[red]:hover {
    background-color: #c0392b; /* Red Alizarin lebih gelap untuk hover */
}

/* ==========================================================================
   6. GLOBAL APP COMPONENTS (Cards, Tables, Badges)
   ========================================================================== */
/* Card Wrapper */
.card {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

/* Layout Grid Dashboard */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Responsive Table Container */
.table-container {
    background-color: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.table-header-box {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.responsive-table th {
    background-color: var(--background);
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.responsive-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
}

.responsive-table tr:last-child td {
    border-bottom: none;
}

.responsive-table tr:hover td {
    background-color: var(--background);
}

/* Badges & Status */
.badge-client {
    background-color: var(--border-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    color: var(--text-input);
}

.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-paid {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.status-pending {
    background-color: var(--amber-bg);
    color: var(--amber-text);
}

.dot-status {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: var(--primary);
    display: inline-block;
    margin-right: 0.375rem;
}