/* Modern SaaS Minimal - Admin Panel (Vanilla) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap");

:root {
    /* Light Theme Default (Cyan/Teal Nuance) */
    --bg: #f8fafc;
    --panel: #ffffff;
    --panel-2: #F0FDFF;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(0, 159, 178, 0.1);
    --primary: #009FB2;
    --primary-2: #007F8E;
    --primary-soft: rgba(0, 159, 178, 0.1);
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    --shadow: 0 10px 30px -10px rgba(0, 159, 178, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);

    --radius: 16px;
    --radius-sm: 12px;

    --sidebar-w: 270px;
    --topbar-h: 68px;

    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
        Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #009FB2 0%, #007F8E 100%);
    --gradient-sidebar: linear-gradient(180deg, #ffffff 0%, #F0FDFF 100%);
    --gradient-body: radial-gradient(
        circle at 10% 20%,
        rgb(240, 253, 255) 0%,
        rgb(255, 255, 255) 90%
    );
}

/* Optional Dark Mode */
:root.dark {
    --bg: #0b1220;
    --panel: #0f172a;
    --panel-2: #111c33;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.18);
    --primary: #33B5C5;
    --primary-2: #009FB2;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --gradient-primary: linear-gradient(135deg, #33B5C5 0%, #009FB2 100%);
    --gradient-sidebar: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
    --gradient-body: #0b1220;
}

* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family: var(--font);
    background: var(--gradient-body);
    background-attachment: fixed;
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}
button,
input,
select {
    font: inherit;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.main {
    flex: 1;
    padding: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.brand img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 4px 6px rgba(22, 163, 74, 0.2));
}
.brand .title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.brand .title strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.brand .title span {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.nav .section {
    margin: 20px 12px 8px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    opacity: 0.8;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    font-size: 0.925rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.nav a .icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: color 0.2s;
}
.nav a:hover {
    background: var(--panel);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.nav a.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.nav a.active .icon {
    color: white;
}

/* Logout Button Special Style */
.nav .logout-wrapper {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.nav .logout-btn {
    color: var(--danger);
}
.nav .logout-btn:hover {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
}

/* Card Style for Dashboard */
.card {
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    transition: all 0.2s;
}
.topbar .left,
.topbar .right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
}

/* Search Input */
.search {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--muted);
}
.search svg {
    position: absolute;
    left: 12px;
    pointer-events: none;
    width: 18px;
    height: 18px;
}
.search input {
    height: 40px;
    padding-left: 38px;
    padding-right: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--panel-2);
    width: 280px;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s;
}
.search input:focus {
    outline: none;
    background: var(--panel);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.search .k {
    position: absolute;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--muted);
    pointer-events: none;
}

/* Icon Buttons */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}
.icon-btn:hover {
    background: var(--panel-2);
    color: var(--primary);
}

/* Avatar Section */
.avatar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    margin-left: 8px;
    cursor: pointer;
}
.avatar .dot {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    position: relative;
    /* Placeholder for user image if none */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}
.avatar .dot::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
}
.avatar .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.avatar .meta strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.avatar .meta span {
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 768px) {
    .sidebar {
        display: none; /* Logic for mobile toggle to be added if needed */
    }
    .topbar .hamburger {
        display: block;
    }
    .search input {
        width: 160px;
    }
    .search .k {
        display: none;
    }
    .avatar .meta {
        display: none;
    }
}

/* Footer */
.footer {
    padding: 20px 24px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: auto;
    text-align: center;
    background: var(--bg); /* Ensure footer is not transparent */
    position: relative;
    z-index: 10;
}

/* Avatar Dropdown */
.avatar-dropdown {
    position: relative;
}

.avatar-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    color: var(--text);
    text-align: left;
}

.avatar-trigger:hover,
.avatar-dropdown.open .avatar-trigger {
    background: var(--panel-2);
}

.avatar-trigger .dot {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    position: relative;
}

.avatar-trigger .dot::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
}

.avatar-trigger .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.avatar-trigger .meta strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.avatar-trigger .meta span {
    font-size: 0.75rem;
    color: var(--muted);
}

.avatar-trigger .arrow {
    color: var(--muted);
    transition: transform 0.2s;
}

.avatar-dropdown.open .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 200px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 100;
    animation: slideDown 0.2s ease-out;
}

.avatar-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text);
    border-radius: 6px;
    transition: all 0.2s;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--panel-2);
    color: var(--primary);
}

.dropdown-item.logout {
    color: var(--danger);
}

.dropdown-item.logout:hover {
    background: #fef2f2;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FIX PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.pagination li {
    margin: 0 4px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.pagination li.active span {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.pagination li a:hover {
    background-color: #f3f4f6;
}
.pagination svg {
    width: 14px !important;
    height: 14px !important;
}
svg {
    width: 20px;
    height: 20px;
}