/* ── Variables ─────────────────────────────────────── */
:root {
    --purple-700: #4a00b4;
    --purple-600: #6200EE;
    --purple-500: #7c3aed;
    --purple-400: #9143F5;
    --purple-100: #ede9fe;
    --sidebar-w: 220px;
    --topbar-h: 56px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(98,0,238,.12);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Login ─────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-400) 100%);
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2.5rem;
    display: block;
    margin-bottom: .5rem;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--purple-600);
    margin: 0;
}

.login-subtitle {
    color: #888;
    font-size: .9rem;
    margin: .25rem 0 0;
}

/* ── Admin layout ──────────────────────────────────── */
.admin-body {
    margin: 0;
    background: #f4f1fa;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Topbar */
.admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--purple-600);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.topbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.topbar-actions {
    margin-left: auto;
}

.btn-logout {
    color: rgba(255,255,255,.8);
    font-size: .85rem;
    text-decoration: none;
    padding: .35rem .8rem;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 6px;
    transition: background .15s;
}
.btn-logout:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* Sidebar toggle (hamburger) */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}
.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: .2s;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--purple-700);
    flex-shrink: 0;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform .25s ease;
    z-index: 900;
}

.sidebar-nav {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1.25rem;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: .92rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.sidebar-link.active {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-left-color: #fff;
    font-weight: 600;
}

.sidebar-icon { font-size: 1rem; }

/* Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 850;
}
.sidebar-overlay.show { display: block; }

/* Main content */
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 1.5rem;
    min-width: 0;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-content {
        margin-left: 0;
    }
}

/* ── Utilities ─────────────────────────────────────── */
.img-limit-height {
    max-height: 60px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* DataTable hover tweak */
#myTable tbody tr.editable { cursor: pointer; }
#myTable tbody tr.editable:hover { background-color: var(--purple-100); }
