/* ═══════════════════════════════════════════════════════════════════
   DATAPLANLAMA — Admin Theme (Paces-inspired)
═══════════════════════════════════════════════════════════════════ */

:root {
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 76px;
    --topbar-height: 70px;

    --bg-body: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-2: #fafbff;
    --bg-sidebar: #1a1d29;
    --bg-sidebar-hover: #252836;
    --bg-sidebar-active: #4f46e5;

    --text-body: #1f2937;
    --text-muted: #6b7280;
    --text-heading: #111827;
    --text-sidebar: #9ca3af;
    --text-sidebar-active: #ffffff;
    --text-topbar: #1f2937;

    --border-color: #e5e7eb;
    --border-sidebar: rgba(255,255,255,0.06);

    --brand: #4f46e5;
    --brand-hover: #4338ca;
    --brand-soft: rgba(79,70,229,0.12);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 3px rgba(15,23,42,0.05), 0 1px 2px rgba(15,23,42,0.03);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
    --shadow-lg: 0 12px 28px rgba(15,23,42,0.08), 0 4px 8px rgba(15,23,42,0.04);

    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-body: #0f1320;
    --bg-surface: #1a1d29;
    --bg-surface-2: #222638;
    --bg-sidebar: #0a0d17;
    --bg-sidebar-hover: #1a1d29;
    --text-body: #e5e7eb;
    --text-muted: #9ca3af;
    --text-heading: #f9fafb;
    --text-topbar: #f1f5f9;
    --border-color: rgba(255,255,255,0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

/* ═══════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .25s ease, transform .25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.08);
}

html.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }
html.sidebar-collapsed .sidebar .brand-text,
html.sidebar-collapsed .sidebar .nav-item span,
html.sidebar-collapsed .sidebar .nav-section-title,
html.sidebar-collapsed .sidebar .user-info { display: none; }
html.sidebar-collapsed .sidebar .sidebar-brand { justify-content: center; }
html.sidebar-collapsed .sidebar .user-card { justify-content: center; }
html.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-width-collapsed); }

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -.2px;
}
.sidebar-brand:hover { color: #ffffff; }
.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    flex-shrink: 0;
}

.sidebar-close {
    background: transparent; border: 0;
    color: var(--text-sidebar); font-size: 20px; padding: 4px 8px;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px 20px;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.nav-section-title {
    padding: 14px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #4b5563;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-sidebar);
    font-weight: 500;
    font-size: 14px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    margin-bottom: 2px;
    white-space: nowrap;
}
.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: #ffffff;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.nav-item .badge {
    margin-left: auto;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-sidebar);
}

.user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
}
.user-card .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-card .user-info .user-name { color: #fff; font-weight: 600; font-size: 13px; }
.user-card .user-info .user-role { color: var(--text-sidebar); font-size: 11px; }

/* backdrop for mobile */
.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1039;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════
   MAIN WRAPPER / TOPBAR
════════════════════════════════════════ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-height);
    padding: 0 24px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.topbar-menu-btn {
    background: transparent; border: 0;
    color: var(--text-topbar);
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s ease;
}
.topbar-menu-btn:hover { background: var(--brand-soft); color: var(--brand); }

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.topbar-search i {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-body);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-icon-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--bg-body);
    border: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-body);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
    text-decoration: none;
    position: relative;
}
.topbar-icon-btn:hover { background: var(--brand-soft); color: var(--brand); }

.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-block; }
[data-theme="dark"] .theme-icon-light { display: none; }

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-topbar);
}
.topbar-user-btn:hover { background: var(--bg-body); }
.user-avatar-sm {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.topbar-user-btn .user-info { text-align: left; line-height: 1.2; }
.topbar-user-btn .user-name { font-size: 13px; font-weight: 600; color: var(--text-heading); }
.topbar-user-btn .user-role { font-size: 11px; color: var(--text-muted); }

.main-content {
    padding: 24px;
}

/* ═══════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -.4px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.page-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--brand); }
.page-breadcrumb .separator { margin: 0 8px; }
.page-breadcrumb .current { color: var(--brand); font-weight: 600; }

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; }
    .topbar-search { display: none; }
}
@media (max-width: 575.98px) {
    .main-content { padding: 16px; }
    .topbar { padding: 0 16px; }
}

/* dropdown (bootstrap override) */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 6px;
    background: var(--bg-surface);
    min-width: 200px;
}
.dropdown-menu .dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-body);
}
.dropdown-menu .dropdown-item:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown-menu .dropdown-divider { border-top: 1px solid var(--border-color); margin: 6px 0; }
