/* Variables & Color Palette - Modern Premium Aesthetics */
:root {
    --primary: #0f172a;
    --primary-hover: #1e293b;
    --accent: #c45000;
    --accent-hover: #a84400;
    --accent-light: #fff5eb;
    --secondary: #f1f5f9;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-secondary: #475569;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #8a3500 0%, #6b2a00 100%);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px 24px;
}

.sidebar-logo-img {
    width: 150px;
    height: auto;
    object-fit: contain;
}

.nav-list {
    list-style: none;
    flex: 1;
    padding: 0 8px;
}

.nav-list li {
    margin: 3px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    border-radius: 10px;
    transition: var(--transition);
    gap: 11px;
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    letter-spacing: 0.01em;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}

.nav-link.active {
    background-color: rgba(255,255,255,0.12);
    color: white;
    font-weight: 600;
    box-shadow: none;
    border-left: 3px solid #fff;
    padding-left: 11px;
}

.nav-link .icon {
    font-size: 18px;
    opacity: 0.85;
}

.nav-link.active .icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 500;
}

.user-info i {
    font-size: 18px;
}

.sidebar-footer .btn-outline {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    padding: 7px 14px;
    border-radius: 8px;
}

.sidebar-footer .btn-outline:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.top-header {
    height: 64px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-main);
}

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

.time-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--secondary);
    padding: 7px 14px;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

/* Views Container */
.views-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: rgba(226, 232, 240, 0.9);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.stat-icon.accent { background-color: var(--accent-light); color: var(--accent); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.info { background-color: var(--info-light); color: var(--info); }
.stat-icon.purple { background-color: var(--purple-light); color: var(--purple); }

.stat-details {
    flex: 1;
    min-width: 0;
}

.stat-details h3 {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

/* Tables & Cards */
.table-card, .form-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.table-card:hover, .form-card:hover {
    box-shadow: var(--shadow-md);
}

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

.view-header {
    background: transparent;
    padding: 0 0 24px 0;
    border: none;
}

.card-header h2, .view-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    background-color: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table td {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 400;
}

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

.data-table tbody tr:hover {
    background-color: #fafbfc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-paid {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-pending {
    background-color: var(--warning-light);
    color: #b45309;
}

.btn-mark-paid {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--success);
    color: var(--success);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    transition: var(--transition);
}

.btn-mark-paid:hover {
    background: var(--success);
    color: white;
}

/* UI Elements */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(196, 80, 0, 0.2);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(196, 80, 0, 0.3);
    transform: translateY(-1px);
}

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--secondary);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-danger { background-color: var(--danger); color: white; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background-color: #dc2626; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); transform: translateY(-1px); }

.btn-icon-only {
    padding: 8px;
    font-size: 18px;
}

.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 400;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 80, 0, 0.08);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

select.form-control {
    cursor: pointer;
}

.mt-sm { margin-top: 8px; }

/* Form Layout */
.form-body {
    padding: 28px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.required {
    color: var(--danger);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active {
    display: block;
    transform: translateY(0);
    animation: modalSlideUp 0.25s ease forwards;
}

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

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

.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }

.modal-body { padding: 24px; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Authentication UI */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #6b2a00 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.auth-overlay.active { display: flex; }

.app-wrapper { display: flex; width: 100%; height: 100%; }

.auth-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 44px 36px;
    border-radius: 24px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(226, 232, 240, 0.1);
}

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

.auth-logo-img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    margin-bottom: 16px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: white;
}

.auth-header h2 { font-size: 24px; color: var(--text-main); margin-bottom: 8px; font-weight: 700; }
.auth-header p { font-size: 14px; color: var(--text-muted); }

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.4s ease forwards; }

/* Text colors */
.text-danger { color: var(--danger); font-weight: 600; }

/* Team Welcome Section (Team Members) */
.team-welcome {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 0;
}

.welcome-header {
    margin-bottom: 32px;
    text-align: center;
}

.welcome-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.welcome-header p {
    font-size: 15px;
    color: var(--text-muted);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.quick-link-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.quick-link-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 2px solid var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quick-link-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.quick-link-card:hover::after {
    opacity: 1;
}

.quick-link-card:active {
    transform: translateY(-2px) scale(0.99);
}

.ql-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--accent-light);
    color: var(--accent);
    margin: 0 auto 16px;
}

.ql-icon.accent {
    background: #dbeafe;
    color: #2563eb;
}

.quick-link-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.quick-link-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Filter Bars */
.filter-bar, .date-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.filter-btn, .date-filter-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .date-filter-btn:hover {
    background: var(--secondary);
    color: var(--text-main);
}

.filter-btn.active, .date-filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.custom-date-input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.custom-date-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

/* Date Range Container */
.date-range-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-range-sep {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Mobile Logout Item - hidden on desktop */
.mobile-logout-item {
    display: none !important;
}

/* Filter Separator */
.filter-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

/* Period Dropdown */
.period-dropdown-wrapper {
    position: relative;
}

.period-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.period-dropdown-btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.period-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    min-width: 180px;
    padding: 6px;
    animation: fadeIn 0.2s ease forwards;
}

.period-dropdown.open {
    display: block;
}

.period-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.period-option:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.period-option.active {
    background: var(--accent);
    color: white;
}

.period-daterange {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    flex-wrap: wrap;
}

.period-daterange .custom-date-input {
    width: 130px;
    font-size: 12px;
    padding: 5px 8px;
}

/* Amount Fields */
.amount-fields {
    background: var(--secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.amount-preview {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid var(--border);
    display: none;
}

.amount-preview.visible {
    display: block;
}

.amount-preview .paid-amount {
    color: var(--success);
}

.amount-preview .remaining-amount {
    color: var(--danger);
}

/* Payment Info in Table */
.payment-info {
    font-size: 12px;
    line-height: 1.6;
}

.payment-info .paid {
    color: var(--accent);
    font-weight: 600;
}

.payment-info .remaining {
    color: var(--danger);
    font-weight: 600;
}

/* Searchable Country Dropdown */
.searchable-dropdown {
    position: relative;
}

.searchable-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 60;
    box-shadow: var(--shadow-md);
}

.searchable-dropdown-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.searchable-dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Wider Modal for Edit Customer */
.modal.modal-wide {
    max-width: 600px;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Table Action Buttons */
.edit-customer-btn,
.delete-customer-btn,
.delete-followup-btn {
    padding: 6px 8px;
    font-size: 14px;
    margin: 0 2px;
}

/* Responsive */
/* Hamburger Button & Close Button - Hidden on Desktop */
.hamburger-btn,
.sidebar-close-btn {
    display: none;
}

/* Sidebar top row (logo + close btn) */
.sidebar-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Sidebar Backdrop - Hidden on Desktop */
.sidebar-backdrop {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hamburger button visible on mobile */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 50;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        border: none;
        background: #9a3c00;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        transition: all 0.3s ease;
    }

    .hamburger-btn:hover {
        background: var(--accent-hover);
    }

    /* Hide hamburger when sidebar is open */
    .hamburger-btn.hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Sidebar close button visible on mobile */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        background: rgba(255,255,255,0.15);
        color: #fff;
        font-size: 22px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .sidebar-close-btn:hover {
        background: rgba(255,255,255,0.25);
    }

    /* Sidebar as slide-in overlay on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 270px;
    }

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

    /* Backdrop overlay */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Main content full width */
    .main-content {
        width: 100%;
    }

    /* Top header adjustments */
    .top-header {
        padding: 0 16px 0 70px;
    }

    .header-title h1 {
        font-size: 18px;
    }

    .views-container { padding: 20px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .quick-links-grid { grid-template-columns: 1fr; }
    .filter-bar, .date-filter-bar { flex-wrap: wrap; }

    /* Mobile logout item visible */
    .mobile-logout-item {
        display: block !important;
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-logout-item .nav-link {
        color: rgba(255,255,255,0.7);
    }

    .mobile-logout-item .nav-link:hover {
        background-color: rgba(239, 68, 68, 0.2);
        color: #ef4444;
    }

    /* Make nav-list flex column so logout pushes to bottom */
    .nav-list {
        display: flex;
        flex-direction: column;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .quick-links-grid { grid-template-columns: 1fr; }
    .top-header { padding: 0 12px 0 64px; }
    .header-title h1 { font-size: 16px; }
}

/* ========== FEATURE 4: Clickable Stat Cards ========== */
.stat-card-clickable {
    cursor: pointer;
    position: relative;
}

.stat-card-clickable:hover {
    border-color: rgba(196, 80, 0, 0.2);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

/* ========== FEATURE 5: Notification System ========== */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-btn:hover {
    background: var(--secondary);
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    z-index: 200;
    overflow: hidden;
    animation: dropdownFade 0.2s ease forwards;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-dropdown.open {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent-light), #fff);
}

.notif-dropdown-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.notif-count-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 20px;
}

.notif-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.notif-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 14px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--accent-light);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--warning-light);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.notif-item-detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notif-item-detail strong {
    color: var(--danger);
}

.notif-mark-read {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

.notif-mark-read:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Notification Popup Modal */
.notif-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.notif-popup {
    background: var(--bg-card);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: popupSlide 0.3s ease forwards;
}

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

.notif-popup-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.notif-popup-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-popup-header .close-btn {
    color: white;
    font-size: 24px;
}

.notif-popup-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.notif-popup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--secondary);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.notif-popup-item:last-child {
    margin-bottom: 0;
}

.notif-popup-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--warning-light);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.notif-popup-item-content {
    flex: 1;
}

.notif-popup-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 3px;
}

.notif-popup-item-detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.notif-popup-item-detail strong {
    color: var(--danger);
}

/* ========== FEATURE 6: Target Display Bar ========== */
.target-display-bar {
    background: linear-gradient(135deg, var(--accent) 0%, #a84400 100%);
    color: white;
    padding: 0 32px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.2px;
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.target-display-bar i {
    font-size: 18px;
}

.target-bar-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 0 3px 3px 0;
    transition: width 0.6s ease;
}

/* Set Targets Page */
.targets-user-list {
    margin-bottom: 24px;
}

.target-user-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    background: var(--secondary);
    transition: var(--transition);
}

.target-user-row:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.target-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.target-user-info {
    flex: 1;
    min-width: 0;
}

.target-user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.target-user-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
    margin-top: 4px;
}

.perm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.perm-badge-revenue {
    background: rgba(211, 84, 0, 0.1);
    color: var(--accent);
}

.perm-badge-followup {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.target-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.target-input-group span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.target-input {
    width: 140px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-main);
}

.target-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

.target-date-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Achievements Page */
.achievements-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: fit-content;
}

.ach-toggle-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
}

.ach-toggle-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.3);
}

.ach-toggle-btn:hover:not(.active) {
    background: var(--secondary);
    color: var(--text-main);
}

.ach-section {
    display: none;
}

.ach-section.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

.ach-today-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.ach-today-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.ach-today-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.ach-progress-container {
    margin-bottom: 16px;
}

.ach-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ach-progress-achieved {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.ach-progress-target {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    align-self: flex-end;
}

.ach-progress-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--secondary);
    border-radius: 6px;
    overflow: hidden;
}

.ach-progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), #e67e22);
    border-radius: 6px;
    transition: width 0.6s ease;
    min-width: 0%;
}

.ach-badge-completed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.ach-badge-in-progress {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--warning-light);
    color: var(--warning);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.ach-no-target {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 14px;
}

.ach-history {
    margin-top: 8px;
}

.ach-history h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.ach-history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.ach-history-item:hover {
    box-shadow: var(--shadow-sm);
}

.ach-history-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 100px;
}

.ach-history-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ach-history-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
}

.ach-history-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), #e67e22);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.ach-history-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    min-width: 120px;
    text-align: right;
}

/* Team Achievements */
.ach-team-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ach-team-filter label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.ach-team-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.ach-team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.ach-team-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ach-team-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ach-team-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.ach-team-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.ach-team-role-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
}

.ach-team-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ach-team-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.ach-team-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

/* Responsive additions */
@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed;
        top: 70px;
        left: 16px;
        right: 16px;
        width: auto;
        max-height: 70vh;
        border-radius: 14px;
    }

    .notif-popup {
        max-width: 92vw;
        margin: 16px;
    }

    .target-display-bar {
        padding: 8px 16px;
        font-size: 13px;
    }

    .target-user-row {
        flex-wrap: wrap;
    }

    .target-input {
        width: 100%;
    }

    .ach-history-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ach-team-list {
        grid-template-columns: 1fr;
    }

    .achievements-toggle {
        width: 100%;
    }

    .ach-toggle-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 12px;
    }

    .modal {
        max-width: 92vw;
        margin: 16px;
        max-height: 90vh;
    }

    .modal.modal-wide {
        max-width: 92vw;
    }

    .modal-body {
        max-height: 65vh;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-radius: 10px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-details h3 {
        font-size: 12px;
    }

    .compact-filter-bar {
        flex-wrap: wrap;
    }

    .compact-filter-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .compact-filter-dropdown {
        min-width: 160px;
    }

    .chart-body {
        padding: 12px;
    }

    .leaderboard-podium {
        gap: 8px;
    }

    .podium-item {
        padding: 14px 8px;
    }

    .podium-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .podium-first .podium-avatar {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .podium-amount {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .notification-dropdown {
        left: 8px;
        right: 8px;
        top: 65px;
    }

    .compact-filter-daterange {
        flex-direction: column;
        align-items: stretch;
    }

    .compact-filter-daterange .custom-date-input {
        width: 100%;
    }
}

/* ========== PERMISSIONS SYSTEM ========== */

/* Permission checkboxes in modal */
.permission-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.perm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.perm-checkbox-label:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.perm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.perm-checkbox-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.perm-checkbox-text i {
    font-size: 18px;
    color: var(--accent);
}

/* Permission toggle switch in table */
.perm-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.perm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.perm-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 24px;
    transition: var(--transition);
}

.perm-toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.perm-toggle input:checked + .perm-toggle-slider {
    background-color: var(--success);
}

.perm-toggle input:checked + .perm-toggle-slider:before {
    transform: translateX(20px);
}

/* Permission badge */
.perm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.perm-badge-on {
    background: var(--success-light);
    color: var(--success);
}

.perm-badge-off {
    background: var(--danger-light);
    color: var(--danger);
}

/* No permissions message */
.no-permissions-msg {
    text-align: center;
    padding: 60px 30px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}

.no-perm-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.no-permissions-msg h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.no-permissions-msg p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========== COMPACT COLLAPSIBLE FILTERS ========== */
.compact-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.compact-filter-wrapper {
    position: relative;
}

.compact-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.compact-filter-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.compact-filter-btn i:first-child {
    color: var(--accent);
    font-size: 16px;
}

.compact-chevron {
    font-size: 14px !important;
    color: var(--text-muted) !important;
    transition: transform 0.2s ease;
}

.compact-filter-wrapper.open .compact-chevron {
    transform: rotate(180deg);
}

.compact-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    min-width: 180px;
    padding: 6px;
    animation: fadeIn 0.2s ease forwards;
}

.compact-filter-dropdown.open {
    display: block;
}

.compact-filter-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.compact-filter-option:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.compact-filter-option.active {
    background: var(--accent);
    color: white;
}

.compact-filter-daterange {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    flex-wrap: wrap;
}

.compact-filter-daterange .custom-date-input {
    width: 120px;
    font-size: 12px;
    padding: 5px 8px;
}

.leaderboard-filter {
    margin-bottom: 24px;
}

/* ========== TARGET COMPLETION BAR ========== */
.target-display-bar.target-completed {
    background: linear-gradient(135deg, #059669, #10b981);
    animation: targetCompletedPulse 2s ease-in-out;
}

.target-display-bar.target-completed i {
    animation: none;
}

@keyframes targetCompletedPulse {
    0% { transform: scale(1); }
    10% { transform: scale(1.02); }
    20% { transform: scale(1); }
}

/* Dashboard target card completed state */
.target-countdown-card.target-card-completed {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%) !important;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
    animation: targetCompletedPulse 2s ease-in-out;
}

/* Achievements today card completed state */
.ach-today-card.ach-today-completed {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #059669;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
    animation: targetCompletedPulse 2s ease-in-out;
}

.ach-completed-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    padding: 12px 0 4px;
}

.ach-completed-message i {
    font-size: 24px;
}


/* ========== CHART CARD ========== */
.chart-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    overflow: hidden;
}

.chart-card .card-header {
    padding: 20px 24px;
}

.chart-card .card-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.chart-card .card-header h2 i {
    color: var(--accent);
    font-size: 20px;
}

.chart-body {
    padding: 16px 24px 24px;
    height: 300px;
}

.chart-comparison {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.chart-comparison .chart-up {
    color: var(--success);
}

.chart-comparison .chart-down {
    color: var(--danger);
}

/* ========== LEADERBOARD ========== */
.leaderboard-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 24px 0;
}

.podium-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    flex: 1;
    max-width: 200px;
}

.podium-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.podium-first {
    order: 2;
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(211, 84, 0, 0.15);
}

.podium-second {
    order: 1;
}

.podium-third {
    order: 3;
}

.podium-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.podium-first .podium-rank {
    color: var(--accent);
}

.podium-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 10px;
}

.podium-first .podium-avatar {
    width: 64px;
    height: 64px;
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent), #e67e22);
    box-shadow: 0 4px 16px rgba(211, 84, 0, 0.3);
}

.podium-second .podium-avatar {
    background: #64748b;
}

.podium-third .podium-avatar {
    background: #92400e;
}

.podium-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.podium-first .podium-amount {
    font-size: 20px;
}

.podium-medal {
    font-size: 24px;
    margin-bottom: 4px;
}

.leaderboard-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.lb-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.lb-list-item:last-child {
    border-bottom: none;
}

.lb-list-item:hover {
    background: var(--accent-light);
}

.lb-rank {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--secondary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.lb-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.lb-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

/* ========== TEAM MEMBER EXPANDABLE DETAILS ========== */
.ach-team-card {
    cursor: pointer;
}

.ach-team-detail {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.3s ease forwards;
}

.ach-team-detail-summary {
    background: var(--accent-light);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ach-team-detail-summary-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.ach-team-detail-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.ach-detail-filter {
    margin-bottom: 12px;
}

.ach-detail-day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.ach-detail-day:last-child {
    border-bottom: none;
}

.ach-detail-date {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 90px;
}

.ach-detail-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--secondary);
    border-radius: 3px;
    overflow: hidden;
}

.ach-detail-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), #e67e22);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ach-detail-text {
    font-weight: 600;
    color: var(--text-main);
    min-width: 100px;
    text-align: right;
    white-space: nowrap;
}



/* ========== Target Bar Text - Larger & Bold ========== */
.target-display-bar {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    justify-content: space-between;
}

#target-bar-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.target-bar-countdown {
    font-size: 15px;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ========== Target & Countdown Dashboard Card ========== */
.target-countdown-card {
    background: linear-gradient(135deg, #c45000 0%, #a84400 50%, #8a3500 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(196, 80, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.target-countdown-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.target-countdown-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.tc-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 16px;
}

.tc-target-section {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 17px;
    font-weight: 700;
}

.tc-target-section i {
    font-size: 24px;
    opacity: 0.9;
}

.tc-countdown-section {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 28px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.tc-countdown-section i {
    font-size: 26px;
    opacity: 0.8;
}

.tc-countdown-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== Work Hours Card ========== */
.work-hours-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.work-hours-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent-light), #fff);
}

.work-hours-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-hours-body {
    padding: 20px 24px;
}

.work-hours-body .form-group {
    margin-bottom: 12px;
}

/* ========== Edit Follow Up Button ========== */
.edit-followup-btn {
    padding: 6px 8px;
    font-size: 14px;
    margin: 0 2px;
}

@media (max-width: 768px) {
    .tc-card-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .tc-countdown-section {
        font-size: 24px;
    }
    .tc-target-section {
        font-size: 14px;
    }
    #target-bar-text {
        font-size: 13px;
    }
    .target-bar-countdown {
        font-size: 12px;
        padding: 3px 10px;
    }
    .target-display-bar {
        padding: 0 16px;
        min-height: 40px;
        font-size: 13px;
    }
}
