/* PreAdmin — WorldNIC-inspired interface */
:root {
    --primary: #6b5cff;
    --primary-dark: #5648e8;
    --secondary: #1f2430;
    --sidebar: #171b2a;
    --sidebar-hover: #23283a;
    --body: #f5f6fa;
    --card: #ffffff;
    --text: #202532;
    --muted: #8b92a5;
    --border: #e9ebf1;
    --success: #18b777;
    --warning: #f5a623;
    --danger: #e65c6a;
    --info: #4299e1;
    --sidebar-width: 255px;
    --topbar-height: 76px;
    --radius: 14px;
    --shadow: 0 6px 25px rgba(34, 38, 53, .06);
}

[data-theme="dark"] {
    --body: #111522;
    --card: #191e2c;
    --text: #edf0f7;
    --muted: #969db0;
    --border: #2a3040;
    --shadow: 0 8px 28px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--body);
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    transition: background .2s ease, color .2s ease;
}

a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 23px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand a {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 19px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #8c7fff);
    box-shadow: 0 7px 18px rgba(107,92,255,.28);
}

.sidebar-section-title {
    padding: 27px 24px 10px;
    color: #70778b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.sidebar-nav { padding: 0 12px; }

.sidebar-nav a {
    min-height: 48px;
    padding: 0 13px;
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #aeb4c5;
    border-radius: 10px;
    font-weight: 500;
    transition: .2s ease;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(107,92,255,.2), rgba(107,92,255,.08));
    color: #fff;
}

.nav-icon {
    width: 27px;
    text-align: center;
    font-size: 15px;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.sidebar-user-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-info strong {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info small {
    color: #7e8699;
    margin-top: 2px;
}

.sidebar-logout {
    color: #9aa1b3;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.sidebar-logout:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,12,20,.55);
    z-index: 1030;
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: var(--topbar-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.breadcrumb-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 3px;
}

.page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--muted);
    display: inline-grid;
    place-items: center;
}

.icon-btn:hover { color: var(--primary); border-color: rgba(107,92,255,.25); }

.user-menu {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 0 4px 7px;
    color: var(--text);
}

.user-menu::after { margin-left: 2px; }

.user-menu strong { display: block; font-size: 12px; }
.user-menu small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }

.avatar {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #8d80ff);
    font-size: 13px;
    font-weight: 700;
}

.avatar-sm { width: 36px; height: 36px; flex-basis: 36px; }
.avatar-table { width: 38px; height: 38px; flex-basis: 38px; }

.page-content { padding: 28px; flex: 1; }

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    display: block;
    color: var(--primary);
    font-size: 10px;
    letter-spacing: 1.3px;
    font-weight: 700;
    margin-bottom: 5px;
}

.section-heading { font-size: 20px; font-weight: 700; }

.stat-card {
    height: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 21px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
}

.stat-icon.purple { background: #eeecff; color: #6b5cff; }
.stat-icon.green { background: #e8faf2; color: #18b777; }
.stat-icon.orange { background: #fff3e4; color: #ef9a27; }
.stat-icon.blue { background: #e8f4ff; color: #4299e1; }

.stat-content { min-width: 0; }
.stat-content > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat-content > strong { display: block; font-size: 24px; line-height: 1.2; }
.stat-content small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.stat-content small i { margin-right: 3px; }

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

.card-header {
    padding: 20px 22px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.card-header h5 { margin: 0; font-size: 15px; font-weight: 700; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.soft-badge { color: var(--primary); background: #eeecff; padding: 6px 9px; border-radius: 6px; font-size: 10px; font-weight: 600; }

.app-table { color: var(--text); }
.app-table > :not(caption) > * > * { background: transparent; border-color: var(--border); padding: 14px 20px; }
.app-table thead th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.app-table tbody td { font-size: 12px; }

.table-user { display: flex; align-items: center; gap: 10px; }
.table-user strong { display: block; font-size: 12px; }
.table-user small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }

.role-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}
.role-badge.admin { color: #6355e9; background: #eeecff; }
.role-badge.user { color: #4384bd; background: #eaf5ff; }
.status-badge.active { color: #169d67; background: #e8faf2; }
.status-badge.inactive { color: #c55a66; background: #ffedf0; }
.status-badge i { font-size: 5px; }

.activity-list { padding: 8px 20px 12px; }
.activity-item {
    display: flex;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: #eeecff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 11px;
}
.activity-item strong { display: block; font-size: 11px; }
.activity-item p { margin: 3px 0; color: var(--muted); font-size: 10px; }
.activity-item small { color: var(--muted); font-size: 9px; }
.empty-state { color: var(--muted); text-align: center; padding: 35px 0; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text); }
.form-control {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
}
.form-control:focus {
    border-color: rgba(107,92,255,.55);
    box-shadow: 0 0 0 .2rem rgba(107,92,255,.1);
    background: var(--card);
    color: var(--text);
}
.form-control::placeholder { color: #adb3c2; }
.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
}
.btn { border-radius: 8px; font-size: 12px; font-weight: 600; }

.profile-cover {
    height: 105px;
    background: linear-gradient(135deg, #6b5cff, #9287ff);
}
.profile-body { text-align: center; padding: 0 25px 25px; }
.profile-avatar {
    width: 84px;
    height: 84px;
    margin: -42px auto 14px;
    border-radius: 50%;
    border: 5px solid var(--card);
    background: linear-gradient(135deg, #6b5cff, #8f83ff);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
    position: relative;
}
.profile-body h4 { margin-bottom: 3px; font-size: 18px; }
.profile-meta { text-align: left; border-top: 1px solid var(--border); padding-top: 15px; }
.profile-meta div { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 11px; }
.profile-meta i { width: 18px; color: var(--primary); text-align: center; }

.app-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.dropdown-menu {
    background: var(--card);
    color: var(--text);
}
.dropdown-item { font-size: 12px; color: var(--text); padding: 9px 14px; }
.dropdown-item:hover { background: var(--body); color: var(--primary); }

.alert { font-size: 12px; border-radius: 10px; }

.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top right, #e9e6ff 0, #f6f7fb 38%, #f6f7fb 100%);
    display: grid;
    place-items: center;
    padding: 30px 16px;
}
.login-shell { width: min(100%, 430px); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; font-size: 20px; font-weight: 700; }
.login-card { background: #fff; border: 1px solid #e8e9f0; border-radius: 18px; box-shadow: 0 20px 55px rgba(39,43,65,.1); padding: 35px; }
.login-icon { width: 56px; height: 56px; border-radius: 15px; margin: auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), #8c7fff); font-size: 21px; }
.login-card h2 { font-size: 22px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 14px; color: var(--muted); z-index: 2; }
.input-icon .form-control { padding-left: 40px; }
.demo-box { text-align: center; background: #f7f7fb; border-radius: 9px; padding: 11px; font-size: 11px; }
.login-footer { text-align: center; color: #9aa0b0; font-size: 10px; margin-top: 18px; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .page-content { padding: 22px; }
}
@media (max-width: 575.98px) {
    .topbar { padding: 12px 16px; }
    .page-content { padding: 16px; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; }
    .app-footer { padding: 16px; flex-direction: column; }
    .login-card { padding: 25px 20px; }
    .brand-text { font-size: 17px; }
}
