/**
 * GEOLMS Dashboard — Premium SaaS polish
 * Keeps orange theme; enhances spacing, typography, motion, and controls.
 */

/* ─── Base & layout ─── */
body {
    background: var(--background);
    background-image:
        radial-gradient(ellipse 120% 80% at 100% -20%, rgba(255, 126, 95, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(254, 180, 123, 0.06) 0%, transparent 50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* Fix legacy horizontal offset on employee dashboard */
.container .dashboard-header,
.container .dashboard-notice,
.container .minimalist-stats,
.container .section {
    width: 100% !important;
    max-width: 100% !important;
    left: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
}

/* ─── Navbar ─── */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border-color), var(--shadow-sm);
    padding: var(--space-3) 0;
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--border-color);
}

.nav-content h2 {
    font-size: clamp(0.75rem, 2vw, 1rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

/* ─── Page header (hero band) ─── */
.dashboard-header:not(.manager-content .dashboard-header) {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-6) var(--space-8);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #ffb347 0%, var(--primary) 48%, #e66f52 100%);
    color: var(--primary-foreground);
    box-shadow:
        0 4px 6px -1px rgba(255, 126, 95, 0.15),
        0 12px 28px -8px rgba(255, 102, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.dashboard-header:not(.manager-content .dashboard-header):hover {
    box-shadow:
        0 6px 10px -2px rgba(255, 126, 95, 0.18),
        0 16px 36px -10px rgba(255, 102, 0, 0.32);
}

.dashboard-header:not(.manager-content .dashboard-header) h1 {
    color: inherit;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 var(--space-1);
}

.dashboard-header:not(.manager-content .dashboard-header) p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.dashboard-header:not(.manager-content .dashboard-header) .btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--secondary-foreground);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
}

.dashboard-header:not(.manager-content .dashboard-header) .btn-secondary:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ─── Buttons (consistent SaaS set) ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(255, 126, 95, 0.35);
    border: 1px solid transparent;
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(255, 126, 95, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2xs);
}

.btn-secondary:hover {
    background: var(--muted);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-request-leave {
    border-radius: 999px;
    padding: 0.65em 1.25em;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(255, 126, 95, 0.35);
    border: none;
}

.btn-request-leave:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 126, 95, 0.45);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-success:hover,
.btn-danger:hover,
.btn-action:hover {
    transform: translateY(-1px);
}

/* ─── Stat cards ─── */
.stats-grid-compact {
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card,
.stat-card-compact {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.stat-card-compact:hover {
    border-color: rgba(255, 126, 95, 0.35);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-info-compact h3 {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
}

.stat-value-compact {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
}

/* Minimalist stats bar */
.minimalist-stats {
    background: var(--card) !important;
    border-radius: var(--radius-xl) !important;
    padding: var(--space-5) var(--space-6) !important;
    margin-bottom: var(--space-6) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow 0.3s ease;
}

.minimalist-stats:hover {
    box-shadow: var(--shadow-md);
}

.minimalist-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
}

.minimalist-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.minimalist-stat-divider {
    background: var(--border);
    opacity: 0.8;
}

/* ─── Sections & cards ─── */
.section {
    border-radius: var(--radius-xl) !important;
    padding: var(--space-6) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.section:hover {
    box-shadow: var(--shadow-md);
}

.section h2,
.section-scrollable h2,
.section-header h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--foreground);
}

.section-scrollable {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.section-scrollable h2 {
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(180deg, var(--muted) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.scrollable-list {
    padding: var(--space-4) var(--space-5);
}

/* ─── Leave cards ─── */
.leave-card,
.leaves-list-compact .leave-card,
.history-leave-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    border-left-width: 3px;
    box-shadow: var(--shadow-2xs);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.leave-card:hover,
.leaves-list-compact .leave-card:hover,
.history-leave-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 126, 95, 0.25);
}

.leave-card h3,
.leaves-list-compact .leave-card h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
}

.status-badge {
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: none;
    padding: 0.35em 0.75em;
}

/* ─── Admin / manager tabs ─── */
.admin-tabs-scroll {
    margin-bottom: var(--space-4);
    padding-bottom: 2px;
}

.admin-tabs {
    gap: var(--space-1);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    margin-bottom: var(--space-5);
}

.admin-tab {
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.admin-tab::after {
    display: none;
}

.admin-tab:hover {
    color: var(--primary);
    background: var(--primary-alpha-06);
}

.admin-tab.active {
    color: var(--primary);
    background: var(--card);
    border-bottom-color: var(--primary);
    box-shadow: 0 -2px 8px rgba(255, 126, 95, 0.08);
}

.tab-content-section.active {
    animation: geoFadeSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Segmented sub-tabs */
.tab-button,
.tab-button-small {
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}

.tab-button-small {
    padding: var(--space-2) var(--space-4);
    background: var(--muted);
    border: 1px solid transparent;
    color: var(--muted-foreground);
}

.tab-button-small:hover:not(.active) {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border);
}

.tab-button-small.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 126, 95, 0.3);
}

.tabs-container .tab-button.active {
    font-weight: 600;
}

/* Manager sidebar */
.manager-sidebar {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(180deg, var(--muted) 0%, var(--card) 100%);
}

.nav-item {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.nav-item:hover {
    transform: translateX(2px);
}

.nav-item.active {
    box-shadow: 0 2px 8px rgba(255, 126, 95, 0.25);
}

/* ─── Form controls ─── */
.form-group input,
.form-group select,
.form-group textarea,
.search-box input,
.filter-select,
#employeeSearchInput,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-box input:focus,
.filter-select:focus,
#employeeSearchInput:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

.search-filter-bar {
    gap: var(--space-3);
    align-items: stretch;
}

.search-box input {
    padding: var(--space-3) var(--space-4);
    padding-right: 2.5rem;
}

.filter-select {
    padding: var(--space-3) var(--space-4);
    background: var(--card);
}

/* ─── Calendar ─── */
.calendar-day {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.calendar-day:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
}

.calendar-day.today {
    box-shadow: inset 0 0 0 1px var(--primary);
}

/* ─── Modals & notifications ─── */
.notifications-modal-content {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.modal-content {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
}

/* Notification bell utility */
#notificationBell,
[id="notificationBell"] {
    border-radius: var(--radius-md) !important;
    background: var(--muted) !important;
    border: 1px solid var(--border) !important;
    transition: all 0.2s ease !important;
}

#notificationBell:hover,
[id="notificationBell"]:hover {
    background: var(--secondary) !important;
    border-color: var(--primary) !important;
    transform: scale(1.05);
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-4);
}

/* Empty states */
.empty-state p {
    color: var(--muted-foreground);
    font-size: 0.9375rem;
}

/* Scrollbars */
.scrollable-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: 999px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .dashboard-header:not(.manager-content .dashboard-header) {
        padding: var(--space-5);
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .dashboard-header:not(.manager-content .dashboard-header) > div:last-child {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-2);
    }

    .stats-grid-compact {
        grid-template-columns: 1fr 1fr;
    }

    .admin-tabs {
        gap: 0;
    }

    .admin-tab {
        padding: var(--space-3) var(--space-4);
        font-size: 0.8125rem;
    }

    .manager-sidebar .sidebar-nav {
        flex-wrap: wrap;
    }

    .nav-item:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .stats-grid-compact {
        grid-template-columns: 1fr;
    }
}

/* Employee leave tabs */
.employee-leave-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.leave-tab-btn {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    margin-bottom: -1px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.leave-tab-btn::after {
    display: none !important;
}

.leave-tab-btn:hover {
    color: var(--primary);
    background: var(--primary-alpha-06);
}

.leave-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--card);
}

.leave-tab-content.active {
    animation: geoFadeSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Manager content title */
#managerPageTitle {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    color: var(--foreground) !important;
}

.manager-content .dashboard-header {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: var(--space-5);
}

.manager-content .dashboard-header h1,
.manager-content .dashboard-header p {
    color: var(--foreground);
}

.manager-content .dashboard-header p {
    color: var(--muted-foreground);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .dashboard-header:hover,
    .stat-card-compact:hover,
    .leave-card:hover {
        transform: none;
    }
}
