@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Playfair+Display:wght@700&display=swap');

:root {
    --primary-color: #28a745;
    --primary-dark: #1e7e34;
    --primary-light: #4caf50;
    --accent-green: #00c853;
    --sidebar-width: 250px;
    --gray-bg: #f7fafc;
    --sidebar-bg: #fff;
    --sidebar-border: #e9ecef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', Arial, sans-serif;
    background: var(--gray-bg);
}

.dashboard-wrapper { 
    display: flex; 
    min-height: 100vh; 
}

/* ========== TOP NAVIGATION ========== */
.top-navigation {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    z-index: 1000;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-bg);
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    background: var(--gray-bg);
}

/* ========== MAIN LOGO ========== */
.main-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 5rem auto 3rem;
    text-align: center;
}

.main-logo .app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.main-logo .logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Playfair Display', serif;
}

/* ========== SIDEBAR STYLES ========== */
.sidebar {
    width: var(--sidebar-width); 
    background: var(--sidebar-bg);
    min-height: 100vh; 
    height: 100vh;
    position: fixed; 
    left: 0; 
    top: 0; 
    z-index: 1001;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 0 2px 12px rgba(40,167,69,0.08);
    transition: transform 0.3s cubic-bezier(.46,.03,.52,.96);
    overflow-y: auto;
}

/* Sidebar hidden state for desktop */
.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid #f1f3f4; 
    min-height: 66px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.logo { 
    display: flex; 
    align-items: center;
    gap: 0.8rem;
}

.app-logo { 
    height: 38px; 
    width: 38px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.logo-text { 
    font-weight: 700; 
    color: var(--primary-dark); 
    font-family: 'Playfair Display', serif; 
    font-size: 1.15rem;
}

.sidebar-close { 
    display: none; 
    background: none; 
    border: none; 
    color: var(--primary-color); 
    font-size: 1.6rem;
    cursor: pointer;
}

.sidebar-content { 
    padding: 1rem 0;
}

.menu-section { 
    margin-bottom: 1.5rem;
}

.menu-title { 
    font-size: 0.8rem; 
    font-weight: 600; 
    color: #adb5bd; 
    padding: 0.5rem 1rem; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item { 
    margin-bottom: 0.18rem;
    padding: 0 0.5rem;
}

.menu-link {
    display: flex; 
    align-items: center; 
    gap: 0.9rem;
    padding: 0.7rem 1rem; 
    color: #343a40; 
    border-radius: 0.5rem;
    font-weight: 500; 
    text-decoration: none; 
    transition: all 0.12s;
}

.menu-link:hover, 
.menu-item.active .menu-link { 
    background: #d4f4d9; 
    color: var(--primary-dark);
}

.menu-link i { 
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.external-icon { 
    margin-left: auto; 
    opacity: 0.7;
    font-size: 0.85rem;
}

/* ========== MAIN CONTENT STYLES ========== */
.main-content { 
    margin-left: var(--sidebar-width); 
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background: var(--gray-bg);
    transition: margin-left 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2rem;
    margin-top: 4rem;
}

/* Main content when sidebar is hidden */
.main-content.sidebar-hidden {
    margin-left: 0;
    width: 100%;
}

/* ========== TOP BAR WITH TOGGLE BUTTON ========== */
.top-bar {
    width: 100%; 
    min-height: 66px; 
    display: flex; 
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem; 
    background: #fff; 
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.04); 
    position: sticky; 
    top: 0; 
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Desktop Sidebar Toggle Button */
.desktop-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.desktop-sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.desktop-sidebar-toggle:active {
    transform: scale(0.95);
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle { 
    display: none;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
}

/* User Dropdown Styles */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #343a40;
}

.user-dropdown-toggle:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.user-dropdown-toggle i.fa-user-circle {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.username-display {
    font-size: 0.95rem;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.user-dropdown-toggle:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Trade page: reduce fonts inside summary cards by 50% */
.trade-card {
    transform: scale(1.4);
    transform-origin: center;
    display: block;
    margin: 0; /* rely on grid gap for spacing */
    padding: 0.25rem;
    z-index: 2;
    will-change: transform;
}

/* Ensure grid rows on pages allow wider gaps for visual separation (trade page) */
.page-content .row.g-4 {
    gap: 20px !important;
}

/* Make each column flex so the card stretches and the added margin takes effect */
.page-content .col-md-3 {
    display: flex;
    align-items: stretch;
    flex: 1 1 calc(25% - 5px) !important;
    min-width: 0;
}

.page-content .col-md-3 > .card {
    width: 100%;
}

/* Ensure all 4 cards stay on one line */
.page-content .row.g-4 {
    flex-wrap: nowrap !important;
}

.trade-card .card-body {
    padding: 1.8rem;
}

.trade-card > .card {
    min-height: 420px;
    width: 100%;
}

.trade-card .card-body h3 {
    font-size: 60% !important;
    line-height: 1.02;
}
.trade-card .card-body h6 {
    font-size: 60% !important;
}
.trade-card .card-body p {
    font-size: 60% !important;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar-large {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.2rem;
}

.user-role {
    font-size: 0.85rem;
    color: #6c757d;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: #dc3545;
    text-decoration: none;
    transition: background 0.2s;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    font-size: 1rem;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 2rem 1rem; /* keep some space around but not huge blank areas */
    width: 100%;
    max-width: none;
}

.page-content h2 {
    font-size: 3.4rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* ========== DASHBOARD HERO SECTION ========== */
.dashboard-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 1rem;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.15);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dashboard-logo {
    height: 80px;
    width: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 8px;
}

.hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ========== WIDGETS CONTAINER ========== */
.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== WIDGET CARD STYLES ========== */
.trade-card {
    transform: scale(1.25);
    transform-origin: center;
    display: block;
    margin: 0.5rem;
    z-index: 2;
    will-change: transform;
}
.trade-card .card-body h3 {
    font-size: 60% !important;
}
.trade-card .card-body h6 {
    font-size: 60% !important;
}
.trade-card .card-body p {
    font-size: 60% !important;
}
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.widget-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.widget-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin: 0;
}

.widget-body {
    padding: 0.5rem 0;
}

/* ========== CLOCK WIDGET ========== */
.clock-display {
    text-align: center;
    padding: 1rem;
}

.clock-time {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Inter', monospace;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.clock-date {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

/* ========== CALENDAR WIDGET ========== */
.calendar-container {
    width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-month-year {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin: 0;
}

.calendar-nav-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.4rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    font-weight: 500;
    color: #343a40;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:not(.empty):hover {
    background: #f8f9fa;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
}

/* ========== MOBILE OVERLAY ========== */
.mobile-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(11, 50, 7, 0.13); 
    z-index: 1000;
}

.mobile-overlay.active { 
    display: block; 
}

/* ========== LOGIN PAGE STYLES ========== */
.login-bg {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(120deg, rgba(8, 22, 15, 0.58) 0%, rgba(12, 37, 24, 0.48) 42%, rgba(7, 18, 13, 0.72) 100%),
        url('/static/360_F_788946800_EEW8evA2AElFTBxoQJ6yyggKAJjXGh1G.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.18), transparent 22%),
        radial-gradient(circle at 82% 16%, rgba(118, 255, 188, 0.16), transparent 18%),
        radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.12), transparent 28%);
    pointer-events: none;
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.login-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-glass-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 30px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    padding: 2.8rem 2.5rem 2.4rem;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    animation: cardSlideIn 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.26);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-panel-intro {
    text-align: center;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
    color: #effef6;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-logo {
    height: 86px;
    width: 86px;
    object-fit: cover;
    margin-bottom: 1.35rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 16px 38px rgba(5, 18, 11, 0.26);
    animation: logoFloat 3s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.82);
    padding: 8px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-desc {
    color: rgba(242, 249, 245, 0.84);
    margin-bottom: 2rem;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.6;
}

.login-alert-stack,
.login-form {
    width: 100%;
}

.login-alert-stack .alert {
    border: none;
    border-radius: 16px;
    margin-bottom: 1rem;
    backdrop-filter: blur(14px);
}

.login-field {
    margin-bottom: 1rem;
}

.login-form-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #f7fffa;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.input-icon {
    position: relative;
    width: 100%;
}

.input-icon i {
    position: absolute; 
    left: 1rem; 
    top: 51%; 
    transform: translateY(-50%);
    color: rgba(22, 101, 52, 0.82);
    font-size: 1.15rem;
    transition: all 0.3s ease;
    z-index: 1;
}

.login-glass-card .form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 1.05rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-height: 58px;
    color: #10231a;
}

.login-glass-card .form-control::placeholder {
    color: #688073;
}

.login-glass-card .form-control:focus {
    outline: none;
    border-color: rgba(134, 239, 172, 0.72);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 4px rgba(95, 208, 138, 0.14);
}

.btn-login-modern {
    width: 100%;
    padding: 1rem 1.05rem;
    background: linear-gradient(135deg, #1f9d55 0%, #116530 100%);
    color: #fff; 
    font-weight: 700;
    border: none; 
    border-radius: 16px; 
    font-size: 1rem;
    cursor: pointer; 
    transition: all 0.3s ease;
    margin-top: 0.35rem;
    box-shadow: 0 16px 34px rgba(17, 101, 48, 0.34);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    overflow: hidden;
}

.btn-login-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(17, 101, 48, 0.42);
}

.btn-login-modern:active {
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(17, 101, 48, 0.3);
}

.login-password-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.15rem 0 1.4rem;
    color: rgba(243, 250, 246, 0.88);
}

.login-password-row .form-check {
    margin: 0;
}

.login-password-row .form-check-input {
    margin-top: 0.2rem;
    border-color: rgba(255, 255, 255, 0.45);
    background-color: rgba(255, 255, 255, 0.1);
}

.login-password-row .form-check-input:checked {
    background-color: #1f9d55;
    border-color: #1f9d55;
}

.login-password-row .form-check-label {
    color: rgba(243, 250, 246, 0.88);
}

.login-footer { 
    margin-top: 2.5rem; 
    color: #777;
    font-size: 0.95rem; 
    text-align: center;
    font-weight: 500;
}

.alert {
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 900px) {
    .sidebar { 
        width: 84vw; 
        max-width: 330px; 
        transform: translateX(-100%);
    }

    .sidebar.mobile-open { 
        transform: translateX(0);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .sidebar-close { 
        display: block; 
    }

    .main-content { 
        margin-left: 0;
        width: 100%;
    }

    .main-content.sidebar-hidden {
        margin-left: 0;
        width: 100%;
    }

    .desktop-sidebar-toggle {
        display: none;
    }

    .mobile-sidebar-toggle { 
        display: flex;
    }

    .top-bar {
        padding: 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .dashboard-hero {
        padding: 2rem 1.5rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .widgets-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .dashboard-logo {
        height: 60px;
        width: 60px;
    }

    .clock-time {
        font-size: 2rem;
    }

    .clock-date {
        font-size: 0.95rem;
    }

    .username-display {
        display: none;
    }

    .user-dropdown-toggle {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .login-bg { 
        padding: 1rem; 
    }

    .login-glass-card { 
        padding: 2rem 1.25rem; 
        max-width: 100%;
        border-radius: 24px;
    }

    .login-logo { 
        height: 70px; 
        width: 70px;
    }

    .login-title {
        font-size: 1.8rem;
    }

    .login-desc {
        font-size: 0.95rem;
    }

    .login-glass-card .form-control {
        font-size: 1rem;
        padding: 0.9rem 0.9rem 0.9rem 2.8rem;
    }

    .btn-login-modern {
        font-size: 1rem;
        padding: 0.95rem;
    }
}
/* ========== HR NAVIGATION WITH HAMBURGER MENU ========== */

.hr-navigation-container {
    position: relative;
    margin-bottom: 2rem;
}

/* Mobile Hamburger Toggle Button */
.hr-mobile-toggle {
    display: none;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.hr-mobile-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.hr-mobile-toggle.active i {
    transform: rotate(90deg);
}

.hr-mobile-toggle:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7430 100%);
}

/* HR Tab Navigation */
.hr-tab-navigation {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.hr-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid transparent;
    white-space: nowrap;
}

.hr-tab:hover {
    background: #e9ecef;
    color: #28a745;
}

.hr-tab.active {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border-color: #1e7e34;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.hr-tab i {
    font-size: 1.1rem;
}

/* HR Content Area */
.hr-content-area {
    width: 100%;
}

/* HR Section Header */
.hr-section-header {
    margin-bottom: 2rem;
}

.hr-section-header h1 {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hr-section-header h1 i {
    font-size: 1.8rem;
}

.hr-section-header p {
    color: #6c757d;
    font-size: 1.05rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #20c997 0%, #198754 100%);
    color: white;
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.stat-danger .stat-icon {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    color: white;
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 1.8rem;
    margin: 0 0 0.3rem 0;
    color: #343a40;
    font-weight: 700;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
}

/* Charts Grid - 2 Column Layout for Desktop */
.charts-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-full {
    grid-column: 1 / -1;
}

.chart-title {
    color: #343a40;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.chart-container {
    width: 100%;
    overflow: visible;
}

/* Plotly chart responsiveness */
.chart-container .plotly {
    width: 100% !important;
    height: auto !important;
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-form label {
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-select {
    padding: 0.7rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    background: white;
    min-width: 200px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    max-width: 100%;
}

.search-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s;
}

.search-group:focus-within {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.search-icon {
    padding: 0 1rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 0.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    min-width: 0;
}

.btn-search {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-search:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7430 100%);
}

/* Table Card */
.table-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.table-title {
    color: #343a40;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

.data-table thead {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

.text-muted {
    color: #6c757d;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 28px;
    background: #e9ecef;
    border-radius: 0.4rem;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-radius: 0.4rem;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: #343a40;
    font-size: 0.85rem;
}

/* Employee Detail Card */
.employee-detail-card {
    background: white;
    padding: 2rem;
    border-radius: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.emp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.emp-header h3 {
    color: #28a745;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.emp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}

.emp-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.emp-info label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emp-info span {
    color: #343a40;
    font-size: 1rem;
    word-break: break-word;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    font-size: 4rem;
    color: #e9ecef;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Desktop: Keep side-by-side charts */
@media (min-width: 1200px) {
    .charts-grid-2col {
        grid-template-columns: 1fr 1.5fr;
    }

    .chart-container {
        max-height: 450px;
    }
}

/* Tablet (768px to 1199px) */
@media (max-width: 1199px) {
    .charts-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    /* Show hamburger button */
    .hr-mobile-toggle {
        display: flex;
    }

    /* Hide navigation by default */
    .hr-tab-navigation {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
        border: none;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        margin-top: 0.5rem;
    }

    /* Show navigation when active */
    .hr-tab-navigation.mobile-open {
        display: flex;
    }

    .hr-tab {
        width: 100%;
        padding: 1rem 1.5rem;
        border-radius: 0.3rem;
    }

    .hr-section-header h1 {
        font-size: 1.5rem;
    }

    .hr-section-header h1 i {
        font-size: 1.4rem;
    }

    .hr-section-header p {
        font-size: 0.95rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.2rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    .charts-grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-title {
        font-size: 1rem;
    }

    .emp-grid {
        grid-template-columns: 1fr;
    }

    .form-select {
        width: 100%;
        min-width: 0;
    }

    .table-card {
        padding: 1rem;
    }
}

/* Phone (480px and below) */
@media (max-width: 480px) {
    .hr-mobile-toggle {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .hr-section-header {
        margin-bottom: 1.5rem;
    }

    .hr-section-header h1 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hr-section-header p {
        font-size: 0.85rem;
        text-align: center;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .stat-icon {
        margin: 0 auto;
    }

    .chart-card {
        padding: 0.8rem;
    }

    .chart-title {
        font-size: 0.95rem;
    }

    .search-input {
        font-size: 0.9rem;
    }

    .btn-search {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .table-card {
        padding: 0.8rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .data-table {
        font-size: 0.85rem;
        min-width: 500px;
    }

    .data-table th,
    .data-table td {
        padding: 0.7rem 0.5rem;
    }

    .employee-detail-card {
        padding: 1.2rem;
    }

    .emp-header h3 {
        font-size: 1.2rem;
    }
}
