/* Import Google Font Ubuntu */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0284c7;
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;
    --border: #334155;
}

/* ==========================================
   GLOBAL TYPOGRAPHY & RESET
   ========================================== */
body {
    margin: 0; padding: 0;
    font-family: 'Ubuntu', sans-serif;
    font-size: 16px; /* Ukuran dasar diperbesar */
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Memaksa elemen Form dan Tombol menggunakan Ubuntu */
input, select, textarea, button {
    font-family: 'Ubuntu', sans-serif;
    font-size: 16px; 
}

/* ==========================================
   DASHBOARD LAYOUT (SIDEBAR & MAIN CONTENT) 
   ========================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: 260px; /* Sedikit diperlebar menyesuaikan font */
    background: #1e293b;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 25px 20px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    text-align: center;
    letter-spacing: 1px;
}
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    list-style: none;
    margin: 0;
}
.sidebar-heading {
    padding: 25px 25px 10px 25px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    font-weight: 700;
    opacity: 0.8;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
    font-size: 17px; /* Navigasi diperbesar */
    font-weight: 500;
}
.sidebar-nav li a i {
    margin-right: 15px;
    width: 24px;
    font-size: 19px;
    text-align: center;
    color: var(--text-muted);
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border-right: 4px solid var(--primary);
}
.sidebar-nav li a:hover i, .sidebar-nav li a.active i {
    color: var(--primary);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}
.app-topbar {
    height: 70px;
    background: #1e293b;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    font-size: 16px;
}
.topbar-user { font-size: 16px; color: var(--text-muted); }
.topbar-user strong { color: var(--text-main); margin-right: 15px; }
.btn-logout {
    background: var(--danger);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.app-content-wrapper { padding: 30px; }

/* ==========================================
   LEDGER CONSOLE UI
   ========================================== */
.web-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    overflow: hidden;
    max-width: 100%;
}
.web-header {
    background: #0f172a;
    padding: 22px 25px;
    border-bottom: 1px solid var(--border);
}
.web-header h3 { margin: 0; color: var(--primary); font-size: 20px; }
.web-body { padding: 25px; }

/* Buttons */
.btn-action {
    padding: 14px; border: none; border-radius: 8px;
    font-weight: bold; cursor: pointer; color: #fff;
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    font-size: 15px;
}
.btn-primary { background: var(--primary); color: #0f172a; }
.btn-secondary { background: #475569; }
.btn-warning { background: var(--warning); color: #0f172a; }
.btn-danger { background: var(--danger); }
.action-bar { display: flex; gap: 12px; margin-bottom: 20px; }

/* Forms */
.theme-form-box { background: rgba(0,0,0,0.2); padding: 20px; border-radius: 8px; border: 1px dashed var(--border); }
.label-edit { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 6px; margin-top: 12px; font-weight: 500; }
.form-control-edit {
    width: 100%; padding: 14px; box-sizing: border-box;
    background: var(--bg-dark); border: 1px solid var(--border);
    color: var(--text-main); border-radius: 8px; 
}
.input-row { display: flex; gap: 15px; }

/* Ledger Tree UI */
.ledger-container { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.node-header {
    background: var(--bg-dark); border: 1px solid var(--border);
    padding: 16px; border-radius: 8px; position: relative; cursor: pointer;
}
.node-header:hover { border-color: var(--primary); }
.lvl-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.tg-sum-badge { padding: 4px 10px; border-radius: 4px; font-size: 13px; font-weight: bold; }

/* Component List UI */
.komponen-item {
    background: var(--bg-dark); padding: 15px; border-radius: 8px; border: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; cursor: pointer;
}
.komponen-item:hover { border-color: var(--primary); }

/* Trx Dots */
.trx-indicator-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.dot-trx {
    font-size: 11px; padding: 4px 8px; border-radius: 10px;
    background: #334155; color: #64748b; font-weight: bold; border: 1px solid #475569;
}
.dot-trx.active { background: rgba(56, 189, 248, 0.1); color: var(--primary); border-color: var(--primary); }

/* Toggle Switch */
.tg-toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); margin-top: 15px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

/* Radio Mutasi */
.tg-action-toggle { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-top: 10px;}
.tg-action-toggle input[type="radio"] { display: none; }
.btn-mutasi {
    padding: 10px 16px; background: var(--bg-dark); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-muted); font-size: 13px; font-weight: bold; cursor: pointer;
    white-space: nowrap;
}
.tg-action-toggle input[type="radio"]:checked + .btn-mutasi {
    background: var(--primary); color: #0f172a; border-color: var(--primary);
}

/* ==========================================
   MODAL SYSTEM TEMPLATE
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}
.modal-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    padding: 20px 25px;
    background: #1e293b;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--primary);
}
.modal-close {
    cursor: pointer;
    font-size: 22px;
    color: var(--text-muted);
    transition: 0.2s;
}
.modal-close:hover { color: var(--danger); }
.modal-body {
    padding: 25px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Responsif untuk HP */
@media (max-width: 768px) {
    .app-wrapper { flex-direction: column; }
    .app-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { display: flex; flex-wrap: wrap; padding: 10px; justify-content: center; }
    .sidebar-heading { width: 100%; text-align: center; }
    .sidebar-nav li a { padding: 12px; border-right: none; border-bottom: 2px solid transparent; }
    .sidebar-nav li a.active { border-right: none; border-bottom: 2px solid var(--primary); }
    .app-content-wrapper { padding: 15px; }
}