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

:root {
    /* Harmony Light HSL Palette */
    --bg-dark: hsl(0, 0%, 97%);
    --bg-deep: hsl(0, 0%, 100%);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-active: rgba(0, 0, 0, 0.03);
    --border-glass: rgba(0, 0, 0, 0.07);
    --border-glass-bright: rgba(0, 0, 0, 0.12);
    
    --accent-emerald: hsl(142, 76%, 36%);
    --accent-emerald-glow: hsla(142, 76%, 36%, 0.1);
    --accent-blue: hsl(217, 91%, 46%);
    --accent-blue-glow: hsla(217, 91%, 46%, 0.1);
    --accent-purple: hsl(263, 70%, 46%);
    --accent-rose: hsl(350, 80%, 45%);
    
    --text-primary: hsl(222, 47%, 11%);
    --text-secondary: hsl(215, 20%, 35%);
    --text-muted: hsl(215, 16%, 55%);
    
    --font-primary: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --shadow-emerald: 0 4px 20px -2px hsla(142, 76%, 36%, 0.2);
    --shadow-blue: 0 4px 20px -2px hsla(217, 91%, 46%, 0.2);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
.bg-gradient-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, var(--bg-dark) 0%, var(--bg-deep) 100%);
}

.bg-gradient-orbs::before,
.bg-gradient-orbs::after {
    content: '';
    position: absolute;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.05;
    animation: float 20s infinite alternate ease-in-out;
}

.bg-gradient-orbs::before {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.bg-gradient-orbs::after {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-rose));
    bottom: -15%;
    left: -5%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        transform: translate(50px, 80px) rotate(180deg) scale(1.15);
    }
}

/* Utility Animations */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Glassmorphic Components */
.glass-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(0, 0, 0, 0.08);
}

.glass-card {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 24px;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-glass-bright);
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-3px);
}

/* Auth Pages Container */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-logo .brand-icon {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Custom Role Select Toggle */
.role-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 30px;
    position: relative;
}

.role-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
    transition: var(--transition-smooth);
    border-radius: 25px;
}

.role-tab.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-glow));
    box-shadow: var(--shadow-emerald);
}

.role-tab-blue.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-glow));
    box-shadow: var(--shadow-blue);
}

/* Inputs & Form Controls */
.form-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 15px -3px var(--accent-emerald-glow);
    background: #ffffff;
}

.form-control:focus ~ .input-icon {
    color: var(--accent-emerald);
}

.form-control-blue:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px -3px var(--accent-blue-glow);
}

.form-control-blue:focus ~ .input-icon {
    color: var(--accent-blue);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-primary {
    background: var(--accent-emerald);
    color: #fff;
    box-shadow: var(--shadow-emerald);
}

.btn-primary:hover {
    background: #0d7f52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-rose);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-2px);
}

/* Unified Dashboard Shell Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    z-index: 1;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
    transition: var(--transition-smooth);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-logo .brand-icon {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: var(--transition-smooth);
}

.sidebar-link i {
    font-size: 1.15rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-link:hover i {
    color: var(--text-primary);
}

.sidebar-link.active {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--accent-emerald);
}

.sidebar-link-blue.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    font-weight: 600;
}

.sidebar-link-blue.active i {
    color: var(--accent-blue);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

/* Top Header Bar */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.metric-icon {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.metric-card.card-blue .metric-icon {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.metric-card.card-purple .metric-icon {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-purple);
}

.metric-card.card-rose .metric-icon {
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-rose);
}

.metric-card:hover .metric-icon {
    transform: scale(1.05);
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.1;
}

.metric-trend {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-trend.trend-up {
    color: var(--accent-emerald);
}

/* Data Tables */
.table-panel {
    padding: 0;
    overflow: hidden;
    margin-bottom: 40px;
}

.table-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: rgba(0, 0, 0, 0.02);
    padding: 16px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
    padding: 16px 24px;
    font-size: 0.92rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition-fast);
}

.custom-table tbody tr {
    transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.01);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-rose);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Forms & Dialog Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    width: 100%;
    max-width: 550px;
    padding: 30px;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Interactive Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: rgba(10, 16, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-emerald);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 320px;
    max-width: 420px;
    color: #ffffff;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    transform: translateX(100px);
    opacity: 0;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-error {
    border-left-color: var(--accent-rose);
}

.toast.toast-info {
    border-left-color: var(--accent-blue);
}

@keyframes toastSlideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Actions Row for Filters */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 30px;
}

.filter-control {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.filter-control:focus {
    border-color: var(--accent-emerald);
}

.filter-control option {
    background: #ffffff;
    color: var(--text-primary);
}

/* Responsive Styles */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .mobile-nav-toggle {
        display: flex !important;
    }
}

/* Hamburger mobile menu button */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}

/* Simulator Grid panel in Dashboards */
.simulator-panel {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--accent-emerald);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.simulator-title {
    color: var(--accent-emerald);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Interactive Warehouse click-through link */
.wh-link {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.wh-link:hover {
    color: var(--accent-emerald) !important;
    text-decoration: underline !important;
}
