:root {
    --bg-dark: #0f172a;
    --bg-darker: #0a1120;
    --card-bg: #1e293b;
    --card-bg-hover: #2d3748;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-green: #10b981;
    --accent-gold: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-light: rgba(255, 255, 255, 0.06);
    --section-radius: 16px;
    --card-radius: 12px;
    --transition-speed: 0.25s;
}

/* ========================================
   Base & Typography
   ======================================== */
body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Layout
   ======================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   Glass Card (Global)
   ======================================== */
.glass-card {
    background: radial-gradient(135deg, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.glass-card-premium {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-left: 4px solid var(--accent-blue);
}

/* ========================================
   Dashboard Sections
   ======================================== */
.dashboard-section {
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--section-radius);
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    animation: fadeInUp 0.4s ease-out both;
}

.dashboard-section:nth-child(2) {
    animation-delay: 0.05s;
}

.dashboard-section:nth-child(3) {
    animation-delay: 0.1s;
}

.dashboard-section:nth-child(4) {
    animation-delay: 0.15s;
}

.dashboard-section:nth-child(5) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header .section-title h5 {
    margin-bottom: 0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.section-header .section-title i {
    font-size: 1.15rem;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--glass-border-light);
    margin: 0.5rem 0 1.5rem;
    opacity: 0.6;
}

/* ========================================
   Stat Cards
   ======================================== */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

.stat-card .stat-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 4.5rem;
    opacity: 0.1;
    line-height: 1;
    filter: blur(1px);
    transition: all 0.5s ease;
}

.stat-card:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
    opacity: 0.15;
    filter: blur(0);
}

.stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.stat-card .stat-value {
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.2;
}

/* ========================================
   Tables
   ======================================== */
.table-premium {
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-premium thead th {
    background-color: transparent;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table-premium tbody tr {
    background-color: var(--card-bg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.table-premium tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    background-color: var(--card-bg-hover);
}

.table-premium td {
    padding: 1rem;
    border: none;
    vertical-align: middle;
}

.table-premium tbody tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-premium tbody tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ========================================
   Buttons
   ======================================== */
.btn-premium {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-premium:hover {
    filter: brightness(110%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    color: white;
}

/* ========================================
   Modals
   ======================================== */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.modal-header,
.modal-footer {
    border-color: var(--glass-border);
}

/* ========================================
   Forms
   ======================================== */
.form-control {
    background-color: var(--bg-darker);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-darker);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: 80px;
    height: 95vh;
    position: sticky;
    top: 2.5vh;
    left: 1rem;
    margin-right: 1rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.nav-link {
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   Marquee Alert
   ======================================== */
.marquee-container {
    flex: 1;
    overflow: hidden;
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    padding: 8px 0;
    margin-bottom: 20px;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
}

.marquee-text {
    white-space: nowrap;
    display: inline-block;
    animation: marquee 20s linear infinite;
    padding-left: 100%;
    font-size: 0.9rem;
    color: #ffcccc;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* ========================================
   Kanban Board
   ======================================== */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-behavior: smooth;
}

.kanban-column {
    min-width: 240px;
    flex: 1;
}

.kanban-header {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.kanban-date {
    padding: 0.25rem 0.5rem;
}

.kanban-card {
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
    border-radius: 10px;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.kanban-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.status-lead {
    border-top: 3px solid #6b7280;
}

.status-quotation {
    border-top: 3px solid #f59e0b;
}

.status-progress {
    border-top: 3px solid #3b82f6;
}

.status-done {
    border-top: 3px solid #10b981;
}

/* Kanban Scrollbar */
.kanban-board::-webkit-scrollbar {
    height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ========================================
   Team Performance Cards
   ======================================== */
.team-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: var(--card-radius);
}

.team-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Profile Page
   ======================================== */
.profile-avatar-upload {
    position: relative;
    display: inline-block;
}

.profile-avatar-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ========================================
   Notification Dropdown
   ======================================== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50px;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
    }
}

.notification-dropdown {
    width: 380px;
    max-width: 90vw;
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 8px !important;
}

.notif-header {
    background: rgba(30, 41, 59, 0.5);
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.notif-list::-webkit-scrollbar {
    width: 4px;
}

.notif-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.notif-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

.notif-item.notif-unread {
    background: rgba(59, 130, 246, 0.06);
}

.notif-item.notif-unread:hover {
    background: rgba(59, 130, 246, 0.12);
}

.notif-icon-circle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.notif-message {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.35;
    word-break: break-word;
}

.notif-item.notif-unread .notif-message {
    color: #ffffff;
    font-weight: 500;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--accent-blue);
    margin-top: 2px;
}

.notif-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    background: var(--accent-blue);
    margin-top: 6px;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

/* ========================================
   Chart Container
   ======================================== */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-height: 300px;
}

/* ========================================
   Responsive — Large Desktops (≤1200px)
   ======================================== */
@media (max-width: 1200px) {
    .kanban-column {
        min-width: 220px;
    }
}

/* ========================================
   Responsive — Tablets (≤992px)
   ======================================== */
@media (max-width: 992px) {
    .main-content {
        padding: 1.25rem;
    }

    .dashboard-section {
        padding: 1.25rem;
    }

    .stat-card .stat-value {
        font-size: 1.15rem;
    }

    .kanban-column {
        min-width: 200px;
    }
}

/* ========================================
   Responsive — Mobile Landscape (≤768px)
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

    .dashboard-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kanban-board {
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .kanban-column {
        min-width: 260px;
    }

    .stat-card .stat-value {
        font-size: 1rem;
    }

    .stat-card .stat-icon {
        font-size: 2.5rem;
    }
}

/* ========================================
   Responsive — Mobile Portrait (≤576px)
   ======================================== */
@media (max-width: 576px) {
    .main-content {
        padding: 0.75rem;
    }

    .dashboard-section {
        padding: 0.85rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }

    .section-header .section-title h5 {
        font-size: 0.82rem;
    }

    .kanban-column {
        min-width: 240px;
    }

    .kanban-card {
        padding: 0.7rem;
    }

    .stat-card .stat-value {
        font-size: 0.9rem;
    }

    .chart-container canvas {
        max-height: 220px;
    }
}

/* ========================================
   Filter Controls
   ======================================== */
.filter-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-controls .btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
}

.filter-controls .form-select {
    font-size: 0.78rem;
    padding: 0.3rem 2rem 0.3rem 0.6rem;
}

/* ========================================
   Status Highlight
   ======================================== */
.status-highlight-green {
    box-shadow: inset 4px 0 0 var(--accent-green);
}

.status-highlight-gold {
    box-shadow: inset 4px 0 0 var(--accent-gold);
}