/* VAH DNS Panel - Clean Light Theme */

:root {
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-topbar: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --accent-hover: #1d4ed8;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --sidebar-width: 250px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-body);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    padding: 22px 22px 18px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.sidebar-brand i { font-size: 1.4rem; }

.sidebar .nav {
    padding: 14px 10px;
    flex: 1;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 9px 14px;
    margin: 1px 0;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
    border-radius: 8px;
}

.sidebar .nav-link:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.sidebar .nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .btn {
    font-size: 0.8rem;
}

/* ---- Main Content ---- */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.2px;
}

.content-area {
    padding: 28px;
}

/* ---- Cards ---- */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.panel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.panel-card .card-header {
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 13px 18px;
    color: var(--text);
    letter-spacing: -0.1px;
}

.panel-card .card-header i {
    color: var(--text-muted);
    margin-right: 4px;
}

.panel-card .card-body {
    padding: 18px;
}

.panel-card .card-footer {
    background: #fafbfc;
    border-top: 1px solid var(--border);
}

/* ---- Stat Cards ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-top: 2px;
}

/* ---- Tables ---- */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: #f8fafc;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Category Dot ---- */
.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Login ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 50%, #dbeafe 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand i {
    font-size: 2.5rem;
    color: var(--accent);
}

.login-brand h2 {
    font-size: 1.4rem;
    margin: 10px 0 4px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Form Overrides ---- */
.form-control,
.form-select {
    background: #ffffff;
    border-color: var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    color: var(--text);
}

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

.input-group-text {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text-muted);
    border-radius: 8px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ---- Buttons ---- */
.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

/* ---- Flash Messages ---- */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    border-radius: var(--radius);
    font-size: 0.875rem;
    border: none;
}

/* ---- Modals ---- */
.modal-content {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.modal-header {
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    background: #fafbfc;
    border-top: 1px solid var(--border);
    padding: 14px 20px;
}

/* ---- Service Status Pill & Dropdown ---- */
.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
    background: #fff;
}

.status-pill:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.status-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.status-pill-dot.ok {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.status-pill-dot.error {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08); }
}

.status-pill-arrow {
    font-size: 0.6rem;
    opacity: 0.4;
}

.service-dropdown {
    min-width: 280px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px 0;
}

.service-dropdown .dropdown-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 16px;
}

.svc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    font-size: 0.84rem;
}

.svc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.svc-version {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 4px;
    font-family: monospace;
}

.svc-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.svc-status-running { color: #16a34a; }
.svc-status-stopped { color: #dc2626; }
.svc-status-error { color: #dc2626; }

/* ---- DataTables Overrides ---- */
.dataTables_wrapper .dataTables_filter input {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    border-radius: 6px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent-light) !important;
    border-color: var(--border) !important;
    color: var(--accent) !important;
}

/* ---- Pagination ---- */
.page-link {
    color: var(--text-secondary);
    border-color: var(--border);
    font-size: 0.85rem;
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* ---- Chart ---- */
canvas {
    max-height: 220px;
}

/* ---- Code ---- */
code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
    }
    .content-area {
        padding: 16px;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Utilities ---- */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
