*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --gold: #b89361; --gold-dark: #9a7a4f; --grey: #888;
    --grey-light: #0d0d0d; --grey-mid: #1e1e1e;
    --text: #cccccc; --panel: #111111;
    --danger: #dc3545; --success: #28a745; --sidebar-w: 240px;
}

body { font-family: 'Open Sans', sans-serif; font-size: 14px; color: #ccc; background: #080808; }
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #080808; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid #333; }
.sidebar-logo h2 { font-family: 'Oswald', sans-serif; font-size: 28px; font-weight: 600; color: var(--gold); letter-spacing: 3px; }
.sidebar-logo span { font-size: 11px; color: var(--grey); letter-spacing: 2px; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: #aaa; text-decoration: none; font-size: 13px; transition: all 0.15s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: var(--gold); background: rgba(184,147,97,0.1); border-right: 3px solid var(--gold); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #333; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--grey); }
.sidebar-footer a { color: var(--grey); text-decoration: none; font-size: 11px; }
.sidebar-footer a:hover { color: var(--gold); }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--grey-mid); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 500; color: var(--text); letter-spacing: 1px; }
.content-area { padding: 28px; flex: 1; }
.panel { background: var(--panel); border-radius: 6px; border: 1px solid var(--grey-mid); padding: 24px; margin-bottom: 20px; }
.panel h3 { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 500; letter-spacing: 1px; color: var(--text); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--grey-mid); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header h3 { border: none; padding: 0; margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--panel); border: 1px solid var(--grey-mid); border-radius: 6px; padding: 20px 24px; border-top: 3px solid var(--gold); }
.stat-value { font-family: 'Oswald', sans-serif; font-size: 36px; font-weight: 600; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--grey); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; font-family: 'Oswald', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--grey); border-bottom: 2px solid var(--grey-mid); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--grey-mid); color: var(--text); }
.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--grey-light); }
.form-panel { max-width: 800px; }
.form-section { margin-bottom: 28px; }
.form-section h3 { font-family: 'Oswald', sans-serif; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--grey); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--grey-mid); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--grey); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea { padding: 9px 12px; border: 1px solid var(--grey-mid); border-radius: 4px; font-size: 13px; font-family: 'Open Sans', sans-serif; color: var(--text); background: var(--panel); outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--gold); }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; color: var(--grey); }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--grey-mid); }
.btn-primary { background: var(--gold); color: var(--panel); border: none; padding: 9px 20px; border-radius: 4px; font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.15s; }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: transparent; color: var(--grey); border: 1px solid var(--grey-mid); padding: 9px 20px; border-radius: 4px; font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; text-decoration: none; display: inline-block; transition: all 0.15s; }
.btn-secondary:hover { border-color: var(--grey); color: var(--text); }
.btn-danger { background: var(--danger); color: var(--panel); border: none; padding: 9px 20px; border-radius: 4px; font-family: 'Oswald', sans-serif; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-small { background: var(--gold); color: var(--panel); border: none; padding: 5px 12px; border-radius: 4px; font-size: 12px; font-family: 'Oswald', sans-serif; cursor: pointer; text-decoration: none; }
.btn-block { width: 100%; text-align: center; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--panel); background: var(--grey); text-transform: uppercase; letter-spacing: 0.5px; }
.badge-large { padding: 6px 16px; font-size: 13px; }
.badge-success { background: var(--success); }
.badge-muted { background: var(--grey); }
.status-draft { background: #6c757d; }
.status-sent { background: #0d6efd; }
.status-paid { background: var(--success); }
.status-partial { background: #fd7e14; }
.status-overdue { background: var(--danger); }
.detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--grey); margin-bottom: 4px; }
.info-item span { font-size: 14px; color: var(--text); }
.info-notes { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--grey-mid); }
.info-notes label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--grey); margin-bottom: 6px; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.danger-zone { border-top: 3px solid var(--danger); }
.alert { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #1a3a1a; color: #4caf50; border: 1px solid #2a4a2a; }
.alert-danger { background: #3a1a1a; color: #dc3545; border: 1px solid #4a2a2a; }
.alert-warning { background: #3a3a1a; color: #ffc107; border: 1px solid #4a4a2a; }
.alert-info { background: #1a2a3a; color: #4fc3f7; border: 1px solid #2a3a4a; }
.empty-state { text-align: center; padding: 40px; color: var(--grey); font-size: 14px; }
.empty-state a { color: var(--gold); text-decoration: none; }
.login-page { background: #080808; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: #1a1a1a; border-radius: 8px; padding: 40px; border: 1px solid #2a2a2a; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-family: 'Oswald', sans-serif; font-size: 48px; font-weight: 600; color: var(--gold); letter-spacing: 6px; line-height: 1; }
.login-logo p { font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: 3px; margin-top: 6px; }
.lead-header-card { background: var(--panel); border: 1px solid var(--grey-mid); border-radius: 6px; padding: 20px 24px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.lead-header-left { display: flex; align-items: center; gap: 16px; }
.lead-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--panel); font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lead-header-info h2 { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.lead-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--grey); }
.lead-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lead-priority { font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; }
.priority-low { background: #e8f5e9; color: #2e7d32; }
.priority-normal { background: #e3f2fd; color: #1565c0; }
.priority-high { background: #fff3e0; color: #e65100; }
.priority-urgent { background: #fce4ec; color: #c62828; }
.tab-bar { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--grey-mid); }
.tab-btn { background: none; border: none; padding: 10px 18px; font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 500; color: var(--grey); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; text-transform: uppercase; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-totals { text-align: right; }
.total-row { display: flex; gap: 24px; justify-content: flex-end; margin-bottom: 6px; font-size: 14px; color: var(--grey); }
.total-row strong { color: var(--text); min-width: 80px; text-align: right; }
.total-row.balance strong { font-size: 18px; color: var(--gold); }
/* ── INVOICE BUILDER ── */
.line-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.line-items-table th {
    text-align: left;
    padding: 8px 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--grey);
    border-bottom: 2px solid var(--grey-mid);
}

.line-items-table td {
    padding: 6px 6px;
    border-bottom: 1px solid var(--grey-mid);
    vertical-align: middle;
}

.li-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--grey-mid);
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    background: var(--panel);
    color: var(--text);
    outline: none;
}

.li-input:focus { border-color: var(--gold); }

.li-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding: 0 8px;
}

.remove-row-btn {
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.remove-row-btn:hover { color: var(--danger); background: #fce4ec; }

.invoice-summary {
    margin-top: 16px;
    margin-left: auto;
    width: 280px;
    border-top: 2px solid var(--grey-mid);
    padding-top: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--grey);
}

.summary-row strong { color: var(--text); }

.summary-total {
    border-top: 1px solid var(--grey-mid);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 600;
}

.summary-total strong { color: var(--gold); font-size: 18px; }
/* ── INVOICE DETAIL ── */
.invoice-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.invoice-type-label {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 6px;
}

.invoice-subject {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 8px;
}

.invoice-linked-lead {
    font-size: 13px;
    color: var(--grey);
}

.invoice-linked-lead a {
    color: var(--gold);
    text-decoration: none;
}

.invoice-meta-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.invoice-meta-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grey);
    margin-bottom: 2px;
}

.invoice-meta-item span {
    font-size: 13px;
    color: var(--text);
}

.sidebar-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--grey);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--grey-mid);
}

.sidebar-total-row strong { color: var(--text); }

.balance-due {
    border-bottom: none;
    font-size: 15px;
    font-weight: 600;
}

.balance-due strong { color: var(--gold); font-size: 18px; }
/* ── INVOICE DETAIL ── */
.invoice-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.invoice-type-label { font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 2px; color: var(--gold); margin-bottom: 6px; }
.invoice-subject { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.invoice-linked-lead { font-size: 13px; color: var(--grey); }
.invoice-linked-lead a { color: var(--gold); text-decoration: none; }
.invoice-meta-right { text-align: right; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.invoice-meta-item label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--grey); margin-bottom: 2px; }
.invoice-meta-item span { font-size: 13px; color: var(--text); }
.sidebar-totals { display: flex; flex-direction: column; gap: 8px; }
.sidebar-total-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--grey); padding-bottom: 8px; border-bottom: 1px solid var(--grey-mid); }
.sidebar-total-row strong { color: var(--text); }
.balance-due { border-bottom: none; font-size: 15px; font-weight: 600; }
.balance-due strong { color: var(--gold); font-size: 18px; }

/* ── INVOICE BUILDER ── */
.line-items-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.line-items-table th { text-align: left; padding: 8px 10px; font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--grey); border-bottom: 2px solid var(--grey-mid); }
.line-items-table td { padding: 6px; border-bottom: 1px solid var(--grey-mid); vertical-align: middle; }
.li-input { width: 100%; padding: 7px 10px; border: 1px solid var(--grey-mid); border-radius: 4px; font-size: 13px; font-family: 'Open Sans', sans-serif; background: var(--panel); color: var(--text); outline: none; }
.li-input:focus { border-color: var(--gold); }
.li-amount { font-size: 13px; font-weight: 600; color: var(--text); padding: 0 8px; }
.remove-row-btn { background: none; border: none; color: var(--grey); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 4px; transition: all 0.15s; }
.remove-row-btn:hover { color: var(--danger); background: #fce4ec; }
.invoice-summary { margin-top: 16px; margin-left: auto; width: 280px; border-top: 2px solid var(--grey-mid); padding-top: 12px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--grey); }
.summary-row strong { color: var(--text); }
.summary-total { border-top: 1px solid var(--grey-mid); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 600; }
.summary-total strong { color: var(--gold); font-size: 18px; }
/* ── SETTINGS ── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--panel);
    border: 1px solid var(--grey-mid);
    border-radius: 6px;
    padding: 28px 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    border-top: 3px solid var(--gold);
}

.settings-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.settings-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--gold);
}

.settings-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    border: none;
    padding: 0;
}

.settings-card p {
    font-size: 13px;
    color: var(--grey);
    line-height: 1.5;
}
/* ── PIPELINE ── */
.pipeline-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    min-height: calc(100vh - 160px);
}

.pipeline-col {
    min-width: 240px;
    max-width: 240px;
    background: var(--grey-light);
    border-radius: 6px;
    border: 1px solid var(--grey-mid);
    flex-shrink: 0;
}

.pipeline-col-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel);
    border-radius: 6px 6px 0 0;
}

.pipeline-col-title {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
}

.pipeline-col-count {
    background: var(--grey-mid);
    color: var(--grey);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.pipeline-cards {
    padding: 10px;
    min-height: 100px;
    transition: background 0.15s;
}

.pipeline-cards.drag-over { background: rgba(184,147,97,0.08); }

.pipeline-card {
    background: var(--panel);
    border: 1px solid var(--grey-mid);
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}

.pipeline-card:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pipeline-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.pipeline-card-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text);
}

.pipeline-card-meta {
    font-size: 11px;
    color: var(--grey);
    margin-bottom: 2px;
}

.pipeline-card-priority {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
}
/* Settings nav */
.settings-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--panel-bg, #1e1e1e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}
.settings-nav-item:hover { border-color: #b89361; }
.settings-nav-icon { font-size: 24px; width: 40px; text-align: center; color: #b89361; }
.settings-nav-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.settings-nav-desc { font-size: 12px; color: #888; }

/* Integration cards */
.integration-card {
    border: 1px solid #333;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
}
.integration-card.connected { border-color: #b89361; }
.integration-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.integration-icon {
    width: 44px; height: 44px;
    background: #b89361;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: #000;
    flex-shrink: 0;
}
.integration-title { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.integration-desc { font-size: 13px; color: #888; line-height: 1.5; }
.integration-status { margin-left: auto; flex-shrink: 0; }
.badge-connected { background: #1a3a1a; color: #4caf50; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-disconnected { background: #2a2a2a; color: #888; padding: 4px 12px; border-radius: 20px; font-size: 12px; }
.integration-services { display: flex; flex-direction: column; gap: 0; }
.service-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
    font-size: 13px;
}
.service-row:last-child { border-bottom: none; }
.service-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.service-name { font-weight: 600; color: #ccc; margin-bottom: 2px; }
.service-desc { font-size: 12px; color: #666; }
.service-state { margin-left: auto; color: #b89361; font-weight: 600; flex-shrink: 0; }
/* Collapsible nav sections */
.nav-section { margin-bottom: 4px; }
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.nav-section-header:hover { background: rgba(184,147,97,0.08); }
.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #b89361;
}
.nav-section-arrow { font-size: 10px; color: #b89361; }
.nav-section-items { display: block; }
.nav-item.nav-child { padding-left: 24px; font-size: 13px; }

/* ============================================================
   MOBILE RESPONSIVE — Full Portal
   Breakpoints: 768px (tablet), 480px (phone)
   ============================================================ */

/* ── HAMBURGER BUTTON ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #b89361;
    border-radius: 2px;
    transition: all 0.3s;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

@media (max-width: 768px) {

    /* ── LAYOUT ── */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 150;
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .hamburger {
        display: flex;
    }
    .topbar {
        padding: 0 16px;
        gap: 10px;
    }
    .topbar-title {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    .topbar div[style*="max-width:400px"] {
        display: none;
    }
    .content-area {
        padding: 16px;
    }

    /* ── GRIDS → SINGLE COLUMN ── */
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-sidebar {
        order: -1;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── TABLES ── */
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 8px 8px;
    }
    /* Hide less important columns on mobile */
    .data-table .hide-mobile {
        display: none;
    }
    /* Make tables scroll horizontally */
    .panel .data-table,
    .panel table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── TABS ── */
    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0;
        gap: 0;
    }
    .tab-btn {
        padding: 10px 12px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ── BUTTONS ── */
    .topbar-actions {
        display: flex;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .topbar-actions .btn,
    .topbar-actions .btn-secondary,
    .topbar-actions .btn-primary {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    .btn-block {
        width: 100%;
        text-align: center;
    }

    /* ── PANELS ── */
    .panel {
        padding: 16px;
        margin-bottom: 12px;
    }

    /* ── LEAD HEADER ── */
    .lead-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .lead-header-right {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .lead-meta {
        gap: 8px;
        font-size: 12px;
    }

    /* ── FORMS ── */
    .form-actions {
        flex-direction: column-reverse;
    }
    .form-panel {
        max-width: 100%;
    }

    /* ── INVOICE ── */
    .invoice-top {
        flex-direction: column;
    }
    .invoice-meta-right {
        text-align: left;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    .invoice-summary {
        width: 100%;
    }

    /* ── PIPELINE ── */
    .pipeline-board {
        flex-direction: column;
        overflow-x: visible;
    }
    .pipeline-col {
        min-width: 100%;
        max-width: 100%;
    }

    /* ── SETTINGS NAV ── */
    .settings-nav {
        grid-template-columns: 1fr;
    }

    /* ── STATS ── */
    .stat-card {
        padding: 14px 16px;
    }
    .stat-value {
        font-size: 26px;
    }

    /* ── MY EVENTS (Staff Portal) ── */
    .portal-event-actions {
        flex-direction: column;
        width: 100%;
    }
    .portal-event-actions .btn,
    .portal-event-actions form,
    .portal-event-actions a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {

    /* ── EXTRA SMALL PHONES ── */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cards {
        grid-template-columns: 1fr !important;
    }
    .topbar-title {
        font-size: 14px;
        max-width: 140px;
    }
    .content-area {
        padding: 12px;
    }
    .panel {
        padding: 12px;
        border-radius: 4px;
    }
    .tab-btn {
        padding: 8px 10px;
        font-size: 10px;
    }
    .btn-primary,
    .btn-secondary {
        padding: 10px 14px;
        font-size: 13px;
    }
    .lead-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .lead-header-info h2 {
        font-size: 18px;
    }

    /* ── AI ASSISTANT ── */
    #chat-window {
        height: 380px !important;
    }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #080808; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* ── GLOBAL LINK COLOR ── */
a { color: #ccc; }
a:hover { color: #b89361; }




