/* ============================================================
   XMZ OTP API - STYLE RAPI
   ============================================================ */

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

:root {
    --bg: #08080a;
    --surface: #101012;
    --card: #18181b;
    --border: #2a2a2e;
    --text: #f5f5f5;
    --text-secondary: #8e8e93;
    --text-muted: #555;
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --danger: #ef4444;
    --success: #10b981;
    --gradient: linear-gradient(135deg, #f59e0b, #ef4444);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */

.app {
    display: flex;
    max-width: 1100px;
    width: 100%;
    min-height: 90vh;
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: 210px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}
.brand-text span {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: left;
}

.nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-item.active {
    background: rgba(245, 158, 11, 0.1);
    color: var(--primary);
    border-left: 2px solid var(--primary);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.status-dot.offline {
    background: var(--danger);
}

/* ============================================================
   MAIN
   ============================================================ */

.main {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    min-height: 90vh;
}

/* ============================================================
   HEADER
   ============================================================ */

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.btn-back,
.btn-home {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-back:hover,
.btn-home:hover {
    background: var(--border);
    color: var(--text);
}

.btn-back i,
.btn-home i {
    width: 18px;
    height: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.header-badge.offline {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ============================================================
   TAB PANELS
   ============================================================ */

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.panel-header h2 i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.panel-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--primary);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.panel-badge.danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ============================================================
   CARD
   ============================================================ */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.card-body {
    padding: 20px;
}

/* ============================================================
   FORM
   ============================================================ */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.form-group label i {
    width: 14px;
    height: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
    text-decoration: none;
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--gradient);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--border);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ============================================================
   PROVIDER GRID
   ============================================================ */

.provider-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.provider-tag {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 12px;
    border-radius: 16px;
    font-size: 10px;
    color: var(--text-secondary);
    transition: 0.2s;
}

.provider-tag:hover {
    border-color: var(--primary);
    color: var(--text);
}

/* ============================================================
   STATUS DISPLAY
   ============================================================ */

.status-display {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 60px;
}

.status-display .empty-text {
    color: var(--text-muted);
}

/* ============================================================
   RESPONSE
   ============================================================ */

.response-section {
    margin-top: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.response-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.response-title i {
    width: 16px;
    height: 16px;
}

.response-time {
    font-size: 11px;
    color: var(--text-muted);
}

.response-body {
    padding: 14px 18px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12px;
    color: #d4d4d4;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    background: var(--bg);
}

.response-body .empty-text {
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .app {
        flex-direction: column;
        border-radius: 16px;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .sidebar-brand {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
        flex: 1;
        justify-content: flex-end;
    }

    .nav-item {
        padding: 6px 12px;
        font-size: 12px;
        width: auto;
    }

    .nav-item i {
        width: 14px;
        height: 14px;
    }

    .nav-item span {
        display: none;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 2px solid var(--primary);
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        padding: 14px 16px;
        min-height: auto;
    }

    .main-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        padding: 10px;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .card-body {
        padding: 14px;
    }
}