:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-sidebar: #141720;
    --bg-input: #232736;
    --border: #2a2e3d;
    --text: #e4e6ed;
    --text-muted: #8b8fa3;
    --primary: #4f8cff;
    --primary-hover: #3a75e6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --purple: #a78bfa;
    --cyan: #22d3ee;
    --orange: #fb923c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 0;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(52%) sepia(72%) saturate(530%) hue-rotate(189deg) brightness(100%) contrast(101%);
}

.sidebar-logo h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Auth page logo */
.auth-logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-logo img {
    width: 64px;
    height: 64px;
    border-radius: 0;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(52%) sepia(72%) saturate(530%) hue-rotate(189deg) brightness(100%) contrast(101%);
}

.sidebar-nav { flex: 1; }

.sidebar-nav a, .sidebar-nav span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.sidebar-nav a svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--text);
    background: rgba(79, 140, 255, 0.08);
    border-right: 2px solid var(--primary);
}

.sidebar-nav a:hover svg, .sidebar-nav a.active svg {
    opacity: 1;
}

.sidebar-nav .nav-section {
    padding: 0.875rem 1.5rem 0.25rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.5;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.sidebar-footer .user-info {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.sidebar-footer .user-name { color: var(--text); font-weight: 500; }
.sidebar-footer .user-role { color: var(--text-muted); font-size: 0.75rem; }

.main {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
    max-width: calc(100% - 240px);
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; max-width: 100%; padding: 1rem; padding-top: 4rem; }
    .sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    .sidebar-overlay.show { display: block; }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Pipeline bar */
.pipeline-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pipeline-stage {
    flex: 1;
    min-width: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.pipeline-stage:hover {
    border-color: var(--primary);
}

.pipeline-stage .stage-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.pipeline-stage .stage-name {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stage badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 85px;
    text-align: center;
}

.badge-new { background: rgba(79, 140, 255, 0.15); color: var(--primary); }
.badge-meeting-set { background: rgba(34, 211, 238, 0.15); color: var(--cyan); }
.badge-scoping { background: rgba(251, 146, 60, 0.15); color: var(--orange); }
.badge-proposal { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.badge-negotiation { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-closed-won { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-closed-lost { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }

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

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

td { font-size: 0.875rem; }

tr:hover { background: rgba(79, 140, 255, 0.04); }

.table-link {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-block;
}
.table-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(79, 140, 255, 0.06);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }

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

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

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

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

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-success { background: rgba(52, 211, 153, 0.12); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.2); }
.flash-error { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.2); }
.flash-info { background: rgba(96, 165, 250, 0.12); color: var(--info); border: 1px solid rgba(96, 165, 250, 0.2); }
.flash-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.2); }

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-box h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--primary);
}

.auth-box .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.qr-container { text-align: center; margin: 1.5rem 0; }
.qr-container img { border-radius: 8px; max-width: 200px; }

.secret-key {
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    letter-spacing: 2px;
    word-break: break-all;
    color: var(--warning);
}

/* Lead detail */
.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.lead-header h2 { font-size: 1.5rem; font-weight: 600; }
.lead-header .lead-meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

.lead-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lead-info-item .info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.lead-info-item .info-value { font-size: 0.9375rem; }

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Contact log timeline */
.timeline { position: relative; padding-left: 2rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 1.5rem; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.375rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg);
}

.timeline-item .tl-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.timeline-item .tl-method { font-weight: 500; font-size: 0.875rem; }
.timeline-item .tl-date { font-size: 0.75rem; color: var(--text-muted); }
.timeline-item .tl-user { font-size: 0.75rem; color: var(--primary); }
.timeline-item .tl-notes { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }

.contact-form {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control { width: auto; min-width: 150px; }

/* Rep stats */
.rep-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rep-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.rep-card .rep-name { font-weight: 600; margin-bottom: 0.75rem; }

.rep-card .rep-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
}

.rep-card .rep-stat .label { color: var(--text-muted); }

/* Section grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 968px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Empty state */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }

/* User status */
.status-active { color: var(--success); }
.status-inactive { color: var(--danger); }

.delete-form { display: inline; }

/* ========== KANBAN BOARD ========== */
.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 160px);
}

.kanban-col {
    min-width: 260px;
    max-width: 300px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-col-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-col-count {
    background: var(--bg-input);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-col-body {
    flex: 1;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 100px;
    transition: background 0.15s;
}

.kanban-col-body.drag-over {
    background: rgba(79, 140, 255, 0.06);
    border-color: var(--primary);
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem;
    cursor: grab;
    transition: all 0.15s;
}

.kanban-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.kanban-card:active { cursor: grabbing; }

.kanban-card-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    display: block;
    margin-bottom: 0.25rem;
}

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

.kanban-card-contact {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.kanban-card-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.25rem;
}

.kanban-card-service {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.kanban-card-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ========== TASKS ========== */
.task-list { display: flex; flex-direction: column; }

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

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

.task-item.task-done { opacity: 0.5; }
.task-item.task-overdue { border-left: 3px solid var(--danger); }

.task-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-item.task-done .task-item-title { text-decoration: line-through; }

.task-item-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.task-item-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    opacity: 0.7;
}

.task-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: transparent;
    transition: all 0.15s;
    flex-shrink: 0;
}

.task-check:hover { border-color: var(--primary); }
.task-check.checked { background: var(--success); border-color: var(--success); color: #fff; }

/* Task mini list (for dashboard and lead detail) */
.task-mini-list { display: flex; flex-direction: column; }

.task-mini-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.task-mini-item:last-child { border-bottom: none; }
.task-mini-item.task-done { opacity: 0.5; }
.task-mini-item.task-done .task-mini-title { text-decoration: line-through; }

.task-mini-title {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.task-mini-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Priority dots */
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.priority-low { background: var(--info); }
.priority-medium { background: var(--warning); }
.priority-high { background: var(--danger); }

.priority-bg-low { background: rgba(96, 165, 250, 0.2); color: var(--info); }
.priority-bg-medium { background: rgba(251, 191, 36, 0.2); color: var(--warning); }
.priority-bg-high { background: rgba(248, 113, 113, 0.2); color: var(--danger); }

/* ========== CALENDAR ========== */
.calendar-grid { overflow: hidden; }

.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.cal-header > div {
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day {
    min-height: 100px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.375rem;
}

.cal-day:nth-child(7n) { border-right: none; }
.cal-empty { background: rgba(0,0,0,0.1); }

.cal-today {
    background: rgba(79, 140, 255, 0.08);
}

.cal-day-num {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.cal-today .cal-day-num {
    color: var(--primary);
    font-weight: 700;
}

.cal-tasks { display: flex; flex-direction: column; gap: 2px; }

.cal-task-dot {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-task-done { opacity: 0.4; text-decoration: line-through; }
.cal-task-more { font-size: 0.625rem; color: var(--text-muted); padding: 0.125rem 0.375rem; }

/* ========== NOTIFICATIONS ========== */
.notif-btn { position: relative; }

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-list { display: flex; flex-direction: column; }

.notif-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

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

.notif-unread {
    background: rgba(79, 140, 255, 0.06);
    border-left: 3px solid var(--primary);
}

.notif-message { font-size: 0.875rem; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ========== ATTACHMENTS ========== */
.attachment-list { display: flex; flex-direction: column; gap: 0.5rem; }

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

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

.att-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

.att-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.125rem;
}

/* ========== CHARTS ========== */
.chart-bars { display: flex; flex-direction: column; gap: 0.625rem; }

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 85px;
    text-align: right;
    white-space: nowrap;
}

.chart-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

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

.chart-bar-value {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 30px;
}

/* ========== RESPONSIVE FIXES ========== */
@media (max-width: 768px) {
    th, td { padding: 0.5rem; font-size: 0.8125rem; }
    .kanban-board { flex-direction: column; }
    .kanban-col { min-width: 100%; max-width: 100%; }
    .cal-day { min-height: 60px; }
    .cal-task-dot { font-size: 0.5625rem; }
}

code {
    background: var(--bg-input);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

/* ========== VISIT PLANNER ========== */
.visit-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

@media (max-width: 968px) {
    .visit-week-grid { grid-template-columns: 1fr; }
}

.visit-day-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.visit-today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.visit-day-header {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visit-day-name {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-today .visit-day-name { color: var(--primary); }

.visit-day-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.visit-day-body {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.visit-card {
    background: var(--bg-input);
    border-radius: 6px;
    padding: 0.625rem;
    border-left: 3px solid var(--primary);
}

.visit-completed { border-left-color: var(--success); opacity: 0.6; }
.visit-cancelled { border-left-color: var(--danger); opacity: 0.5; text-decoration: line-through; }

.visit-card-company {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.visit-card-time {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.visit-card-contact {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.visit-card-location {
    font-size: 0.6875rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.visit-card-rep {
    font-size: 0.6875rem;
    color: var(--cyan);
    margin-top: 0.25rem;
}

.visit-card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.375rem;
    flex-wrap: wrap;
}

.visit-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.visit-add-btn {
    display: block;
    text-align: center;
    padding: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 4px;
    transition: all 0.15s;
    margin-top: auto;
}

.visit-add-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(79, 140, 255, 0.06);
}
