:root {
    --primary: #1B2A4A;
    --primary-light: #2C4070;
    --primary-dark: #0F1A30;
    --accent: #E8B931;
    --accent-hover: #D4A72A;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --top-bar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 1rem;
}

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

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.logo-container {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-size: 2rem;
    color: var(--accent);
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.login-header .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.9rem;
}

.login-body {
    padding: 2rem;
    text-align: center;
}

.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-microsoft:hover {
    border-color: var(--primary);
    background: #f8f9fa;
    color: var(--primary);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #aaa;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
}

.demo-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.demo-note {
    font-size: 0.75rem;
    color: #999;
    margin-top: 1rem;
    margin-bottom: 0;
}

.login-footer {
    background: var(--primary);
    padding: 1.2rem;
    text-align: center;
}

.footer-logo {
    height: 30px;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin: 0;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-info div {
    display: none;
}

.sidebar-header {
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    margin: 2px 8px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info i {
    font-size: 1.3rem;
}

.user-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-role {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
}

.btn-logout {
    color: rgba(255, 255, 255, 0.6);
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.top-bar {
    height: var(--top-bar-height);
    background: white;
    border-bottom: 1px solid #e8ecf0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary);
}

.top-bar-right {
    margin-left: auto;
}

.sidebar-toggle {
    color: var(--primary);
    font-size: 1.3rem;
    padding: 0.3rem;
}

.content-area {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8ecf0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
}

.stat-info p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

/* Cards */
.card {
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e8ecf0;
    padding: 1rem 1.2rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h5 {
    color: var(--primary);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Tables */
.table th {
    background: #f8f9fa;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8ecf0;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

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

    .main-content {
        margin-left: 0;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Hamburger view switcher menu */
.sidebar-toggle.dropdown-toggle::after {
    display: none;
}

.sidebar-toggle.dropdown-toggle {
    padding: 0.3rem;
    text-decoration: none;
}

.top-bar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 160px;
    margin-top: 0.5rem;
}

.top-bar .dropdown-menu .dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--primary);
}

.top-bar .dropdown-menu .dropdown-item.active {
    background-color: var(--primary);
    color: white;
}

.top-bar .dropdown-menu .dropdown-item:hover:not(.active) {
    background-color: #f0f4f8;
    color: var(--primary);
}

/* Layout without sidebar */
.main-content {
    margin-left: 0;
    width: 100%;
}

.top-bar {
    gap: 0.5rem;
}

.top-user {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
}

.top-user > i {
    font-size: 1.4rem;
    color: var(--primary);
}

.top-user-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--primary);
    white-space: nowrap;
}

.top-user-role {
    display: block;
    font-size: 0.7rem;
    color: #7a8699;
    line-height: 1.15;
}

.top-bar .dropdown-menu .dropdown-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7a8699;
}

.top-bar .dropdown-menu .dropdown-item i {
    width: 18px;
    margin-right: 0.35rem;
}

@media (max-width: 576px) {
    .top-user-name {
        white-space: normal;
    }
}
