:root {
    --akij-red: #E31837;
    --akij-dark: #1a1a2e;
    --akij-white: #FFFFFF;
    --akij-gray: #f4f6f9;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --border: #e0e0e0;
    --sidebar-width: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--akij-gray);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ====== LOGIN PAGE ====== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--akij-dark) 0%, #2d2d4e 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 48px 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .brand {
    font-size: 28px;
    font-weight: 800;
    color: var(--akij-dark);
}

.login-logo .brand span {
    color: var(--akij-red);
}

.login-logo .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: var(--akij-red);
    box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.1);
    background: white;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--akij-red);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

.btn-primary:hover { background: #c4122e; }

.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #bd2130; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover { background: #f5f5f5; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    color: var(--text-secondary);
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ====== DASHBOARD LAYOUT ====== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--akij-dark);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-header .brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }

/* Collapsed sidebar */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .brand { display: none; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role,
.sidebar.collapsed .sidebar-header .subtitle { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 24px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .sidebar-footer { padding: 16px 8px; text-align: center; }
.sidebar.collapsed + .main-content { margin-left: 64px; }

/* Hidden sidebar (full hide/unhide) */
.sidebar { transition: transform 0.25s ease; }
.sidebar.hidden { transform: translateX(-100%); }
.sidebar.hidden ~ .main-content { margin-left: 0; }
.main-content { transition: margin-left 0.25s ease; }
.sidebar-floating-toggle {
    position: fixed; top: 16px; left: 16px; z-index: 99;
    width: 42px; height: 42px; border-radius: 8px;
    background: var(--akij-dark); color: white; border: none; cursor: pointer;
    font-size: 20px; display: none; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.sidebar.hidden ~ .sidebar-floating-toggle { display: flex; }
.sidebar.hidden ~ .main-content .page-header { padding-left: 84px; }

.sidebar-header .brand span {
    color: var(--akij-red);
}

.sidebar-header .subtitle {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(227, 24, 55, 0.15);
    color: white;
    border-left-color: var(--akij-red);
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-label { font-weight: 500; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--akij-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: capitalize;
}

.user-id {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--akij-dark) 0%, #2d2d4e 100%);
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.page-body {
    padding: 24px 32px;
}

/* ====== KPI CARDS ====== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid var(--akij-red);
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kpi-icon { font-size: 28px; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--akij-dark); margin-bottom: 4px; }
.kpi-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-trend { font-size: 11px; margin-top: 6px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-secondary); }

/* ====== TWO COLUMN LAYOUT ====== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* ====== DATA TABLE ====== */
.section {
    background: white;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--akij-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--akij-gray);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 12px 12px;
    background: var(--akij-gray);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Dashboard channel summary tables — freeze the Channel name column on horizontal scroll */
#channel-trend-table { overflow-x: auto; }
th.sticky-channel { position: sticky; left: 0; z-index: 3; background: var(--akij-gray); }
td.sticky-channel { position: sticky; left: 0; z-index: 2; background: #fff; }

/* Financial statement — freeze topline cards + table header */
#fin-summary {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--akij-gray);
    padding-top: 14px;
    padding-bottom: 6px;
}
#fin-summary .kpi-grid { margin-bottom: 0; grid-template-columns: repeat(4, 1fr); }
#fin-summary .fin-kpi-card .fin-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
#fin-summary .fin-kpi-card .kpi-value { font-size: 22px; }
#fin-summary .fin-kpi-card .kpi-label { font-size: 11px; }
#fin-summary .fin-kpi-card .fin-kpi-ach { font-size: 11px; font-weight: 700; white-space: nowrap; }
#fin-summary .fin-kpi-card .fin-kpi-sub { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 768px) {
    #fin-summary .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    #fin-summary .fin-kpi-card { padding: 14px 12px; }
    #fin-summary .fin-kpi-card .kpi-value { font-size: 16px; }
    #fin-summary .fin-kpi-card .kpi-label { font-size: 10px; }
    #fin-summary .fin-kpi-card .fin-kpi-ach { font-size: 10px; }
    #fin-summary .fin-kpi-card .fin-kpi-sub { font-size: 10px; }
}
#fin-table-section {
    overflow: auto;
    max-height: calc(100vh - 220px);
}
#fin-table thead { position: sticky; top: 0; z-index: 10; }
#fin-table thead th {
    background: var(--akij-gray) !important;
    box-shadow: inset 0 -2px 0 var(--border);
}
/* Freeze the Particulars (first) column on horizontal scroll */
#fin-head th:first-child {
    position: sticky;
    left: 0;
    z-index: 12;
    box-shadow: 2px 0 4px rgba(0,0,0,0.08), inset 0 -2px 0 var(--border);
}
#fin-table tbody td:first-child:not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
    #fin-table td.fin-header-label { font-size: 9px !important; letter-spacing: 0.3px; padding: 4px 10px !important; }
}

.clickable-row { cursor: pointer; transition: background 0.15s; }
.clickable-row:hover { background: var(--akij-gray); }

/* ====== AI SUGGESTIONS ====== */
.ai-suggestions {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    height: fit-content;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
}

.ai-header h3 { font-size: 16px; color: var(--akij-dark); }

.suggestions-list { padding: 12px 16px; }

.suggestion-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafafa;
    border-left: 3px solid transparent;
}

.suggestion-item.warning { border-left-color: var(--warning); }
.suggestion-item.alert { border-left-color: var(--danger); }
.suggestion-item.info { border-left-color: var(--info); }

.suggestion-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.suggestion-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.suggestion-action { font-size: 11px; color: var(--akij-red); font-weight: 600; margin-top: 4px; }

/* ====== MODAL ====== */
.modal-container {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    margin: 40px auto;
    max-width: 520px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg { max-width: 640px; }

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

.modal-header h3 { font-size: 18px; color: var(--akij-dark); }

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

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ====== STATUS BADGES ====== */
.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.inactive { background: #f8d7da; color: #721c24; }
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.completed { background: #d4edda; color: #155724; }
.status-badge.cancelled { background: #f8d7da; color: #721c24; }

/* ====== ROLE BADGES ====== */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
}
.role-badge.admin { background: #fce4ec; color: #c62828; }
.role-badge.supervisor { background: #e3f2fd; color: #1565c0; }
.role-badge.representative { background: #e8f5e9; color: #2e7d32; }

/* ====== SEARCH ====== */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    max-width: 300px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: var(--akij-red);
    box-shadow: 0 0 0 2px rgba(227, 24, 55, 0.1);
}

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active {
    background: var(--akij-red);
    color: white;
    border-color: var(--akij-red);
}

.pagination button:hover:not(.active) { background: var(--akij-gray); }

/* ====== EMPTY STATE ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon { font-size: 48px; display: block; margin-bottom: 16px; opacity: 0.3; }

.empty-state p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 16px;
}

/* ====== TOAST ====== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-hide { animation: slideOut 0.3s ease forwards; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ====== BACK BUTTON ====== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.back-btn:hover { background: var(--akij-gray); }

/* ====== TEAM CARDS ====== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.team-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

.team-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--akij-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.team-card-header h4 { font-size: 15px; margin-bottom: 2px; }

.team-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--akij-gray);
    border-bottom: 1px solid var(--akij-gray);
}

.stat { text-align: center; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--akij-dark); display: block; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.target-progress { margin-bottom: 16px; }
.progress-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.progress-fill {
    height: 100%;
    background: var(--akij-red);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.progress-text { font-size: 11px; color: var(--text-secondary); }

.team-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ====== CHECKLIST ====== */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--akij-gray);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.checklist-item:hover { background: var(--akij-gray); }

.checklist-label { flex: 1; font-size: 14px; }

.current-team-list { margin-top: 8px; }

.current-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--akij-gray);
}

/* ====== RESPONSIVE ====== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 900;
}
.sidebar-overlay.show { display: block; }

/* Mobile top bar */
.mobile-topbar { display: none; }
.mobile-month-select {
    background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px; padding: 5px 8px; font-size: 12px; max-width: 110px; flex: 0 0 auto;
}
.mobile-month-select option { color: #333; }

@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
        position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 97;
        background: linear-gradient(135deg, var(--akij-dark) 0%, #2d2d4e 100%);
        align-items: center; gap: 12px; padding: 0 14px;
    }
    .mobile-menu-btn { background: transparent; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 0; line-height: 1; }
    .mobile-topbar-user { color: #fff; font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
    .main-content { padding-top: 48px; }
    .sidebar-floating-toggle { display: none !important; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.3); }
    .main-content { margin-left: 0; }
    .two-col { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .channel-grid { grid-template-columns: 1fr; }
    .page-body { padding: 12px; }
    .page-header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
    .page-header h2 { font-size: 17px; }
    .section { padding: 14px 12px; overflow-x: auto; }
    .data-table { min-width: 600px; }
    .tbl-tools, .toolbar { flex-wrap: wrap; }
    .search-input, .tbl-tools input { width: 100%; max-width: 100%; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .login-card { padding: 32px 20px; }
    .login-logo .brand { font-size: 22px; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr !important; }
    .page-body { padding: 8px; }
    .section { padding: 12px 10px; }
    .page-header { padding: 12px; }
}

/* ====== CHANNEL CARDS ====== */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.channel-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fafbfc;
}

.channel-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--akij-dark);
    margin-bottom: 4px;
}

.channel-orders {
    font-size: 12px;
    color: var(--text-muted);
}

.channel-pie {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.channel-metrics {
    padding: 16px 20px;
}

.channel-metric {
    margin-bottom: 16px;
}

.channel-metric:last-child { margin-bottom: 0; }

.channel-metric.secondary {
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-values {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.metric-achieve {
    font-size: 20px;
    font-weight: 700;
    color: var(--akij-dark);
}

.metric-target {
    font-size: 12px;
    color: var(--text-muted);
}

.metric-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
}

.metric-achieve-pct {
    font-weight: 700;
}

.metric-mom { font-weight: 600; }
.metric-mom.up { color: var(--success); }
.metric-mom.down { color: var(--danger); }
.metric-mom.neutral { color: var(--text-muted); }

.metric-gap {
    color: var(--text-muted);
    margin-left: auto;
}

/* ====== SECONDARY KPI CARDS ====== */
.kpi-card.secondary-kpi {
    border-left-color: var(--info);
}

.kpi-card.secondary-kpi .kpi-value {
    font-size: 20px;
}

/* ====== CHANNEL FILTER BUTTONS ====== */
.channel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.channel-filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s;
}

.channel-filter-btn:hover {
    background: var(--akij-gray);
}

.channel-filter-btn.active {
    background: var(--akij-red);
    color: white;
    border-color: var(--akij-red);
}

/* ====== SECTION GRADIENTS ====== */
.section-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-top: 3px solid var(--akij-red);
}

.section-gradient-blue {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border-top: 3px solid var(--info);
}

/* ====== CHANNEL METRIC ROWS ====== */
.channel-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.metric-mini {
    padding: 8px 10px;
    background: #fafbfc;
    border-radius: 6px;
}

.mini-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mini-value {
    font-size: 15px;
    font-weight: 700;
    display: block;
}

.mini-pct {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mini-bar {
    height: 3px;
    background: #eee;
    border-radius: 2px;
    margin: 6px 0 2px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ====== ENHANCED CHANNEL PROGRESS ====== */
.channel-progress {
    height: 8px;
    border-radius: 4px;
    background: #eee;
    margin: 10px 0 6px;
}

.metric-time {
    font-size: 11px;
    font-weight: 600;
}

.metric-time.down { color: var(--danger); }
.metric-time.up { color: var(--success); }

/* ====== ENHANCED CARD SHADOWS ====== */
.kpi-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.channel-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.channel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ====== TOTAL CARD ====== */
.channel-card.total-card {
    border: 1px solid rgba(255,215,0,0.3);
}

.channel-card.total-card .channel-metrics .metric-achieve {
    color: #ffd700 !important;
}

.channel-card.total-card:hover {
    box-shadow: 0 8px 28px rgba(255,215,0,0.15);
}

/* ====== PAGE HEADER ENHANCED ====== */
.page-header {
    background: linear-gradient(135deg, var(--akij-red) 0%, #b3122b 100%);
    color: white;
    border-bottom: none;
}

.page-header h2 {
    color: white;
}

.page-header .form-control {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.page-header .form-control:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

/* ====== LEADERBOARD ====== */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.leaderboard-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.lb-medal { font-size: 36px; margin-bottom: 4px; }
.lb-rank { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 8px; }
.lb-name { font-size: 16px; font-weight: 700; color: var(--akij-dark); margin-bottom: 4px; }
.lb-zone { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.lb-count { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.lb-pct { font-size: 28px; font-weight: 800; }
.lb-sales { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ====== CLUBBING ====== */
.clubbing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.clubbing-card {
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.club-value { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.club-label { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.club-pct { font-size: 12px; opacity: 0.7; margin-top: 4px; }

@media (max-width: 768px) {
    .leaderboard-grid { grid-template-columns: 1fr; }
    .clubbing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ====== PROFILE AVATAR ====== */
.profile-avatar-section {
    padding: 24px 0 8px;
}

.profile-avatar-wrapper {
    position: relative;
    margin: 0 auto;
}

.user-avatar img {
    object-fit: cover;
    border-radius: 50%;
}
.mobile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--akij-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.mobile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
