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

:root {
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --blue-dark: #1d4ed8;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --green: #16a34a;
    --green-light: #dcfce7;
    --yellow: #ca8a04;
    --yellow-light: #fef9c3;
    --red: #dc2626;
    --red-light: #fee2e2;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --purple: #7c3aed;
    --purple-light: #f3e8ff;
    --radius: 0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

.hidden { display: none !important; }

/* LOGIN */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
}

.login-card {
    background: white;
    border-radius: 0;
    padding: 48px 40px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: #1a2744;
    color: white;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    margin: 0 auto 16px;
}

.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.login-logo p { color: var(--gray-500); font-size: 15px; margin-bottom: 32px; }

#loginForm input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 0;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

#loginForm input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

#loginForm button {
    width: 100%;
    padding: 12px;
    background: #1a2744;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

#loginForm button:hover { background: var(--blue-dark); }
.login-error { color: var(--red); margin-top: 12px; font-size: 14px; min-height: 20px; }

/* HEADER */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-small {
    width: 36px; height: 36px; background: #1a2744; color: white;
    border-radius: 0; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.header-left h1 { font-size: 18px; font-weight: 700; color: var(--gray-800); }
.header-center { flex: 1; max-width: 560px; }
.header-right { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }

.search-box {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--gray-400);
}
.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--gray-50);
    transition: all 0.2s;
}
.search-box input:focus { outline: none; border-color: var(--blue); background: white; box-shadow: 0 0 0 3px var(--blue-light); }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; font-family: inherit;
    cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: white; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-ghost { background: none; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #15803d; }
.btn-green:disabled { background: var(--gray-300); cursor: not-allowed; }

/* STATS */
.stats-bar {
    display: flex; gap: 0; padding: 0 24px;
    background: white; border-bottom: 1px solid var(--gray-200);
}
.stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 24px; flex: 1;
    border-right: 1px solid var(--gray-100);
}
.stat:last-child { border-right: none; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }

/* CONTENT LAYOUT */
.content {
    display: flex;
    height: calc(100vh - 64px - 65px);
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 20px;
    overflow-y: auto;
}
.sidebar h3 { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }

.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-600); margin-bottom: 6px; }
.filter-group select, .filter-group input[type="text"] {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; font-family: inherit; background: white;
}
.filter-group select:focus, .filter-group input[type="text"]:focus { outline: none; border-color: var(--blue); }

/* Multi select */
.multi-select { position: relative; }
.multi-select-display {
    padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; cursor: pointer; background: white; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
}
.multi-select-display::after { content: '\25BC'; font-size: 10px; color: var(--gray-400); }
.multi-select-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
    box-shadow: var(--shadow-md); max-height: 250px; overflow-y: auto; z-index: 50;
}
.multi-select-dropdown label {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-size: 13px; cursor: pointer; margin: 0;
}
.multi-select-dropdown label:hover { background: var(--gray-50); }

/* Toggle */
.toggle-group { margin-top: 8px; }
.toggle-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; cursor: pointer; user-select: none;
}
.toggle-label input { display: none; }
.toggle-slider {
    width: 40px; height: 22px; background: var(--gray-300);
    border-radius: 0; position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-slider::after {
    content: ''; width: 18px; height: 18px; background: white;
    border-radius: 0; position: absolute; top: 2px; left: 2px; transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-slider { background: var(--blue); }
.toggle-label input:checked + .toggle-slider::after { transform: translateX(18px); }

/* RESULTS */
.results {
    flex: 1; padding: 20px; overflow-y: auto;
}
.results-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.results-header span { font-size: 14px; color: var(--gray-500); }

.pagination { display: flex; gap: 4px; }
.pagination button {
    padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
    background: white; font-size: 13px; font-family: inherit; cursor: pointer;
}
.pagination button.active { background: #1a2744; color: white; border-color: #1a2744; }
.pagination button:hover:not(.active) { background: var(--gray-50); }

/* BUSINESS CARDS */
.business-list { display: flex; flex-direction: column; gap: 8px; }

.biz-card {
    background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 16px 20px; display: flex; align-items: center; gap: 16px;
    cursor: pointer; transition: all 0.15s;
}
.biz-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.biz-info { flex: 1; min-width: 0; }
.biz-name { font-weight: 600; font-size: 15px; color: var(--gray-800); margin-bottom: 2px; }
.biz-detail { font-size: 13px; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.biz-detail a { color: var(--blue); text-decoration: none; }
.biz-detail a:hover { text-decoration: underline; }

.biz-trade {
    font-size: 12px; font-weight: 500; color: var(--blue);
    background: var(--blue-light); padding: 2px 10px; border-radius: 0;
}

.biz-rating { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--gray-600); flex-shrink: 0; }
.biz-rating .stars { color: #f59e0b; }

.biz-actions { display: flex; gap: 6px; flex-shrink: 0; }

.biz-quick-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.btn-tag {
    padding: 4px 10px; font-size: 11px; font-weight: 600; font-family: inherit;
    border: 1px solid var(--gray-300); background: white; color: var(--gray-600);
    border-radius: 0; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-tag:hover { border-color: var(--blue); color: var(--blue); }
.btn-tag.tag-active { background: #1a2744; color: white; border-color: #1a2744; }
.rep-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 28px; padding: 0 8px;
    background: var(--gray-100); color: var(--gray-700); font-size: 12px; font-weight: 700;
    border-radius: 0; cursor: pointer; border: 1px solid var(--gray-200);
}
.rep-badge:hover { border-color: var(--blue); }

/* STATUS BADGE */
.status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 0;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-new { background: var(--blue-light); color: var(--blue); }
.status-called { background: var(--purple-light); color: var(--purple); }
.status-no-answer { background: var(--yellow-light); color: var(--yellow); }
.status-interested { background: var(--green-light); color: var(--green); }
.status-not-interested { background: var(--orange-light); color: var(--orange); }
.status-booked { background: var(--green-light); color: #065f46; border: 1px solid #a7f3d0; }
.status-dnc { background: var(--red-light); color: var(--red); }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: start; justify-content: center; padding-top: 40px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content {
    position: relative; background: white; border-radius: 0;
    width: 100%; max-width: 700px; max-height: calc(100vh - 80px);
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); padding: 32px;
}
.modal-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: none; font-size: 28px; color: var(--gray-400);
    cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }

/* Modal inner styles */
.modal-header { margin-bottom: 24px; }
.modal-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.modal-header .biz-trade { display: inline-block; margin-bottom: 12px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 24px; }
.detail-item label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item p { font-size: 14px; color: var(--gray-800); margin-top: 2px; }
.detail-item a { color: var(--blue); text-decoration: none; }
.detail-item a:hover { text-decoration: underline; }

.detail-section { margin-bottom: 24px; }
.detail-section h3 { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 12px; border-bottom: 1px solid var(--gray-100); padding-bottom: 8px; }

.status-select {
    padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; font-family: inherit; cursor: pointer;
}

.modal-actions { display: flex; gap: 8px; margin-bottom: 24px; }

/* Notes */
.notes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.note-item {
    background: var(--gray-50); border-radius: var(--radius); padding: 12px;
    border-left: 3px solid var(--blue);
}
.note-text { font-size: 14px; color: var(--gray-700); white-space: pre-wrap; }
.note-meta { font-size: 12px; color: var(--gray-400); margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.note-delete { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 12px; }
.note-delete:hover { color: var(--red); }

.note-form { display: flex; gap: 8px; }
.note-form textarea {
    flex: 1; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px;
}
.note-form textarea:focus { outline: none; border-color: var(--blue); }

/* Hours */
.hours-list { font-size: 13px; color: var(--gray-600); }
.hours-list div { padding: 2px 0; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 15px; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { width: 240px; }
    .header { padding: 0 16px; gap: 12px; }
}

@media (max-width: 700px) {
    .content { flex-direction: column; height: auto; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--gray-200); }
    .stats-bar { flex-wrap: wrap; }
    .stat { min-width: 33%; }
    .detail-grid { grid-template-columns: 1fr; }
}
