@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --rainbow-gradient: linear-gradient(90deg, #ef4444 0%, #f97316 14%, #f59e0b 28%, #10b981 42%, #06b6d4 56%, #3b82f6 70%, #6366f1 84%, #a855f7 100%);
    --bg-main: #f8fafc;
    --bg-ambient: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 25%, #f0fdf4 50%, #fefce8 75%, #faf5ff 100%);
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 28px -5px rgba(99, 102, 241, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 76px;
    --topbar-height: 64px;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-ambient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Admin Tool Master Layout Structure
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background: var(--bg-ambient);
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Sidebar Component
   -------------------------------------------------------------------------- */
aside.sidebar-wrapper, .sidebar-wrapper {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%) !important;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(15, 23, 42, 0.2);
}

/* Brand Header */
.sidebar-brand {
    height: var(--topbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(9, 13, 22, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rainbow-gradient);
}

.brand-link {
    display: flex;
    align-items: center;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.sidebar-close-btn {
    color: #94a3b8;
    background: transparent;
    border: none;
}
.sidebar-close-btn:hover {
    color: #ffffff;
}

/* User Card Brief */
.sidebar-user-card {
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-info {
    overflow: hidden;
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    margin-top: 2px;
    white-space: nowrap;
}

.role-name {
    color: #94a3b8;
}

/* Sidebar Menu Wrapper & Lists */
.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-header {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1rem 0.9rem 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #64748b;
    white-space: nowrap;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.9rem;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.menu-icon {
    font-size: 1.05rem;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

/* Sidebar Colorful Vibrant Icon Badges */
.menu-icon.icon-cyan { color: #06b6d4 !important; background: rgba(6, 182, 212, 0.18) !important; }
.menu-icon.icon-indigo { color: #818cf8 !important; background: rgba(129, 140, 248, 0.18) !important; }
.menu-icon.icon-emerald { color: #34d399 !important; background: rgba(52, 211, 153, 0.18) !important; }
.menu-icon.icon-amber { color: #fbbf24 !important; background: rgba(251, 191, 36, 0.18) !important; }
.menu-icon.icon-purple { color: #c084fc !important; background: rgba(192, 132, 252, 0.18) !important; }
.menu-icon.icon-rose { color: #fb7185 !important; background: rgba(251, 113, 133, 0.18) !important; }
.menu-icon.icon-teal { color: #2dd4bf !important; background: rgba(45, 212, 191, 0.18) !important; }
.menu-icon.icon-lime { color: #a3e635 !important; background: rgba(163, 230, 53, 0.18) !important; }
.menu-icon.icon-orange { color: #fb923c !important; background: rgba(251, 146, 60, 0.18) !important; }
.menu-icon.icon-sky { color: #38bdf8 !important; background: rgba(56, 189, 248, 0.18) !important; }
.menu-icon.icon-violet { color: #a78bfa !important; background: rgba(167, 139, 250, 0.18) !important; }
.menu-icon.icon-red { color: #f87171 !important; background: rgba(248, 113, 113, 0.18) !important; }

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    transform: translateX(5px);
}

.menu-link:hover .menu-icon {
    transform: scale(1.1);
    box-shadow: 0 0 10px currentColor;
}

.menu-link.active {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
    font-weight: 600;
}

.menu-link.active .menu-icon {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   Main Content Layout Area
   -------------------------------------------------------------------------- */
.main-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
}

/* Topbar Header */
.topbar {
    height: var(--topbar-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.topbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rainbow-gradient);
}

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

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: #f1f5f9;
}

.main-content-inner {
    flex: 1;
}

/* Footer Styling */
footer.footer {
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Desktop Collapsed Sidebar Mode */
.sidebar-collapsed .sidebar-wrapper {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .user-info,
.sidebar-collapsed .menu-text,
.sidebar-collapsed .menu-header {
    display: none !important;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .brand-icon {
    margin-right: 0;
}

.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 1rem 0;
}

.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .menu-icon {
    margin-right: 0;
}

.sidebar-collapsed .main-content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* Mobile Responsive Drawer Mode */
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        transform: translateX(-100%);
    }

    .sidebar-wrapper.show-mobile {
        transform: translateX(0);
    }

    .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1035;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Card Styling */
.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-lg);
}

.card-header-custom {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-top-left-radius: var(--radius-md) !important;
    border-top-right-radius: var(--radius-md) !important;
    position: relative;
}

/* Vibrant Colorful Stats Cards */
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    position: absolute;
    right: 1.25rem;
    bottom: 1rem;
    font-size: 3.2rem;
    opacity: 0.25;
}

.bg-grad-primary {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
}

.bg-grad-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-grad-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.bg-grad-purple {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.bg-grad-info {
    background: linear-gradient(135deg, #0284c7 0%, #4338ca 100%);
}

/* Table Custom */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.18);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.38);
    transform: translateY(-1.5px);
}

/* Login Page Styling - Colorful Theme */
.login-box {
    max-width: 450px;
    width: 100%;
    margin: 4.5rem auto;
    background: #ffffff;
    padding: 2.75rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px -10px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--rainbow-gradient);
}

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

.login-header img {
    filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.2));
}
