@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Colors */
    --color-primary: #2B3952;
    --color-accent: #EEC693;
    --color-bg-general: #F8F9FB;
    --color-card: #FFFFFF;

    /* Text Colors */
    --text-primary: #2B3952;
    --text-secondary: #51607D;
    --text-muted: #6b7280;

    /* States */
    --color-success: #22c55e;
    --color-warning: #f97316;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    /* Effects */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-deep: 0 20px 40px rgba(43, 57, 82, 0.12);
    --radius-soft: 16px;
    --radius-pill: 50px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #fcfdfe;
    /* Even cleaner background */
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    /* Changed to 0 to let navbar be full width inside */
    transition: var(--transition-base);
    background: white;
    /* Base for content area */
}

.content-body {
    padding: 1.5rem 2rem;
    /* Reduced from 2.5rem */
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Glassmorphism Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(43, 57, 82, 0.05);
    padding: 0.75rem 2.5rem;
    /* More compact */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #2B3952 0%, #1a2434 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 101;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 2.5rem 1.5rem;
    display: flex;
    align-items: center;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    opacity: 1;
    transition: var(--transition-base);
    letter-spacing: -0.02em;
}

.sidebar.collapsed .brand-name {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
}

.nav-item {
    margin-bottom: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background-color: var(--color-accent);
    color: #1a2434;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(238, 198, 147, 0.2);
}

.nav-link i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
    opacity: 1;
    transition: var(--transition-base);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

/* Cards */
.card {
    background: var(--color-card);
    border-radius: 20px;
    /* More modern rounding */
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(43, 57, 82, 0.04);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: 0 10px 30px rgba(43, 57, 82, 0.05);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #3b4d6e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* Gradients */
.gradient-accent {
    background: linear-gradient(135deg, #EEC693 0%, #D4A373 100%);
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* --- Dashboard Premium Elements --- */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card-premium {
    background: var(--color-card);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
    border: 1px solid rgba(43, 57, 82, 0.05);
}

.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-deep);
}

.stat-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(238, 198, 147, 0.1), transparent 70%);
    pointer-events: none;
}

.icon-box-premium {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    transition: var(--transition-base);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary);
    display: block;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Tables Redesign */
.premium-table-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.premium-table th {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 2px solid #f8f9fa;
}

.premium-table td {
    padding: 1rem;
    background: white;
    font-size: 0.85rem;
    border-bottom: 1px solid #f8f9fa;
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.badge-premium {
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* User Profile & Dropdown */
.user-profile-wrapper {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem;
    border-radius: 12px;
    transition: var(--transition-base);
    cursor: pointer;
}

.user-profile:hover {
    background: rgba(43, 57, 82, 0.04);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(43, 57, 82, 0.2);
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    line-height: 1.2;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-deep);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    display: none;
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--color-primary);
}

.dropdown-item.danger {
    color: #ef4444 !important;
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}