/* ==========================================================================
   KAWAN-IT ADMIN CONSOLE STYLESHEET
   ========================================================================== */

:root {
    --bg-dark: #070B14;
    --bg-sidebar: #0B1120;
    --bg-surface: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(56, 189, 248, 0.3);

    --primary-cyan: #38BDF8;
    --primary-blue: #0284C7;
    --accent-emerald: #10B981;
    --accent-purple: #8B5CF6;
    --accent-yellow: #F59E0B;
    --accent-red: #EF4444;

    --text-heading: #F8FAFC;
    --text-body: #94A3B8;
    --text-light: #CBD5E1;

    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-body);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.font-code {
    font-family: var(--font-code);
}

.text-cyan { color: var(--primary-cyan) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-yellow { color: var(--accent-yellow) !important; }
.text-red { color: var(--accent-red) !important; }
.text-muted { color: var(--text-body) !important; }

/* Buttons & Elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: #FFFFFF;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-emerald {
    background: linear-gradient(135deg, #059669, #10B981);
    color: #FFFFFF;
}

.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-cyan {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-cyan:hover {
    background: var(--primary-cyan);
    color: #000000;
}

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

.btn-outline-cyan:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-heading);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger-sm {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
}

.btn-danger-sm:hover {
    background: var(--accent-red);
    color: #FFFFFF;
}

.btn-edit-sm {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--primary-cyan);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    margin-right: 6px;
}

.btn-edit-sm:hover {
    background: var(--primary-cyan);
    color: #000000;
}

/* Layout Wrapper */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

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

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
}

.brand-badge {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-body);
}

.sidebar-menu {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: var(--text-body);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-cyan);
}

.sidebar-link.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.sidebar-link.active i {
    color: var(--primary-cyan);
}

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

/* Main Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
}

.admin-topbar {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-heading);
    font-size: 1.25rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.db-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-emerald);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
}

.content-container {
    padding: 30px;
    flex: 1;
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeTab 0.25s ease-out;
}

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

/* Stats Overview */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon-box.cyan { background: rgba(56, 189, 248, 0.15); color: var(--primary-cyan); }
.stat-icon-box.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon-box.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-icon-box.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }

.admin-stat-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
}

.admin-stat-card p {
    font-size: 0.82rem;
    color: var(--text-body);
}

/* Dashboard Widgets */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px;
}

.card-title-bar {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.card-title-bar h4 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sys-info-table {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.info-label {
    color: var(--text-body);
}

.info-val {
    color: var(--text-heading);
    font-weight: 600;
}

.card-footer-action {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.admin-guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 0.88rem;
}

.admin-guide-list code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--primary-cyan);
}

/* Section Top Actions */
.section-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.admin-table th {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-body);
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.status-badge.hidden {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

.category-tag {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary-cyan);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    background-color: #0B1120;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-heading);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.form-row {
    display: flex;
    gap: 14px;
}

.col-6 {
    flex: 1;
}

/* Modal */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.admin-modal.show {
    display: flex;
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-header h4 {
    font-size: 1.15rem;
    color: var(--text-heading);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-body);
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

/* Toast Alert */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #059669;
    color: #FFFFFF;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: var(--transition);
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Logo Upload in Client Modal */
.logo-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(11, 17, 32, 0.8);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.logo-preview-box {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-upload-controls {
    flex: 1;
}

.logo-table-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 3px;
    display: inline-block;
    vertical-align: middle;
}

/* Sidebar Close Button & Mobile Backdrop */
.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-heading);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1400;
}

.sidebar-backdrop.show {
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .stats-overview-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-widgets-grid { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1500;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
    }
    .admin-sidebar.open { left: 0; }
    .menu-toggle-btn { display: block; }
    .sidebar-close-btn { display: flex; }
}

@media (max-width: 600px) {
    .stats-overview-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .content-container { padding: 16px; }
}
