@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --white: #ffffff;
    --bg: #f5f5f7;
    --bg-secondary: #fbfbfd;
    --border: #e5e5e7;
    --border-light: #f0f0f2;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --accent: #1d1d1f;
    --accent-hover: #333336;
    --link: #424245;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --info: #5ac8fa;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.2s ease;
    --bottom-nav-height: 64px;
    --mobile-header-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}

/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

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

.login-logo img {
    width: 72px;
    height: 72px;
    border-radius: 16px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 36px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px; /* Prevents iOS zoom */
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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

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

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px; /* Touch target */
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

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

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

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

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

.btn-danger:hover {
    opacity: 0.9;
}

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

.login-error {
    background: #fff2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    border: 1px solid #ffe0e0;
}

/* ========== MOBILE HEADER ========== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    padding-top: var(--safe-top);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 8px;
}

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

.mobile-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.mobile-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-menu-btn:active {
    background: var(--bg);
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 299;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ========== LAYOUT ========== */
.app-container {
    display: none;
}

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

.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-header span {
    font-size: 12px;
    color: var(--text-tertiary);
    display: block;
    margin-top: 0px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    min-height: 44px;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

.logout-btn {
    width: 100%;
    margin-top: 8px;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    padding-bottom: var(--safe-bottom);
    background: var(--white);
    border-top: 1px solid var(--border);
    z-index: 200;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
    font-family: inherit;
    transition: color var(--transition);
    padding: 8px 4px;
    min-width: 48px;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.bottom-nav-item.active {
    color: var(--text-primary);
}

.bottom-nav-item:active {
    color: var(--text-primary);
    background: var(--bg);
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ========== PAGE HEADER ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* ========== DASHBOARD STATS ========== */
.page-body {
    padding: 24px 32px;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

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

.stat-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ========== FILTERS ========== */
.filter-bar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
    min-height: 40px;
}

.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--text-tertiary);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    background: var(--bg-secondary);
    transition: border-color var(--transition);
    min-height: 44px;
}

.search-input-wrapper input:focus {
    border-color: var(--text-tertiary);
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

/* ========== TABLE ========== */
.data-table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table thead th:hover {
    color: var(--text-primary);
}

.data-table thead th.sorted {
    color: var(--text-primary);
}

.sort-indicator {
    font-size: 10px;
    margin-left: 4px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:active {
    background: var(--border-light);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.data-table td.secondary {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    gap: 8px;
}

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

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

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg);
    color: var(--text-primary);
}

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

.pagination-current {
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-score {
    min-width: 28px;
    text-align: center;
    justify-content: center;
}

.badge-score-high { background: #e8f5e9; color: #2e7d32; }
.badge-score-mid { background: #fff8e1; color: #f57f17; }
.badge-score-low { background: #fbe9e7; color: #c62828; }
.badge-score-none { background: var(--bg); color: var(--text-tertiary); }
.badge-draft { background: var(--bg); color: var(--text-secondary); }
.badge-sent { background: #e3f2fd; color: #1565c0; }
.badge-accepted { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #fbe9e7; color: #c62828; }
.badge-planned { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: var(--bg); color: var(--text-tertiary); }

/* ========== TAG ========== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    background: var(--bg);
    color: var(--text-secondary);
    margin: 2px;
}

.tag-name { font-weight: 500; color: var(--text-primary); }
.tag-dept { margin-left: 6px; font-size: 11px; color: var(--text-tertiary); }

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ========== CLIENT CARD ========== */
.client-header {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 28px;
    margin-bottom: 20px;
}

.client-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    word-break: break-word;
}

.client-sector {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.client-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.client-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-meta-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.client-meta-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 450;
    word-break: break-word;
}

.client-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ========== FORM DETAIL ========== */
.detail-section { margin-bottom: 20px; }

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    word-break: break-word;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

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

/* ========== CALENDAR ========== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.calendar-header-cell {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.calendar-cell {
    min-height: 100px;
    padding: 8px;
    background: var(--white);
    cursor: pointer;
    transition: background var(--transition);
}

.calendar-cell:hover { background: var(--bg); }
.calendar-cell.other-month { background: var(--bg-secondary); }
.calendar-cell.other-month .calendar-date { color: var(--border); }
.calendar-cell.today { background: #fafafa; }
.calendar-cell.today .calendar-date {
    background: var(--accent);
    color: var(--white);
}

.calendar-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px;
}

.calendar-event-dot {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event-dot.meeting { background: #e3f2fd; color: #1565c0; }
.calendar-event-dot.call { background: #e8f5e9; color: #2e7d32; }
.calendar-event-dot.presentation { background: #fff8e1; color: #f57f17; }
.calendar-event-dot.follow_up { background: #fce4ec; color: #c62828; }

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-nav h2 {
    font-size: 18px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.calendar-nav button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.calendar-nav button:hover { background: var(--bg); }
.calendar-nav button:active { background: var(--border-light); }

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition);
    flex-shrink: 0;
}

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

.modal-body {
    padding: 24px;
}

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

/* ========== TIMELINE ========== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-dot.meeting { background: #1565c0; }
.timeline-dot.proposal { background: #2e7d32; }
.timeline-dot.event { background: #f57f17; }
.timeline-dot.create { background: var(--text-tertiary); }
.timeline-dot.call { background: #2e7d32; }
.timeline-dot.presentation { background: #f57f17; }
.timeline-dot.follow_up { background: #c62828; }

.timeline-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

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

.empty-state-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state-text { font-size: 13px; }

/* ========== PROPOSALS ========== */
.proposal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.proposal-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.proposal-card:hover { box-shadow: var(--card-shadow-hover); }
.proposal-card:active { background: var(--bg); }

.proposal-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.proposal-client {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.proposal-amount {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.proposal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    gap: 8px;
    flex-wrap: wrap;
}

.proposal-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ========== DAY EVENTS PANEL ========== */
.day-events-panel {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-top: 20px;
}

.day-events-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-events-header h3 { font-size: 15px; font-weight: 600; }

.day-event-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

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

.day-event-time {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 50px;
    flex-shrink: 0;
}

.day-event-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.day-event-info {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ========== BACK LINK ========== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: color var(--transition);
    border: none;
    background: none;
    min-height: 44px;
}

.back-link:hover { color: var(--text-primary); }

/* ========== ATTENDEE INPUT ========== */
.attendee-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.attendee-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attendee-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.attendee-row input:focus { border-color: var(--text-tertiary); }

.attendee-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.attendee-remove:hover { background: #fbe9e7; color: var(--danger); }

.add-attendee-btn {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
    border: none;
    background: none;
    transition: color var(--transition);
    min-height: 44px;
}

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

/* ========== CONTACT CARD ========== */
.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.contact-card:last-child { border-bottom: none; }

.contact-info { flex: 1; min-width: 0; }

.contact-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.contact-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 1px;
    word-break: break-word;
}

/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Sidebar becomes slide-in */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    /* Show bottom nav */
    .bottom-nav {
        display: flex;
    }

    /* Main content adjustments */
    .main-content {
        margin-left: 0;
        padding-top: var(--mobile-header-height);
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    }

    /* Page header */
    .page-header {
        padding: 16px;
        top: var(--mobile-header-height);
        flex-wrap: wrap;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .page-header-actions {
        width: auto;
    }

    .page-header-actions .btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    /* Page body */
    .page-body {
        padding: 16px;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Two column -> one column */
    .detail-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .client-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .client-stats .stat-card {
        padding: 12px;
    }

    .client-stats .stat-value {
        font-size: 20px;
    }

    /* Client header */
    .client-header {
        padding: 20px 16px;
    }

    .client-name {
        font-size: 22px;
    }

    .client-meta {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Filter bar */
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1;
    }

    /* Detail rows for mobile */
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .detail-row span:last-child {
        max-width: 100% !important;
        text-align: left !important;
    }

    /* Modal -> full screen */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-header {
        border-radius: 0;
        padding: 16px;
        padding-top: calc(16px + var(--safe-top));
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 16px;
        padding-bottom: calc(16px + var(--safe-bottom));
        position: sticky;
        bottom: 0;
        background: var(--white);
    }

    /* Proposals */
    .proposal-grid {
        grid-template-columns: 1fr;
    }

    .proposal-amount {
        font-size: 20px;
    }

    /* Calendar */
    .calendar-cell {
        min-height: 54px;
        padding: 4px;
    }

    .calendar-date {
        font-size: 12px;
        width: 24px;
        height: 24px;
    }

    .calendar-event-dot {
        font-size: 0;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        padding: 0;
        display: inline-block;
        margin: 1px;
        min-width: 6px;
    }

    .calendar-header-cell {
        padding: 8px 2px;
        font-size: 11px;
    }

    .calendar-nav h2 {
        font-size: 16px;
        min-width: 140px;
    }

    /* Login */
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .login-logo img {
        width: 60px;
        height: 60px;
    }

    .login-card h1 {
        font-size: 24px;
    }

    /* Day events */
    .day-event-item {
        padding: 12px 16px;
    }

    /* Card body */
    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .pagination-info {
        font-size: 12px;
    }

    /* Toast */
    .toast {
        left: 16px;
        right: 16px;
        bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
        text-align: center;
    }
}

/* Small phones optimization */
@media (max-width: 375px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .page-header h1 {
        font-size: 16px;
    }

    .client-stats {
        grid-template-columns: 1fr;
    }

    .client-meta {
        grid-template-columns: 1fr;
    }
}

/* Tablet (show sidebar) */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-header {
        display: none;
    }

    .bottom-nav {
        display: none;
    }

    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }
}

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

.page-body > * {
    animation: fadeIn 0.3s ease;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ========== NOTIFICATION ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== MAIN TOPBAR & GLOBAL SEARCH ========== */
.main-topbar {
    padding: 12px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 60;
}

.global-search-wrapper {
    position: relative;
    max-width: 480px;
}

.global-search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 2;
}

.global-search-wrapper input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    transition: all var(--transition);
}

.global-search-wrapper input:focus {
    border-color: var(--text-tertiary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.global-search-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.global-search-results.show {
    display: block;
    animation: fadeSlideDown 0.15s ease;
}

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

.search-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.search-section:last-child { border-bottom: none; }

.search-section-title {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg);
}

.search-result-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.search-result-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}

.search-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== FILTER TOOLBAR ========== */
.filter-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition);
    min-height: 42px;
}

.search-box input:focus {
    border-color: var(--text-tertiary);
}

.search-box-sm {
    max-width: 260px;
}

.search-box-sm input {
    padding: 8px 12px 8px 34px;
    font-size: 13px;
    min-height: 36px;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    cursor: pointer;
    min-height: 42px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition);
}

.filter-select:focus {
    border-color: var(--text-tertiary);
}

/* ========== TABLE ENHANCEMENTS ========== */
.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-count {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.clickable-row {
    cursor: pointer;
}

.client-name-cell {
    font-weight: 500;
    color: var(--text-primary);
}

.empty-cell {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--text-tertiary);
    font-size: 14px;
}

.error-text {
    color: var(--danger);
    text-align: center;
    padding: 20px;
}

.contact-count {
    font-weight: 600;
    font-size: 14px;
}

.contact-count.active {
    color: var(--success);
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px !important;
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 11px;
}

th.sortable.sort-asc::after {
    content: '↑';
    opacity: 0.8;
}

th.sortable.sort-desc::after {
    content: '↓';
    opacity: 0.8;
}

.badge-sector {
    background: rgba(90, 200, 250, 0.1);
    color: #0a84ff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 100px;
}

/* ========== NEW PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 16px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all var(--transition);
    padding: 0 4px;
}

.page-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.page-btn.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.page-dots {
    padding: 0 6px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== CLIENT INFO GRID ========== */
.client-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.info-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.info-content {
    min-width: 0;
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

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

.text-success {
    color: var(--success);
}

.address-bar {
    padding: 14px 18px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.address-bar strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========== CONTACTS CARD ========== */
.contacts-card {
    margin-bottom: 24px;
}

.contacts-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    gap: 6px;
}

.pill {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.pill:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.pill.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ========== CONTACT ROWS ========== */
.contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

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

.contact-row:hover {
    background: var(--bg);
}

.contact-row.inactive {
    opacity: 0.6;
}

.contact-row.inactive:hover {
    opacity: 0.85;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--white);
}

.contact-avatar.active {
    background: linear-gradient(135deg, #34c759, #30b350);
}

.contact-avatar.inactive {
    background: linear-gradient(135deg, #8e8e93, #636366);
}

.contact-main {
    flex: 1;
    min-width: 0;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.contact-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

.contact-status-badge.active {
    background: rgba(52, 199, 89, 0.12);
    color: #248a3d;
}

.contact-status-badge.inactive {
    background: rgba(142, 142, 147, 0.12);
    color: #636366;
}

.contact-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
    flex-wrap: wrap;
}

.contact-title {
    font-size: 12px;
    color: var(--text-secondary);
}

.contact-dept {
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg);
    padding: 1px 8px;
    border-radius: 100px;
}

.contact-details {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.contact-email,
.contact-phone {
    font-size: 12px;
    color: var(--text-tertiary);
}

.contact-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

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

.btn-icon:active {
    background: var(--border-light);
}

/* ========== SECTOR BARS (Dashboard) ========== */
.sector-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sector-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sector-bar-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    width: 140px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.sector-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d1d1f, #424245);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.sector-bar-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ========== STAT CARD ENHANCED ========== */
.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.stat-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.stat-content {
    flex: 1;
}

/* ========== FORM ROW ========== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== CARD HEADER ACTIONS ========== */
.card-header-actions {
    display: flex;
    gap: 8px;
}

/* ========== RESPONSIVE OVERRIDES ========== */
@media (max-width: 768px) {
    .main-topbar {
        padding: 10px 16px;
        top: calc(var(--mobile-header-height) + var(--safe-top));
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-select {
        width: 100%;
    }

    .client-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contacts-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box-sm {
        max-width: none;
    }

    .filter-pills {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .contact-row {
        padding: 12px 14px;
    }

    .contact-actions {
        flex-direction: column;
        gap: 2px;
    }

    .btn-icon {
        width: 30px;
        height: 30px;
    }

    .sector-bar-label {
        width: 100px;
        font-size: 12px;
    }

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

    .page-header {
        padding: 16px;
    }

    .page-body {
        padding: 16px;
    }

    .global-search-wrapper {
        max-width: none;
    }
}
