/* [BARU] Style untuk Ikon di Sidebar */
.nav button span.icon i.bi {
    opacity: 0.3;
    transition: opacity 0.15s ease-in-out;
}

.nav button.active span.icon i.bi {
    opacity: 0.7;
}

.nav button:hover span.icon i.bi {
    opacity: 0.7;
}

.logout-btn {
    background: #b91c1c;
    color: #fff;
    margin-left: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.logout-btn:hover {
    background:#dc2626;
}


:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --accent: #2563eb;
    --accent-soft: #1d4ed8;
    --danger: #dc2626;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --card-bg: #020617;
    --border: #1f2937;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1e293b 0, #020617 60%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

header .title {
    font-weight: 600;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

header .title span.logo {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle at 20% 20%, #38bdf8, #1d4ed8);
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

header .user {
    font-size: 13px;
    color: var(--muted);
}

.layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.sidebar {
    width: 230px;
    background: rgba(15, 23, 42, 0.98);
    border-right: 1px solid var(--border);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar h3 {
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

.nav {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.nav button {
    background: transparent;
    border: none;
    color: var(--muted);
    text-align:  left;
    padding: 8px  10px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background .15s, color .15s, transform .05s;
}

.nav button span.icon {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.nav button.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    color: #f9fafb;
    transform: translateX(2px);
}

.nav button:hover:not(.active) {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.content {
    flex: 1;
    padding: 18px 20px 24px;
    overflow-y: auto;
}

.view {
    display: none;
    animation: fadeIn .15s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.card {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, .12), transparent),
                linear-gradient(to bottom right, rgba(15, 23, 42, .96), rgba(15, 23, 42, .98));
    border-radius: 14px;
    padding: 16px 16px 14px;
    border: 1px solid rgba(15, 23, 42, 1);
    box-shadow: 0 18px 45px rgba(0,0,0,.65);
}

.card h2 {
    margin: 0 0 4px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card p.sub {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
}

.stat {
    font-size: 22px;
    font-weight: 600;
    margin: 6px 0 2px;
}

.stat small {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 4px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(37, 99, 235, .15);
    border: 1px solid rgba(59, 130, 246, .4);
    color: #bfdbfe;
    gap: 4px;
}

label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

input, textarea, select {
    width: 100%;
    padding: 8px 9px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    font-size: 13px;
    font-family: Consolas, Menlo, Monaco, monospace;
}

textarea {
    resize: vertical;
    min-height: 130px;
}

.btn-group-config {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

button.btn {
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #f9fafb;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 12px 25px rgba(37, 99, 235, .35);
}

button.btn.danger {
    background: var(--danger);
    box-shadow: 0 12px 25px rgba(220, 38, 38, .35);
}

button.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

th, td {
    padding: 8px 6px;
    border-bottom: 1px solid #111827;
    text-align: left;
}

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    background: rgba(15, 23, 42, .8);
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:hover td {
    background: rgba(15, 23, 42, .4);
}

.chip {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chip.ok {
    background: rgba(22, 163, 74, .2);
    color: #bbf7d0;
}

.chip.offline {
    background: rgba(220, 38, 38, .2);
    color: #fecaca;
}

.chip.pending {
    background: rgba(234, 179, 8, .2);
    color: #facc15;
}

.log-area {
    font-family: Consolas, monospace;
    font-size: 12px;
    background: #020617;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #111827;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.log-line {
    color: #9ca3af;
}

.log-line.ok {
    color: #4ade80;
}

.log-line.err {
    color: #f87171;
}

.pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid #1f2937;
    color: var(--muted);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar input {
    width: auto;
    min-width: 160px;
}

/* ========== CUSTOM MODAL SYSTEM ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-modal {
    background: radial-gradient(circle at top left, rgba(56,189,248,.12), transparent),
                linear-gradient(to bottom right, rgba(15,23,42,.96), rgba(15,23,42,.98));
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 460px;
    max-width: 92%;
    box-shadow: 0 25px 60px rgba(0,0,0,.8);
    animation: modalPop .2s ease;
}

.custom-modal.small {
    width: 340px;
}

@keyframes modalPop {
    from { transform: scale(.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.hidden {
    display: none !important;
}
