/* ==========================================================================
   AHS Sales & Profit Analytics and Commission Calculation System
   Design System & Modern Executive Stylesheet (Updated v7)
   ========================================================================== */

:root {
    /* Color Palette - Modern Slate & Corporate Blue/Emerald */
    --color-primary: #1e40af;       /* Deep Corporate Blue */
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    
    --color-secondary: #475569;     /* Slate */
    --color-secondary-light: #f1f5f9;
    
    --color-success: #059669;       /* Emerald Green */
    --color-success-light: #ecfdf5;
    --color-success-border: #a7f3d0;
    
    --color-warning: #d97706;       /* Amber */
    --color-warning-light: #fffbeb;
    --color-warning-border: #fde68a;
    
    --color-danger: #e11d48;        /* Rose Red */
    --color-danger-light: #fff1f2;
    --color-danger-border: #fecdd3;
    
    --color-info: #0284c7;          /* Sky Blue */
    --color-info-light: #f0f9ff;
    
    /* Neutral & Background Tones */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;          /* Dark Navy Slate */
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #2563eb;
    
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* Typography */
    --font-primary: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-number: 'Inter', 'Prompt', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Layout */
    --sidebar-width: 280px;
    --transition-fast: 0.18s ease;
    --transition-normal: 0.25s ease;
}

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

body.app-body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Checkboxes */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
    vertical-align: middle;
}

/* Inline Edit Controls in Detail Table */
.detail-edit-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 12.5px;
    outline: none;
    background: #ffffff;
    transition: all var(--transition-fast);
}

.detail-edit-input:focus {
    border-color: #2563eb;
    background: #f8faff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   LOGIN SCREEN OVERLAY
   ========================================================================== */
.login-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top right, #1e3a8a, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.login-screen-wrapper.hidden {
    display: none !important;
}

.login-card-container {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    padding: 36px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    animation: loginModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 12px auto;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.login-brand-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.login-brand-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-input {
    padding: 10px 14px;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
}

.login-error {
    background-color: #fef2f2;
    border: 1px solid #fecdd3;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-error.hidden {
    display: none;
}

.btn-login-submit {
    padding: 11px;
    font-size: 14px;
    justify-content: center;
    margin-top: 4px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.quick-login-divider {
    text-align: center;
    margin: 22px 0 14px 0;
    position: relative;
}

.quick-login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 1;
}

.quick-login-divider span {
    background-color: #ffffff;
    padding: 0 10px;
    position: relative;
    z-index: 2;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.quick-login-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-role-chip {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
}

.quick-role-chip:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.quick-role-chip strong {
    font-size: 12px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-role-chip small {
    font-size: 10.5px;
    color: #64748b;
}

.chip-sale-unlinked {
    grid-column: span 2;
}

.login-card-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: #94a3b8;
}

/* ==========================================================================
   LAYOUT & SIDEBAR
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 9px;
    border-radius: var(--radius-md);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
}

.brand-sub {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 14px 10px;
    flex-grow: 1;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 10px 4px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 3px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background-color: var(--bg-sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    color: #94a3b8;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    color: #ffffff;
}

.nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.pending-badge {
    background-color: #f59e0b;
    color: #0f172a;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: #64748b;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 6px #10b981;
}

/* ==========================================================================
   TOP HEADER (2 ROWS LAYOUT)
   ========================================================================== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header-container {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-row-primary {
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.icon-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: none;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

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

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

.user-profile-header-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
}

.user-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.user-header-info {
    display: flex;
    flex-direction: column;
}

.user-header-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.user-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.user-header-role-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: #2563eb;
    color: #ffffff;
    text-transform: uppercase;
}

.header-role-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-role-switch-wrapper.hidden {
    display: none !important;
}

.role-switch-label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.header-role-select {
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.header-role-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.user-header-branch {
    font-size: 10.5px;
    color: #64748b;
}

.btn-logout {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

.header-row-secondary {
    padding: 8px 28px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.filter-bar-title {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-controls-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.custom-select {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-family: var(--font-primary);
    font-size: 12.5px;
    color: var(--text-main);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.filter-select-period {
    font-weight: 600;
    color: #1e40af;
}

/* ==========================================================================
   IN-PAGE FILTER TOOLBAR & ACTION GROUPS
   ========================================================================== */
.page-filter-toolbar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

/* STICKY FREEZE FILTER TOOLBAR */
.page-filter-toolbar.sticky-filter-bar {
    position: sticky;
    top: 0;
    z-index: 95;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.filter-inline-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-filter-toolbar.dashboard-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.dashboard-filter-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.dashboard-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-toolbar-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.form-control-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ==========================================================================
   MULTI-SELECT DROPDOWN COMPONENT (FOR DASHBOARD FILTERS)
   ========================================================================== */
.multiselect-container {
    position: relative;
    display: inline-block;
}

.multiselect-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-family: var(--font-primary);
    font-size: 12px;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 140px;
    max-width: 220px;
    transition: all var(--transition-fast);
}

.multiselect-btn:hover {
    border-color: var(--color-primary);
    background-color: #f8fafc;
}

.multiselect-btn.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.multiselect-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.multiselect-badge {
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.multiselect-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 120;
    padding: 6px 0;
    display: none;
}

.multiselect-menu.show {
    display: block;
    animation: fadeInMenu 0.15s ease-out;
}

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

.multiselect-header-item {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color-light);
    font-weight: 700;
    background-color: #f8fafc;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #1e293b;
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.multiselect-option:hover {
    background-color: #eff6ff;
}

.multiselect-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* ==========================================================================
   LOCKED / READ-ONLY INVOICE NOTICES
   ========================================================================== */
.alert-readonly-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    color: #166534;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 14px;
}

.badge-locked {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-weight: 700;
}

.txn-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ==========================================================================
   CONTENT BODY & TABS
   ========================================================================== */
.content-body {
    padding: 20px 28px 48px 28px;
    flex-grow: 1;
}

.content-tab {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.content-tab.active {
    display: block;
}

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

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

.metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.metric-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-sales { background: #dbeafe; color: #1d4ed8; }
.icon-margin { background: #d1fae5; color: #047857; }
.icon-cost { background: #fee2e2; color: #b91c1c; }
.icon-comm { background: #fef3c7; color: #b45309; }

.metric-value {
    font-family: var(--font-number);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color-light);
    padding-top: 10px;
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success { background-color: var(--color-success-light); color: var(--color-success); }
.badge-warning { background-color: var(--color-warning-light); color: var(--color-warning); }
.badge-danger { background-color: var(--color-danger-light); color: var(--color-danger); }
.badge-info { background-color: var(--color-info-light); color: var(--color-info); }
.badge-neutral { background-color: #f1f5f9; color: #475569; }
.badge-rejected { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecdd3; }

/* ==========================================================================
   CHARTS GRID
   ========================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: 16px;
}

.card-header.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--color-primary);
}

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

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-main);
}

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

.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--text-muted); }

.action-btns-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.log-error-text {
    color: #b91c1c;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
    display: block;
    background: #fef2f2;
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #e11d48;
}

.log-success-text {
    color: #059669;
    font-size: 11.5px;
    font-weight: 500;
}

/* ==========================================================================
   PAGINATION UI (MAX 25 RECORDS PER PAGE)
   ========================================================================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px 4px 8px;
    border-top: 1px solid var(--border-color-light);
    margin-top: 12px;
    font-size: 12.5px;
}

.pagination-info {
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #334155;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pagination-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   PRODUCT CATEGORY MANAGEMENT
   ========================================================================== */
.category-management-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.cat-title-box h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-hint {
    font-size: 11.5px;
    color: var(--text-muted);
}

.category-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.category-tag-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.category-del-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
}

.category-del-btn:hover {
    color: #e11d48;
}

/* ==========================================================================
   TARGET & USER SUBTABS
   ========================================================================== */
.target-subtabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 4px;
}

.target-tab-btn, .user-tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--font-primary);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.target-tab-btn:hover, .user-tab-btn:hover {
    color: var(--color-primary);
}

.target-tab-btn.active, .user-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 700;
}

.target-subtab-content, .user-subtab-content {
    display: none;
}

.target-subtab-content.active, .user-subtab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.target-sub-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.target-sub-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================================================
   TOP 10 RANKINGS
   ========================================================================== */
.top10-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ranking-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ranking-header-gold { background: linear-gradient(135deg, #fef3c7, #ffffff); border-bottom: 2px solid #f59e0b; padding: 18px 20px; }
.ranking-header-silver { background: linear-gradient(135deg, #e2e8f0, #ffffff); border-bottom: 2px solid #94a3b8; padding: 18px 20px; }
.ranking-header-bronze { background: linear-gradient(135deg, #ffedd5, #ffffff); border-bottom: 2px solid #ea580c; padding: 18px 20px; }

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

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color-light);
    font-size: 13px;
}

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

.rank-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11.5px;
    background-color: #f1f5f9;
    color: #475569;
}

.rank-1 { background-color: #f59e0b; color: #ffffff; }
.rank-2 { background-color: #94a3b8; color: #ffffff; }
.rank-3 { background-color: #d97706; color: #ffffff; }

.rank-title {
    font-weight: 600;
    color: var(--text-main);
}

.rank-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.rank-value {
    font-family: var(--font-number);
    font-weight: 700;
    color: var(--color-primary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: #334155;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #1e293b;
}

.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #047857;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #be123c;
}

.btn-outline {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   COMMISSION APPROVAL TAB & TOOLBAR
   ========================================================================== */
.role-permission-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    margin-bottom: 20px;
}

.role-permission-alert.alert-readonly {
    background: #fffbeb;
    border-color: #fde68a;
}

.alert-icon {
    font-size: 28px;
    color: var(--color-success);
}

.role-permission-alert.alert-readonly .alert-icon {
    color: var(--color-warning);
}

.alert-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 2px;
}

.role-permission-alert.alert-readonly .alert-content h4 {
    color: #92400e;
}

.alert-content p {
    font-size: 12.5px;
    color: #4b5563;
}

.toolbar-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.status-tabs {
    display: flex;
    gap: 6px;
}

.status-tab {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.status-tab:hover {
    background-color: #f1f5f9;
}

.status-tab.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* ==========================================================================
   OFFICIAL COMMISSION SLIP DOCUMENT (A4 PRINTABLE)
   ========================================================================== */
.slips-header-banner {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.slips-banner-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.slips-banner-text p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.slips-banner-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slip-locked-card {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.locked-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e11d48;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.locked-text h4 {
    font-size: 16px;
    font-weight: 700;
    color: #9f1239;
    margin-bottom: 4px;
}

.locked-text p {
    font-size: 13.5px;
    color: #881337;
}

.slip-paper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.slip-paper {
    width: 100%;
    max-width: 820px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 48px;
    box-shadow: var(--shadow-md);
}

.slip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.slip-company-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.slip-company-address, .slip-company-contact {
    font-size: 11.5px;
    color: var(--text-muted);
}

.slip-title-box {
    text-align: right;
}

.slip-main-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.slip-sub-title {
    font-size: 10.5px;
    color: #64748b;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.slip-doc-no-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
    margin-right: 4px;
    margin-bottom: 4px;
}

.slip-period-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    margin-bottom: 4px;
}

.slip-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.slip-person-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
    background-color: #f8fafc;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color-light);
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.info-label {
    color: #64748b;
}

.slip-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    border-left: 3px solid var(--color-primary);
    padding-left: 8px;
}

.slip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 24px;
}

.slip-table th {
    background-color: #f1f5f9;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.slip-table td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
}

.highlight-row {
    background-color: #eff6ff;
}

.slip-calc-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 28px;
}

.calc-formula-display {
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    border-left: 2px solid #3b82f6;
}

.calc-breakdown-grid {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0;
}

.calc-item {
    text-align: center;
}

.calc-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.calc-value {
    font-size: 16px;
    font-family: var(--font-number);
}

.calc-op {
    font-size: 20px;
    font-weight: 700;
    color: #94a3b8;
}

.adjustment-box {
    border-top: 1px dashed #cbd5e1;
    margin-top: 14px;
    padding-top: 10px;
    font-size: 12.5px;
}

.adj-row {
    display: flex;
    justify-content: space-between;
}

.adj-notes {
    font-size: 11.5px;
    margin-top: 2px;
}

.slip-total-payable-card {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}

.total-payable-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-payable-amount {
    font-family: var(--font-number);
    font-size: 28px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 4px 0;
}

.total-payable-words {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 500;
}

.slip-signatures-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 36px;
}

.signature-box {
    text-align: center;
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
}

.sign-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 20px;
}

.sign-stamp-approved {
    display: inline-block;
    border: 2px solid #059669;
    color: #059669;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
    transform: rotate(-5deg);
    margin-bottom: 12px;
    font-size: 13px;
    letter-spacing: 1px;
}

.sign-line {
    border-bottom: 1px solid #94a3b8;
    width: 70%;
    margin: 30px auto 10px auto;
}

.sign-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.sign-role, .sign-date {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.slip-footer-note {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin-top: 30px;
}

.slip-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

/* ==========================================================================
   EXECUTIVE SUMMARY REPORT
   ========================================================================== */
.executive-header-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.exec-title-box h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.exec-title-box p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.exec-actions {
    display: flex;
    gap: 10px;
}

.exec-report-paper {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 32px 36px;
    box-shadow: var(--shadow-sm);
}

.exec-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.exec-brand {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.exec-period-badge {
    background: #1e40af;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
}

.exec-kpi-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.exec-kpi-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.exec-kpi-label {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.exec-kpi-val {
    font-family: var(--font-number);
    font-size: 18px;
    font-weight: 700;
}

.exec-table th {
    background-color: #f1f5f9;
}

.exec-table tfoot td {
    background-color: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
}

.exec-signoff-row {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
}

/* ==========================================================================
   IMPORT HUB
   ========================================================================== */
.import-instructions-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
}

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

.instruction-icon {
    font-size: 24px;
    color: #2563eb;
}

.instruction-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
}

.instruction-header p {
    font-size: 12.5px;
    color: #3b82f6;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.inst-item {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #dbeafe;
    display: flex;
    gap: 10px;
    font-size: 12.5px;
}

.inst-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.upload-dropzone {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
    border-color: #2563eb;
    background: #f8faff;
}

.hidden-file-input {
    display: none;
}

.dropzone-icon {
    font-size: 48px;
    color: #3b82f6;
    margin-bottom: 12px;
}

.dropzone-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.dropzone-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.sample-generator-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.gen-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gen-icon {
    font-size: 24px;
    color: #8b5cf6;
}

.gen-left p {
    font-size: 12px;
    color: var(--text-muted);
}

.gen-right {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalIn 0.2s ease-out;
}

.modal-card-lg {
    max-width: 980px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

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

.modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.file-detail-summary-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
}

.modal-person-summary {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    font-size: 13px;
}

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

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
    background: #ffffff;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.modal-calc-final {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS (WITH CLOSE BUTTON)
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid #2563eb;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 360px;
    position: relative;
    animation: toastSlideIn 0.25s ease-out;
}

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

.toast-icon { font-size: 18px; }
.toast-success { border-left-color: #059669; }
.toast-success .toast-icon { color: #059669; }
.toast-error { border-left-color: #e11d48; }
.toast-error .toast-icon { color: #e11d48; }
.toast-warning { border-left-color: #d97706; }
.toast-warning .toast-icon { color: #d97706; }

.toast-msg {
    flex-grow: 1;
}

.toast-msg h5 { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.toast-msg p { font-size: 12px; color: #475569; }

.toast-close-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.toast-close-btn:hover {
    color: #0f172a;
}

/* ==========================================================================
   PRINT MEDIA STYLES (PERFECT SLIP & REPORT PRINTING)
   ========================================================================== */
@media print {
    body {
        background-color: #ffffff !important;
        font-size: 11pt;
        color: #000000 !important;
    }

    /* 1. When printing from Slip Document Modal */
    body.printing-slip-modal #app-container {
        display: none !important;
    }

    body.printing-slip-modal #slip-document-modal {
        display: block !important;
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.printing-slip-modal #slip-document-modal .modal-card {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    body.printing-slip-modal #slip-document-modal .modal-header,
    body.printing-slip-modal #slip-document-modal .modal-footer {
        display: none !important;
    }

    body.printing-slip-modal #slip-document-modal .modal-body {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    body.printing-slip-modal .slip-paper {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        background: #ffffff !important;
    }

    /* 2. When printing default active tab (e.g. Executive Report) */
    body:not(.printing-slip-modal) .sidebar,
    body:not(.printing-slip-modal) .top-header-container,
    body:not(.printing-slip-modal) .page-filter-toolbar,
    body:not(.printing-slip-modal) .executive-header-card .exec-actions,
    body:not(.printing-slip-modal) .modal-backdrop,
    body:not(.printing-slip-modal) .toast-container,
    body:not(.printing-slip-modal) .login-screen-wrapper,
    body:not(.printing-slip-modal) .pagination-wrapper {
        display: none !important;
    }

    body:not(.printing-slip-modal) .app-layout {
        display: block !important;
    }

    body:not(.printing-slip-modal) .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    body:not(.printing-slip-modal) .content-body {
        padding: 0 !important;
    }

    body:not(.printing-slip-modal) .content-tab:not(.active) {
        display: none !important;
    }

    body:not(.printing-slip-modal) .exec-report-paper {
        border: none !important;
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    @page {
        size: A4 portrait;
        margin: 12mm 15mm;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .top10-grid {
        grid-template-columns: 1fr;
    }
    .instruction-grid {
        grid-template-columns: 1fr;
    }
    .exec-kpi-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .icon-btn {
        display: block;
    }

    .header-row-primary {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .header-row-secondary {
        padding: 10px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-controls-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .slip-signatures-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
