/* ==========================
   CRM LEAD - COMPLETE STYLES
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #3b82f6;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
}

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

.app {
    display: flex;
    min-height: 100vh;
}

/* ==========================
   SIDEBAR
========================== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.logo {
    height: 70px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo i {
    font-size: 22px;
    color: var(--primary);
}

.logo span:first-of-type {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.offline-badge {
    font-size: 10px;
    background: var(--success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: auto;
}

.menu {
    list-style: none;
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.menu li,
.submenu {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s ease;
}

.menu li:hover,
.submenu:hover {
    background: var(--sidebar-hover);
    color: var(--white);
}

.menu li.active {
    background: var(--sidebar-active);
    color: var(--white);
}

.menu li.active i:first-child {
    color: var(--white);
}

.submenu {
    padding-left: 54px;
    font-size: 13px;
}

.submenu i {
    font-size: 6px;
}

.arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.menu-item.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
}

.menu-item.open + .submenu,
.menu-item.open ~ .submenu {
    display: flex;
}

.logout-btn {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--success) !important;
}

.logout-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

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

.storage-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.storage-info i {
    color: var(--primary);
}

.storage-info span:last-child {
    margin-left: auto;
    color: var(--success);
    font-weight: 600;
}

/* ==========================
   MAIN CONTENT
========================== */
.content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
}

.topbar-center {
    flex: 1;
    text-align: center;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-main);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.user-info i {
    font-size: 18px;
    color: var(--primary);
}

/* ==========================
   PAGES
========================== */
.page {
    display: none;
    padding: 28px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ==========================
   DASHBOARD
========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

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

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

.stat-blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-green .stat-icon { background: var(--success-light); color: var(--success); }
.stat-orange .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-purple .stat-icon { background: #ede9fe; color: var(--purple); }

.stat-content h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.status-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-bar-label {
    width: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.status-bar-count {
    width: 35px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-info {
    flex: 1;
}

.activity-info p {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

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

.agent-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.agent-info {
    flex: 1;
}

.agent-info p {
    font-size: 14px;
    font-weight: 600;
}

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

.weekly-stats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
}

.day-item {
    padding: 12px 4px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.day-item .day-name {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.day-item .day-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.day-item.today {
    background: var(--primary);
    color: white;
}

.day-item.today .day-name,
.day-item.today .day-count {
    color: white;
}

/* ==========================
   TABLE
========================== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.table-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.entries-select,
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.entries-select select,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
}

.entries-select select:focus,
.filter-group select:focus {
    border-color: var(--primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 220px;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.selection-actions,
.export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.selected-count {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    padding: 4px 10px;
    background: var(--primary-light);
    border-radius: 20px;
}

/* ==========================
   BUTTONS
========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
    background: var(--bg-main);
    border-color: #cbd5e1;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ==========================
   TABLE DATA
========================== */
.table-wrapper {
    overflow-x: auto;
}

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

th {
    background: var(--bg-main);
    padding: 14px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

td {
    padding: 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    vertical-align: middle;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.location-cell {
    white-space: normal;
    max-width: 180px;
}

.checkbox-col {
    width: 40px;
    text-align: center;
}

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

tbody tr {
    background: #ffffff;
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr.selected {
    background: var(--primary-light);
}

.phone-cell {
    cursor: pointer;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.phone-cell:hover {
    text-decoration: underline;
}

.phone-cell i {
    font-size: 12px;
}

.status-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    cursor: pointer;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 130px;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
}

.action-cell {
    display: flex;
    gap: 6px;
}

.edit-btn,
.delete-btn,
.view-btn {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

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

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

.edit-btn {
    background: var(--success-light);
    color: var(--success);
}

.edit-btn:hover {
    background: var(--success);
    color: white;
}

.delete-btn {
    background: var(--danger-light);
    color: var(--danger);
}

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

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
}

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

.pagination {
    display: flex;
    gap: 4px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-main);
    border-color: var(--primary);
}

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

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================
   FORMS
========================== */
.form-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 900px;
}

.form-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.form-header h2 i {
    color: var(--primary);
}

.form-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: var(--text-muted);
    font-size: 13px;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ==========================
   CSV IMPORT SECTION
========================== */
.csv-import-section {
    margin-bottom: 24px;
}

.csv-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-main);
}

.csv-upload-area:hover,
.csv-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.csv-upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.csv-upload-area h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.csv-upload-area p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.csv-template-info {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.csv-template-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csv-template-info h4 i {
    color: var(--primary);
}

.csv-template-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.csv-template-info code {
    display: block;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Consolas', monospace;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.csv-example {
    margin: 12px 0;
}

.csv-example strong {
    font-size: 13px;
    color: var(--text-primary);
}

.csv-example pre {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Consolas', monospace;
    overflow-x: auto;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

.csv-preview {
    margin-top: 24px;
}

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

.csv-preview-header h4 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csv-preview-header h4 i {
    color: var(--success);
}

.csv-preview-actions {
    display: flex;
    gap: 8px;
}

.csv-preview-table {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.csv-preview-table table {
    width: 100%;
    border-collapse: collapse;
}

.csv-preview-table th {
    background: var(--bg-main);
    position: sticky;
    top: 0;
    font-size: 12px;
    padding: 12px 10px;
}

.csv-preview-table td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.csv-preview-table tbody tr {
    background: #ffffff;
}

.csv-preview-table tbody tr:hover {
    background: #f8fafc;
}

.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
    max-width: 900px;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.form-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================
   STATUS PAGE
========================== */
.status-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.status-container h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-container h2 i {
    color: var(--primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

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

.status-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.status-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.status-color {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 12px;
}

.status-card h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.status-card p {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================
   AGENTS PAGE
========================== */
.agents-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.add-agent-form {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.add-agent-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.add-agent-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.agent-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.agent-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.agent-card-info {
    flex: 1;
}

.agent-card-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.agent-card-actions {
    display: flex;
    gap: 8px;
}

/* ==========================
   IMPORT/EXPORT PAGE
========================== */
.ie-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ie-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.ie-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.import-icon {
    background: var(--success-light);
    color: var(--success);
}

.danger-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.ie-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.ie-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.ie-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warning {
    font-size: 12px;
    color: var(--warning);
    margin-top: 16px;
}

.danger-zone {
    border: 2px solid var(--danger-light);
}

/* ==========================
   NOTIFICATION
========================== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification.success { background: var(--success); }
.notification.error { background: var(--danger); }
.notification.info { background: var(--primary); }

/* ==========================
   MODALS
========================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    margin: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.modal.show .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--danger);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

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

/* Client Details Modal */
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
}

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

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

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ==========================
   LOGIN PAGE
========================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.login-field {
    text-align: left;
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-field label i {
    margin-right: 4px;
    color: var(--text-muted);
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    min-height: 18px;
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

.login-error.show {
    display: block;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .status-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ie-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .mobile-menu {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .table-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .tools-left {
        flex-direction: column;
        align-items: stretch;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .table-footer {
        flex-direction: column;
        gap: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-center {
        display: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .action-cell {
        flex-direction: column;
    }

    .action-cell .btn {
        width: 100%;
        justify-content: center;
    }

    .add-agent-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 16px;
    }

    .form-container,
    .status-container,
    .agents-container {
        padding: 20px;
    }

    .weekly-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .table-tools,
    .action-bar,
    .table-footer,
    .notification {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
    }

    .table-container {
        box-shadow: none;
        border: none;
    }

    tbody tr {
        background: white !important;
    }
}
