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

:root {
    --bg-primary: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-color: #d97706;
    --accent-hover: #b45309;
    --accent-gradient: linear-gradient(135deg, #fbbf24, #f59e0b, #eab308);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(217, 119, 6, 0.12);
    --input-bg: #ffffff;
    --input-border: rgba(0, 0, 0, 0.08);
    --input-focus: rgba(217, 119, 6, 0.2);
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.2);
    --error-text: #b91c1c;
    --shadow-primary: 0 10px 30px -5px rgba(217, 119, 6, 0.05), 0 8px 24px -10px rgba(0, 0, 0, 0.08);
    
    --sidebar-width: 280px;
    --navbar-height: 70px;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Ambient Glowing Background Orbs */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.4;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: #fef08a;
    top: 10%;
    left: 10%;
    opacity: 0.6;
    animation: float-slow 15s infinite alternate ease-in-out;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: #fed7aa;
    bottom: 5%;
    right: 5%;
    opacity: 0.5;
    animation: float-slow 20s infinite alternate-reverse ease-in-out;
}

@keyframes float-slow {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.15); }
}

/* App Container Layout */
.app-container {
    position: relative;
    z-index: 5;
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(217, 119, 6, 0.08);
}

.sidebar-logo {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #d97706, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 1rem;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    gap: 0.85rem;
}

.menu-item a:hover {
    color: var(--accent-color);
    background: rgba(217, 119, 6, 0.06);
    transform: translateX(4px);
}

.menu-item.active > a {
    color: #ffffff;
    background: var(--accent-color);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.menu-item.active > a:hover {
    transform: none;
    color: #ffffff;
}

.menu-item.has-submenu.active > a {
    background: rgba(217, 119, 6, 0.08);
    color: var(--accent-color);
    box-shadow: none;
}

.menu-item.has-submenu.active > a:hover {
    background: rgba(217, 119, 6, 0.12);
}

.menu-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

/* Submenu / Dropdown Styling */
.menu-item.has-submenu {
    display: flex;
    flex-direction: column;
}

.submenu-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-toggle .submenu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.menu-item.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-left: 2px solid rgba(217, 119, 6, 0.1);
    margin-left: 1.85rem;
    padding-left: 0.5rem;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.3s ease, padding-bottom 0.3s ease;
}

.menu-item.open .submenu {
    max-height: 200px;
    margin-top: 0.5rem;
    padding-bottom: 0.25rem;
}

.submenu-item a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.submenu-item a:hover {
    color: var(--accent-color);
    background: rgba(217, 119, 6, 0.05);
    transform: translateX(3px);
}

.submenu-item.active a {
    color: var(--accent-color);
    background: rgba(217, 119, 6, 0.1);
    font-weight: 600;
}

.submenu-item.active a:hover {
    transform: none;
}

.submenu-icon {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

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

/* Navbar Styling */
.navbar {
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.15);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.logout-form {
    margin: 0;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    transform: translateY(-1px);
}

/* Main Content area */
.main-content {
    flex: 1;
    padding: 2.5rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .content-container {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
}

/* Messages/Alert Toast System */
.messages-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 48px);
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 16px -6px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
    animation: alert-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
}

.alert-error, .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #991b1b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1e40af;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #92400e;
}

.alert-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.alert-message {
    font-weight: 600;
    font-size: 0.925rem;
    flex-grow: 1;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: currentColor;
    opacity: 0.6;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

@keyframes alert-slide-in {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Hide spin buttons for input type number globally */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

