/* ==========================================================================
   DESIGN SYSTEM - CSS VARIABLES
   ========================================================================== */
:root {
    /* Color Palette - HSL Tailored Colors */
    --bg-main: HSL(222, 47%, 7%);       /* Slate 950 */
    --bg-card: HSL(222, 35%, 12%, 0.7); /* Glass-like Slate 900 */
    --bg-header: HSL(222, 40%, 9%);     /* Slate 925 */
    --border-color: HSL(222, 30%, 20%, 0.4);
    --border-glow: HSL(222, 30%, 30%, 0.2);
    
    --text-primary: HSL(210, 40%, 98%);  /* Off-white */
    --text-secondary: HSL(215, 25%, 72%); /* Muted blue-grey */
    --text-muted: HSL(215, 16%, 52%);     /* Muted grey */
    
    /* Neon Accents */
    --accent-blue: HSL(199, 89%, 48%);
    --accent-purple: HSL(271, 91%, 65%);
    --accent-emerald: HSL(146, 79%, 44%);
    --accent-amber: HSL(38, 92%, 50%);
    --accent-rose: HSL(343, 90%, 60%);
    
    --accent-blue-glow: HSL(199, 89%, 48%, 0.15);
    --accent-purple-glow: HSL(271, 91%, 65%, 0.15);
    --accent-emerald-glow: HSL(146, 79%, 44%, 0.15);
    --accent-amber-glow: HSL(38, 92%, 50%, 0.15);
    --accent-rose-glow: HSL(343, 90%, 60%, 0.15);
    
    /* Layout & Styling Controls */
    --sidebar-width: 260px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

/* Light Mode Overrides (Optional / Defaulting to Dark for wow factor) */
body.light-mode {
    --bg-main: HSL(210, 40%, 96%);
    --bg-card: HSL(0, 0%, 100%, 0.85);
    --bg-header: HSL(210, 40%, 98%);
    --border-color: HSL(210, 30%, 88%, 0.6);
    --text-primary: HSL(222, 47%, 10%);
    --text-secondary: HSL(215, 25%, 28%);
    --text-muted: HSL(215, 16%, 45%);
    --border-glow: rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   GLOBAL RESET & FONTS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* Typography Headings */
h1, h2, h3, h4, h5, h6, .logo_name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--sidebar-width);
    background-color: var(--bg-header);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    transition: var(--transition-normal);
}

.logo-details {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 28px;
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px var(--accent-blue-glow));
}

.logo_name {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-links li {
    position: relative;
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
}

.nav-links li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    gap: 16px;
    transition: var(--transition-fast);
}

.nav-links li a i {
    font-size: 20px;
    transition: var(--transition-fast);
}

/* Hover state */
.nav-links li:hover a {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

/* Active State */
.nav-links li.active a {
    color: var(--accent-blue);
    background: linear-gradient(90deg, var(--accent-blue-glow) 0%, rgba(0,0,0,0) 100%);
    border-left: 3px solid var(--accent-blue);
}

.nav-links li.active a i {
    color: var(--accent-blue);
}

/* Badge dot and pill */
.nav-links li .badge {
    position: absolute;
    right: 16px;
    background-color: var(--accent-rose);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    box-shadow: 0 0 10px var(--accent-rose-glow);
}

.profile-details {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.profile-content img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-blue);
}

.name-job {
    flex-grow: 1;
}

.profile_name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.profile-details i {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-details i:hover {
    color: var(--accent-rose);
}

/* ==========================================================================
   MAIN CONTENT WRAPPER
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Top Navbar Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

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

.search-bar-quick {
    position: relative;
    width: 280px;
}

.search-bar-quick i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.search-bar-quick input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 38px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.search-bar-quick input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.theme-toggle, .notifications {
    width: 40px;
    height: 40px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.theme-toggle:hover, .notifications:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.badge-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-rose);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-rose-glow);
}

/* ==========================================================================
   GLASSMORPHIC PANEL UI
   ========================================================================== */
.glass-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color var(--transition-fast);
}

.glass-panel:hover {
    border-color: var(--border-glow);
}

/* ==========================================================================
   VIEW SECTIONS (HIDDEN BY DEFAULT)
   ========================================================================== */
.view-section {
    display: none;
    flex-direction: column;
    gap: 30px;
    animation: fadeIn 0.4s ease;
}

.view-section.active {
    display: flex;
}

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

/* ==========================================================================
   DASHBOARD VIEW - KPI & CHARTS
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
    transform: translateY(-4px);
}

/* Glow Borders based on card type */
.card-glow-blue:hover { border-color: var(--accent-blue); box-shadow: 0 4px 24px var(--accent-blue-glow); }
.card-glow-purple:hover { border-color: var(--accent-purple); box-shadow: 0 4px 24px var(--accent-purple-glow); }
.card-glow-emerald:hover { border-color: var(--accent-emerald); box-shadow: 0 4px 24px var(--accent-emerald-glow); }
.card-glow-amber:hover { border-color: var(--accent-amber); box-shadow: 0 4px 24px var(--accent-amber-glow); }
.card-glow-rose:hover { border-color: var(--accent-rose); box-shadow: 0 4px 24px var(--accent-rose-glow); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.icon-blue { background-color: var(--accent-blue-glow); color: var(--accent-blue); }
.icon-purple { background-color: var(--accent-purple-glow); color: var(--accent-purple); }
.icon-emerald { background-color: var(--accent-emerald-glow); color: var(--accent-emerald); }
.icon-amber { background-color: var(--accent-amber-glow); color: var(--accent-amber); }
.icon-rose { background-color: var(--accent-rose-glow); color: var(--accent-rose); }

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-subtext {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-success { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-blue { color: var(--accent-blue); }

/* Charts Layout Grid */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 320px;
}

.chart-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    flex-grow: 1;
    height: 250px;
    width: 100%;
}

/* ==========================================================================
   FILTER & SEARCH CONTROLS
   ========================================================================== */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-group input[type="text"], .filter-group select {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    transition: var(--transition-fast);
}

.filter-group input[type="text"] {
    padding-left: 36px;
}

.filter-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.filter-group input[type="text"]:focus, .filter-group select:focus {
    border-color: var(--accent-blue);
}

/* Checkbox design */
.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-label input {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-main);
    position: relative;
    transition: var(--transition-fast);
}

.checkbox-label:hover .custom-checkbox {
    border-color: var(--accent-blue);
}

.checkbox-label input:checked + .custom-checkbox {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-label input:checked + .custom-checkbox::after {
    content: "\eb7b";
    font-family: 'boxicons';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background-color: HSL(199, 89%, 40%);
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.btn-secondary {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-icon:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}
.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

/* ==========================================================================
   CUSTOM DATA TABLES
   ========================================================================== */
.table-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-header-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

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

.custom-table th {
    background-color: var(--bg-header);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Small Table Style */
.table-sm th, .table-sm td {
    padding: 8px 12px;
    font-size: 13px;
}

/* Badge tags inside tables */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-blue { background-color: var(--accent-blue-glow); color: var(--accent-blue); }
.badge-purple { background-color: var(--accent-purple-glow); color: var(--accent-purple); }
.badge-emerald { background-color: var(--accent-emerald-glow); color: var(--accent-emerald); }
.badge-amber { background-color: var(--accent-amber-glow); color: var(--accent-amber); }
.badge-rose { background-color: var(--accent-rose-glow); color: var(--accent-rose); }

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-number {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.page-number:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.page-number.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

/* ==========================================================================
   OUTBOUND WORKSPACE split screen
   ========================================================================== */
.workspace-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    height: calc(100vh - 160px);
}

.workspace-list-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

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

.search-outbound-box {
    position: relative;
}

.search-outbound-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-outbound-box input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 38px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.outbound-items-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Call item card */
.outbound-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition-fast);
}

.outbound-card:hover {
    border-color: var(--text-muted);
    transform: translateX(4px);
}

.outbound-card.active {
    border-color: var(--accent-blue);
    background-color: rgba(14, 165, 233, 0.03);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.outbound-card h5 {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outbound-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* Right Detail Call Workspace */
.workspace-call-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.panel-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    gap: 16px;
}

.panel-placeholder i {
    font-size: 64px;
}

.panel-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.workspace-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workspace-section h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.text-xs { font-size: 11px; }

/* Call contact cards layout */
.call-contacts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.call-contact-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-fast);
}

.call-contact-card:hover {
    border-color: var(--accent-blue);
}

.contact-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}

.contact-tel, .contact-mail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
}

.contact-tel:hover, .contact-mail:hover {
    color: var(--accent-blue);
}

/* Call audits timeline */
.call-audits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.call-audit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.01);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

/* Follow-up recording form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
    transition: var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent-blue);
}

.full-width {
    grid-column: 1 / -1;
}

.date-input-group {
    display: flex;
    gap: 8px;
}

.date-input-group input {
    flex-grow: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
}

.save-status-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--accent-emerald);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* ==========================================================================
   TODAY'S TASKS VIEW
   ========================================================================== */
.tasks-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 400px;
}

.tasks-panel .panel-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

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

.header-left i {
    font-size: 24px;
    color: var(--accent-amber);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--border-radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.task-card:hover {
    border-color: var(--accent-amber);
    box-shadow: 0 4px 15px var(--accent-amber-glow);
}

.task-info-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-comp-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-meta-row {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-remark {
    font-size: 13px;
    color: var(--text-muted);
    background-color: rgba(255,255,255,0.01);
    padding: 6px 12px;
    border-radius: 4px;
    border-left: 2px solid var(--accent-amber);
}

.tasks-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: auto;
    color: var(--text-muted);
}

.tasks-empty-state i {
    font-size: 64px;
}

/* ==========================================================================
   SYSTEM SETTINGS VIEW
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.settings-card-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card-panel h4 {
    font-size: 18px;
    color: var(--text-primary);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group h5 {
    font-size: 14px;
    font-weight: 600;
}

.readonly-info-box {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.6;
}

.readonly-info-box code {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

.clean-metrics-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric-item {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.metric-lbl {
    font-size: 11px;
    color: var(--text-secondary);
}

.metric-val {
    font-size: 18px;
    font-weight: 700;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

/* ==========================================================================
   SLIDE-IN DETAILS DRAWER
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100%;
    background-color: var(--bg-header);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0,0,0,0.3);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
}

.drawer.active {
    right: 0;
}

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

.drawer-title-group h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.btn-close-drawer {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-fast);
}

.btn-close-drawer:hover {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
}

.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255,255,255,0.01);
}

.tab-btn {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background-color: var(--bg-card);
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

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

/* Info Tab Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: rgba(255,255,255,0.01);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.info-val {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

/* Contacts Inline Edit tip */
.contacts-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-blue-glow);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
}

/* Inline input fields inside table */
.inline-edit-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--accent-blue);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    font-size: 13px;
}

.cell-editing {
    padding: 2px !important;
}

.row-bounced {
    background-color: rgba(244, 63, 94, 0.02);
}

.row-suspicious {
    background-color: rgba(245, 158, 11, 0.015);
}

.text-rose {
    color: var(--accent-rose) !important;
}

/* Audit Timeline in Drawer */
.audits-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    background-color: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item::after {
    content: "";
    position: absolute;
    left: -27px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--border-color);
    border: 2px solid var(--bg-header);
}

.timeline-item.passed::after { background-color: var(--accent-emerald); }
.timeline-item.failed::after { background-color: var(--accent-rose); }
.timeline-item.pending::after { background-color: var(--accent-amber); }

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

.timeline-title {
    font-weight: 600;
    font-size: 14px;
}

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

.timeline-body {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Followup form inside drawer */
.drawer-followup-form {
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-top: 16px;
}

.followup-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-card {
    background-color: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-blue);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-card.card-🔴待开发 { border-left-color: var(--accent-rose); }
.history-card.card-🟡跟进中 { border-left-color: var(--accent-amber); }
.history-card.card-🟢已成交 { border-left-color: var(--accent-emerald); }

.history-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Loading skeleton styles */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.skeleton-row {
    height: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
    background-size: 200% 100%;
    animation: loadingSkeleton 1.5s infinite;
    border-radius: 4px;
}

@keyframes loadingSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Row edit feedback */
.row-saved-flash {
    animation: flashGreen 0.8s ease;
}

@keyframes flashGreen {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

/* Audit Supply Chain Relationship Tags */
.timeline-relationship {
    background-color: rgba(14, 165, 233, 0.04);
    border: 1px solid rgba(14, 165, 233, 0.12);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-blue);
    width: 100%;
    box-sizing: border-box;
}

.timeline-relationship strong {
    color: var(--text-primary);
}

.audit-relationship-tag {
    background-color: rgba(245, 158, 11, 0.04);
    border: 1px dashed rgba(245, 158, 11, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: var(--accent-amber) !important;
    font-size: 11px;
}

body.not-logged-in .sidebar,
body.not-logged-in .main-content,
body.not-logged-in .drawer,
body.not-logged-in .drawer-overlay {
    display: none !important;
}

body.not-logged-in #login-container {
    display: flex !important;
}

body.not-logged-in #login-container {
    display: flex !important;
}

#login-container {
    display: none;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at 50% 50%, #15162a 0%, #080912 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
}

/* ==========================================================================
   APP SIMULATOR MOBILE & AI TERMINAL STYLES
   ========================================================================== */
.phone-chassis {
    width: 330px;
    height: 620px;
    background-color: #0b0c10;
    border: 10px solid #1f2833;
    border-radius: 36px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6), inset 0 0 8px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phone-notch {
    width: 110px;
    height: 16px;
    background-color: #1f2833;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.phone-speaker {
    width: 35px;
    height: 3px;
    background-color: #555;
    border-radius: 2px;
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
}

.phone-screen {
    flex: 1;
    background-color: #0d0e12;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.mobile-header {
    height: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px 0 18px;
    font-size: 10px;
    color: #a0aec0;
    z-index: 99;
    font-weight: 600;
    flex-shrink: 0;
}

.mobile-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.mobile-app-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.mobile-screen {
    display: none;
    flex: 1;
    flex-direction: column;
    height: 100%;
}

.mobile-screen.active {
    display: flex;
}

/* Screen 1: Login styling */
#mob-screen-login {
    justify-content: center;
    padding: 20px;
}

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

.mob-login-logo i {
    font-size: 40px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.mob-login-logo h4 {
    font-family: 'Outfit', sans-serif;
    color: white;
    margin: 0;
    font-size: 16px;
}

.mob-form-group {
    margin-bottom: 12px;
}

.mob-form-group input {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-size: 12px;
}

.mob-btn-full {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.mob-select {
    width: 100%;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-size: 11px;
}

/* Screen 2: Map View styling */
#mob-screen-map {
    height: 100%;
}

.mob-title-bar {
    height: 38px;
    background: #15161c;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    flex-shrink: 0;
}

.mob-title-bar h5 {
    margin: 0;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.mob-title-city {
    background: rgba(59,130,246,0.2);
    color: #3b82f6;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
}

.mob-map-container {
    flex: 1;
    position: relative;
    background: #14151a;
    overflow: hidden;
}

.mob-mock-map {
    width: 100%;
    height: 100%;
    background-color: #1a1b22;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 14px 14px;
    position: relative;
}

.mob-map-user-pin {
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #3b82f6;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse 2s infinite;
}

.mob-map-user-pin i {
    font-size: 8px;
    color: white;
    transform: rotate(45deg);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.mob-map-pin {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: -2px 2px 4px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.mob-map-pin:hover {
    transform: rotate(-45deg) scale(1.2);
}

.mob-map-pin-inner {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transform: rotate(45deg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7px;
}

.pin-orange {
    background: #f97316; /* Public Sea */
}

.pin-blue {
    background: #3b82f6; /* Followed */
}

.mob-map-popup {
    position: absolute;
    bottom: -180px;
    left: 8px;
    right: 8px;
    background: rgba(21, 22, 28, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    transition: bottom 0.3s ease;
    z-index: 100;
}

.mob-map-popup.active {
    bottom: 8px;
}

.popup-close-btn {
    position: absolute;
    right: 10px;
    top: 6px;
    font-size: 15px;
    color: #9ca3af;
    cursor: pointer;
}

/* Screen 3: Calling Screen */
.calling-screen {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    text-align: center;
}

.calling-avatar {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.calling-screen h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.calling-screen p {
    color: #9ca3af;
    font-size: 11px;
    margin-bottom: 15px;
}

.calling-status {
    font-size: 11px;
    color: #60a5fa;
    font-weight: 500;
    margin-bottom: 6px;
}

.calling-timer {
    font-size: 24px;
    font-weight: 700;
    color: white;
    font-family: monospace;
    margin-bottom: 20px;
}

.dialer-record-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #f87171;
    margin-bottom: 30px;
}

.btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    padding: 0;
    box-shadow: 0 6px 15px rgba(239,68,68,0.4);
}

/* Screen 4: Visit style */
.mob-camera-box {
    width: 100%;
    height: 150px;
    background: #111827;
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-lens-placeholder {
    text-align: center;
}

.camera-watermark {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0,0,0,0.65);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 9px;
    color: #34d399;
    text-align: left;
    line-height: 1.3;
}

.camera-watermark p {
    margin: 0;
}

/* Screen 5: AI Dictation Styles */
.btn-circle-lg {
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(59,130,246,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-circle-lg:active {
    transform: scale(0.9);
}

.recording-active {
    background: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239,68,68,0.6) !important;
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Bottom Navigation Bar */
.mobile-nav-bar {
    height: 48px;
    background: #15161c;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-shrink: 0;
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 8px;
    color: #6b7280;
    cursor: pointer;
    padding: 3px 10px;
    transition: color 0.2s;
}

.mob-nav-item i {
    font-size: 16px;
}

.mob-nav-item.active {
    color: #3b82f6;
}

.phone-home-btn {
    height: 14px;
    background: #0b0c10;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.phone-home-btn::after {
    content: '';
    width: 70px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

/* Real-time AI logs terminal */
.monitor-terminal {
    max-height: calc(100% - 40px);
}

.terminal-line {
    margin-bottom: 4px;
    word-break: break-all;
    line-height: 1.4;
}

.terminal-line.sql-line {
    color: #60a5fa; /* Blue for SQL */
}

.terminal-line.ai-line {
    color: #f472b6; /* Pink for AI */
}

.terminal-line.api-line {
    color: #fbbf24; /* Yellow for API */
}

.terminal-line.success-line {
    color: #34d399; /* Green for success */
}

.blink-animation {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

