/* ═══════════════════════════════════════════════
   FDF CRM — French Door Factory
   Warm timber aesthetic, professional CRM
   ═══════════════════════════════════════════════ */

:root {
    --fdf-timber:      #6B3A2A;
    --fdf-timber-dark: #4A2518;
    --fdf-timber-light:#8B5E3C;
    --fdf-cream:       #FBF7F2;
    --fdf-warm-white:  #FEFCF9;
    --fdf-sand:        #F0E6D8;
    --fdf-gold:        #C8963E;
    --fdf-gold-light:  #E8C97A;
    --fdf-green:       #3A7D44;
    --fdf-green-light: #E8F5E9;
    --fdf-red:         #C0392B;
    --fdf-red-light:   #FDEDEC;
    --fdf-blue:        #2874A6;
    --fdf-blue-light:  #EBF5FB;
    --fdf-orange:      #D4731A;
    --fdf-orange-light:#FFF3E0;
    --fdf-grey-50:     #FAFAF8;
    --fdf-grey-100:    #F5F3EF;
    --fdf-grey-200:    #E8E4DD;
    --fdf-grey-300:    #D1CCC3;
    --fdf-grey-400:    #A9A49B;
    --fdf-grey-500:    #7A756D;
    --fdf-grey-600:    #5A5650;
    --fdf-grey-700:    #3D3A36;
    --fdf-text:        #2C2825;
    --fdf-text-light:  #6B6560;
    --sidebar-width:   240px;
    --header-height:   56px;
    --radius:          8px;
    --radius-sm:       4px;
    --radius-lg:       12px;
    --shadow-sm:       0 1px 3px rgba(107,58,42,0.06);
    --shadow-md:       0 4px 12px rgba(107,58,42,0.08);
    --shadow-lg:       0 8px 30px rgba(107,58,42,0.12);
    --transition:      0.2s ease;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--fdf-text);
    background: var(--fdf-cream);
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; }
a { color: var(--fdf-timber); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.text-right { text-align: right; }

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════ */
#fdf-login-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 40%, #2a2a2a 100%);
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

#fdf-login-screen::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-panel {
    position: relative;
    background: var(--fdf-warm-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 48px 40px;
    width: 100%; max-width: 420px;
    animation: slideUp 0.6s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo {
    width: 200px; height: auto; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
}
.login-logo img { width: 100%; height: auto; }
.login-brand h1 {
    font-size: 1.6rem; color: var(--fdf-timber-dark);
    letter-spacing: -0.02em;
}
.login-subtitle {
    font-size: 0.85rem; color: var(--fdf-grey-400);
    text-transform: uppercase; letter-spacing: 0.15em;
    margin-top: 4px;
}

#fdf-login-form .form-group { margin-bottom: 20px; }
#fdf-login-form label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--fdf-grey-500); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
#fdf-login-form label i { margin-right: 6px; }
#fdf-login-form input {
    width: 100%; padding: 12px 14px;
    border: 2px solid var(--fdf-grey-200);
    border-radius: var(--radius);
    background: var(--fdf-grey-50);
    font-size: 0.95rem; color: var(--fdf-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
#fdf-login-form input:focus {
    outline: none;
    border-color: var(--fdf-timber);
    box-shadow: 0 0 0 3px rgba(107,58,42,0.1);
    background: #fff;
}
#fdf-login-form input::placeholder { color: var(--fdf-grey-300); }

#fdf-login-btn {
    width: 100%; padding: 14px;
    background: #1a1a1a; color: #fff;
    border: none; border-radius: var(--radius);
    font-weight: 600; font-size: 1rem; cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
#fdf-login-btn:hover { background: #333; transform: translateY(-1px); }
#fdf-login-btn:active { transform: translateY(0); }

.form-error {
    background: var(--fdf-red-light); color: var(--fdf-red);
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 0.85rem; margin-bottom: 16px;
    border-left: 3px solid var(--fdf-red);
}

.login-footer {
    text-align: center; margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--fdf-grey-200);
    font-size: 0.75rem; color: var(--fdf-grey-400);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
#fdf-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: #1a1a1a;
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px; display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { height: 48px; width: auto; }
.sidebar-brand span { font-weight: 400; letter-spacing: 0.04em; color: #fff; font-size: 1.3rem; }
.sidebar-brand strong { font-weight: 700; }

#fdf-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; margin-bottom: 2px;
    color: rgba(255,255,255,0.6); font-size: 0.9rem; font-weight: 500;
    border-radius: var(--radius); cursor: pointer;
    transition: all var(--transition);
}
.nav-item i { width: 20px; text-align: center; font-size: 0.95rem; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active {
    color: #fff; background: rgba(255,255,255,0.12);
    box-shadow: none;
    border-left: 3px solid #fff;
}

.sidebar-user {
    padding: 14px; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
}
.user-avatar { color: rgba(255,255,255,0.5); font-size: 1.6rem; }
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; color: #fff; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: var(--fdf-gold-light); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
#fdf-logout-btn {
    background: none; border: none; color: rgba(255,255,255,0.4);
    cursor: pointer; font-size: 1rem; padding: 6px;
    transition: color var(--transition);
}
#fdf-logout-btn:hover { color: var(--fdf-red); }

/* ═══════════════════════════════════════════════
   MOBILE HEADER
   ═══════════════════════════════════════════════ */
#fdf-mobile-header {
    display: none; position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: #1a1a1a; z-index: 90;
    padding: 0 16px; align-items: center;
    justify-content: space-between;
}
.mobile-brand { color: #fff; font-size: 1.1rem; }
.mobile-brand strong { font-weight: 700; }
#fdf-menu-toggle, #fdf-mobile-logout {
    background: none; border: none; color: #fff;
    font-size: 1.2rem; cursor: pointer; padding: 8px;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
#fdf-main {
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
    min-height: 100vh;
}

.fdf-view { display: none; animation: fadeIn 0.3s ease; }
.fdf-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── View header ─────────────────────────────── */
.view-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.view-header h2 {
    font-size: 1.5rem; color: var(--fdf-timber-dark);
    display: flex; align-items: center; gap: 10px;
    flex: 1;
}
.view-header h2 i { color: var(--fdf-timber); font-size: 1.2rem; }
.view-date { font-size: 0.85rem; color: var(--fdf-grey-400); }
.view-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border: none; border-radius: var(--radius);
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition);
}
.btn-primary { background: var(--fdf-timber); color: #fff; }
.btn-primary:hover { background: var(--fdf-timber-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--fdf-grey-100); color: var(--fdf-grey-600); }
.btn-secondary:hover { background: var(--fdf-grey-200); }
.btn-danger { background: var(--fdf-red-light); color: var(--fdf-red); }
.btn-danger:hover { background: var(--fdf-red); color: #fff; }
.btn-back { background: none; color: var(--fdf-grey-500); padding: 9px 12px; }
.btn-back:hover { color: var(--fdf-timber); }

/* ── Search box ──────────────────────────────── */
.search-box {
    position: relative; display: flex; align-items: center;
}
.search-box i {
    position: absolute; left: 12px;
    color: var(--fdf-grey-400); font-size: 0.85rem; pointer-events: none;
}
.search-box input {
    padding: 9px 14px 9px 36px; border: 2px solid var(--fdf-grey-200);
    border-radius: var(--radius); background: #fff;
    width: 260px; font-size: 0.85rem;
    transition: border-color var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--fdf-timber); }

.filter-select {
    padding: 9px 14px; border: 2px solid var(--fdf-grey-200);
    border-radius: var(--radius); background: #fff;
    font-size: 0.85rem; color: var(--fdf-text);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════ */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 22px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--fdf-grey-200);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.stat-customers .stat-icon { background: var(--fdf-blue-light); color: var(--fdf-blue); }
.stat-jobs .stat-icon { background: var(--fdf-orange-light); color: var(--fdf-orange); }
.stat-revenue .stat-icon { background: var(--fdf-green-light); color: var(--fdf-green); }
.stat-outstanding .stat-icon { background: var(--fdf-red-light); color: var(--fdf-red); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--fdf-text); line-height: 1.2; }
.stat-label { display: block; font-size: 0.78rem; color: var(--fdf-grey-400); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ═══════════════════════════════════════════════
   DASHBOARD PANELS
   ═══════════════════════════════════════════════ */
.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}
.panel {
    background: #fff; border-radius: var(--radius-lg);
    padding: 22px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--fdf-grey-200);
}
.panel h3 {
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600;
    color: var(--fdf-grey-600); margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.panel h3 i { color: var(--fdf-timber); }

/* Chart */
.chart-container { height: 200px; position: relative; }
.chart-bar-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.8rem;
}
.chart-bar-label { width: 50px; text-align: right; color: var(--fdf-grey-500); font-size: 0.72rem; }
.chart-bar-track { flex: 1; height: 22px; background: var(--fdf-grey-100); border-radius: 4px; overflow: hidden; position: relative; }
.chart-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--fdf-timber), var(--fdf-timber-light));
    border-radius: 4px; transition: width 0.8s ease;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 6px;
    font-size: 0.68rem; color: #fff; font-weight: 600;
    min-width: 0;
}

/* Status breakdown */
.status-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--fdf-grey-100);
}
.status-row:last-child { border-bottom: none; }
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.status-DRAFT { background: var(--fdf-grey-100); color: var(--fdf-grey-500); }
.status-SUBMITTED { background: var(--fdf-orange-light); color: var(--fdf-orange); }
.status-AUTHORISED { background: var(--fdf-blue-light); color: var(--fdf-blue); }
.status-PAID { background: var(--fdf-green-light); color: var(--fdf-green); }
.status-VOIDED { background: var(--fdf-red-light); color: var(--fdf-red); }
.status-DELETED { background: var(--fdf-grey-100); color: var(--fdf-grey-400); }
.status-count { font-weight: 700; color: var(--fdf-text); }
.status-val { font-size: 0.82rem; color: var(--fdf-grey-500); margin-left: 8px; }

/* Top customers */
.top-row {
    display: flex; align-items: center; padding: 7px 0;
    border-bottom: 1px solid var(--fdf-grey-100); font-size: 0.85rem;
}
.top-row:last-child { border-bottom: none; }
.top-rank {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--fdf-sand); color: var(--fdf-timber);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; margin-right: 10px;
}
.top-name { flex: 1; font-weight: 500; cursor: pointer; }
.top-name:hover { color: var(--fdf-timber); }
.top-jobs { color: var(--fdf-grey-400); font-size: 0.78rem; margin-right: 12px; }
.top-rev { font-weight: 700; color: var(--fdf-green); }

/* Activity feed */
.activity-item {
    display: flex; gap: 10px; padding: 8px 0;
    border-bottom: 1px solid var(--fdf-grey-100); font-size: 0.82rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--fdf-sand); color: var(--fdf-timber);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; flex-shrink: 0;
}
.activity-text { flex: 1; color: var(--fdf-grey-600); line-height: 1.4; }
.activity-text strong { color: var(--fdf-text); }
.activity-time { font-size: 0.72rem; color: var(--fdf-grey-400); white-space: nowrap; }

/* ═══════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse;
    background: #fff; border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--fdf-grey-200);
}
.data-table thead { background: var(--fdf-sand); }
.data-table th {
    padding: 12px 14px; text-align: left;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--fdf-timber);
    border-bottom: 2px solid var(--fdf-grey-200);
    white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--fdf-timber-dark); }
.data-table th i { margin-left: 4px; font-size: 0.7rem; opacity: 0.5; }
.data-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--fdf-grey-100);
    font-size: 0.88rem; vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition); cursor: pointer; }
.data-table tbody tr:hover { background: var(--fdf-grey-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-name { font-weight: 600; color: var(--fdf-timber); }
.cell-secondary { font-size: 0.8rem; color: var(--fdf-grey-400); }
.cell-money { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Line items table */
.line-items-table { box-shadow: none; border: 1px solid var(--fdf-grey-200); }
.line-items-table tfoot td {
    padding: 10px 14px; font-weight: 600;
    border-top: 2px solid var(--fdf-grey-200);
}

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 20px;
}
.pagination button {
    padding: 7px 12px; border: 1px solid var(--fdf-grey-200);
    background: #fff; border-radius: var(--radius-sm);
    font-size: 0.82rem; cursor: pointer;
    transition: all var(--transition);
}
.pagination button:hover { background: var(--fdf-sand); }
.pagination button.active {
    background: var(--fdf-timber); color: #fff;
    border-color: var(--fdf-timber);
}
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination .page-info { font-size: 0.82rem; color: var(--fdf-grey-400); margin: 0 8px; }

/* ═══════════════════════════════════════════════
   DETAIL VIEW
   ═══════════════════════════════════════════════ */
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.detail-form {
    background: #fff; border-radius: var(--radius-lg);
    padding: 28px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--fdf-grey-200);
}
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; }
.form-group.full { flex: 0 0 100%; }
.form-group label {
    display: block; font-size: 0.75rem; font-weight: 600;
    color: var(--fdf-grey-500); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px;
    border: 2px solid var(--fdf-grey-200);
    border-radius: var(--radius); background: var(--fdf-grey-50);
    color: var(--fdf-text);
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--fdf-timber);
    background: #fff;
}

.section-title {
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600;
    color: var(--fdf-timber); margin: 24px 0 12px;
    display: flex; align-items: center; gap: 8px;
}

/* Detail sidebar cards */
.detail-sidebar {}
.sidebar-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--fdf-grey-200);
    margin-bottom: 16px;
}
.sidebar-card h4 {
    font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600;
    color: var(--fdf-grey-500); text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 12px;
}
.mini-stats { display: flex; gap: 16px; text-align: center; }
.mini-stats > div { flex: 1; }
.mini-val { display: block; font-size: 1.3rem; font-weight: 700; color: var(--fdf-timber); }
.mini-lbl { font-size: 0.72rem; color: var(--fdf-grey-400); text-transform: uppercase; }
.mini-list { max-height: 300px; overflow-y: auto; }
.mini-list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; border-bottom: 1px solid var(--fdf-grey-100);
    font-size: 0.82rem; cursor: pointer;
}
.mini-list-item:hover { color: var(--fdf-timber); }
.mini-list-item:last-child { border-bottom: none; }

/* Job meta grid */
.job-meta-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-bottom: 24px;
}
.meta-item { }
.meta-label { font-size: 0.72rem; font-weight: 600; color: var(--fdf-grey-400); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 0.95rem; color: var(--fdf-text); margin-top: 2px; }

/* Job customer info */
#job-customer-info .info-row {
    font-size: 0.85rem; margin-bottom: 6px;
}
#job-customer-info .info-row i { width: 16px; color: var(--fdf-grey-400); margin-right: 6px; }
#job-customer-info .info-name { font-weight: 600; font-size: 1rem; color: var(--fdf-timber); margin-bottom: 8px; cursor: pointer; }
#job-customer-info .info-name:hover { text-decoration: underline; }

/* Job totals card */
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem; }
.totals-row.total-final {
    font-weight: 700; font-size: 1.05rem; color: var(--fdf-timber);
    border-top: 2px solid var(--fdf-grey-200); padding-top: 10px; margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   IMPORT
   ═══════════════════════════════════════════════ */
.import-container {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.import-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 28px; text-align: center;
    box-shadow: var(--shadow-sm); border: 1px solid var(--fdf-grey-200);
}
.import-icon { font-size: 2rem; color: var(--fdf-timber); margin-bottom: 12px; }
.import-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.import-card p { font-size: 0.82rem; color: var(--fdf-grey-500); margin-bottom: 12px; }
.import-note { font-size: 0.78rem !important; color: var(--fdf-orange) !important; }

.import-drop {
    border: 2px dashed var(--fdf-grey-300); border-radius: var(--radius);
    padding: 28px 16px; cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.import-drop:hover { border-color: var(--fdf-timber); background: var(--fdf-grey-50); }
.import-drop.dragging { border-color: var(--fdf-gold); background: rgba(200,150,62,0.05); }
.import-drop i { font-size: 1.5rem; color: var(--fdf-grey-300); display: block; margin-bottom: 8px; }
.import-drop span { font-size: 0.82rem; color: var(--fdf-grey-400); }
.import-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import-drop.uploading { pointer-events: none; opacity: 0.6; }

.import-result {
    margin-top: 16px; padding: 14px; border-radius: var(--radius);
    font-size: 0.82rem; text-align: left;
}
.import-result.success { background: var(--fdf-green-light); color: var(--fdf-green); }
.import-result.error { background: var(--fdf-red-light); color: var(--fdf-red); }

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */
#fdf-toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
}
.fdf-toast {
    padding: 14px 20px; border-radius: var(--radius);
    background: var(--fdf-timber-dark); color: #fff;
    font-size: 0.85rem; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    animation: toastIn 0.3s ease;
    max-width: 380px;
}
.fdf-toast.success { background: var(--fdf-green); }
.fdf-toast.error { background: var(--fdf-red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ═══════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════ */
#fdf-loading {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(251,247,242,0.7); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.loading-spinner {
    font-size: 2rem; color: var(--fdf-timber);
}

/* Empty states */
.empty-state {
    text-align: center; padding: 48px 20px; color: var(--fdf-grey-400);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; color: var(--fdf-grey-300); }
.empty-state p { font-size: 0.9rem; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-panels { grid-template-columns: 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .import-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    #fdf-sidebar {
        transform: translateX(-100%);
        width: 260px; box-shadow: var(--shadow-lg);
    }
    #fdf-sidebar.open { transform: translateX(0); }
    #fdf-mobile-header { display: flex; }
    #fdf-main {
        margin-left: 0;
        padding: 72px 16px 20px;
    }
    .view-header { flex-direction: column; align-items: flex-start; }
    .view-actions { width: 100%; }
    .search-box input { width: 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.2rem; }
    .form-row { flex-direction: column; gap: 10px; }
    .job-meta-grid { grid-template-columns: 1fr; }
}

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

/* Sidebar overlay for mobile */
#fdf-sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 99;
}
#fdf-sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════════
   QUOTE BUILDER
   ═══════════════════════════════════════════════ */
.quote-builder-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.quote-builder-main {
    background: #fff; border-radius: var(--radius-lg); padding: 24px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--fdf-grey-200);
}
.quote-builder-sidebar {}
.qb-meta { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--fdf-grey-200); }
.qb-customer-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--fdf-grey-200); }
.qb-customer-section > label { font-size: 0.75rem; font-weight: 600; color: var(--fdf-grey-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; display: block; }

.customer-picker { position: relative; }
.customer-search-wrap { position: relative; }
.customer-search-wrap > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fdf-grey-400); font-size: 0.85rem; }
.customer-search-wrap > input { width: 100%; padding: 10px 14px 10px 36px; border: 2px solid var(--fdf-grey-200); border-radius: var(--radius); background: var(--fdf-grey-50); }
.customer-search-wrap > input:focus { outline: none; border-color: var(--fdf-timber); background: #fff; }
.customer-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: #fff; border: 2px solid var(--fdf-timber); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 240px; overflow-y: auto; box-shadow: var(--shadow-md);
}
.customer-result-item {
    padding: 10px 14px; cursor: pointer; font-size: 0.88rem;
    border-bottom: 1px solid var(--fdf-grey-100); display: flex; justify-content: space-between;
}
.customer-result-item:hover { background: var(--fdf-grey-50); }
.customer-result-item .cr-name { font-weight: 600; color: var(--fdf-timber); }
.customer-result-item .cr-email { font-size: 0.78rem; color: var(--fdf-grey-400); }
.customer-selected {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--fdf-sand); border-radius: var(--radius); border: 2px solid var(--fdf-grey-200);
}
.customer-selected #qb-customer-name-display { font-weight: 600; color: var(--fdf-timber); }
.btn-clear-customer { background: none; border: none; color: var(--fdf-grey-400); cursor: pointer; margin-left: auto; font-size: 0.9rem; }
.btn-clear-customer:hover { color: var(--fdf-red); }

.qb-items-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.qb-items-header h3 { margin: 0; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600; color: var(--fdf-grey-600); }
.qb-add-item { display: flex; gap: 8px; align-items: center; }
.material-search-wrap { position: relative; width: 320px; }
.material-search-wrap > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fdf-grey-400); font-size: 0.8rem; }
.material-search-wrap > input { width: 100%; padding: 8px 12px 8px 32px; border: 2px solid var(--fdf-grey-200); border-radius: var(--radius); font-size: 0.82rem; background: var(--fdf-grey-50); }
.material-search-wrap > input:focus { outline: none; border-color: var(--fdf-timber); background: #fff; }
.material-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: #fff; border: 2px solid var(--fdf-timber); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-md);
}
.material-result-item {
    padding: 8px 12px; cursor: pointer; font-size: 0.82rem;
    border-bottom: 1px solid var(--fdf-grey-100); display: flex; justify-content: space-between; align-items: center;
}
.material-result-item:hover { background: var(--fdf-grey-50); }
.mr-name { font-weight: 500; }
.mr-cat { font-size: 0.72rem; color: var(--fdf-grey-400); }
.mr-price { font-weight: 600; color: var(--fdf-green); white-space: nowrap; }

.qb-items-table { box-shadow: none; border: 1px solid var(--fdf-grey-200); }
.qb-items-table td { padding: 6px 8px; vertical-align: middle; }
.qb-items-table input { padding: 6px 8px; border: 1px solid var(--fdf-grey-200); border-radius: var(--radius-sm); font-size: 0.85rem; width: 100%; }
.qb-items-table input:focus { outline: none; border-color: var(--fdf-timber); }
.qb-items-table .item-desc { min-width: 200px; }
.qb-items-table .item-amount { font-weight: 600; text-align: right; color: var(--fdf-timber); }
.qb-item-remove { background: none; border: none; color: var(--fdf-grey-300); cursor: pointer; font-size: 0.85rem; }
.qb-item-remove:hover { color: var(--fdf-red); }

.qb-totals-card .totals-row { font-size: 0.95rem; }

/* Quote status badges */
.status-draft { background: var(--fdf-grey-100); color: var(--fdf-grey-500); }
.status-sent { background: var(--fdf-blue-light); color: var(--fdf-blue); }
.status-accepted { background: var(--fdf-green-light); color: var(--fdf-green); }
.status-declined { background: var(--fdf-red-light); color: var(--fdf-red); }
.status-expired { background: var(--fdf-orange-light); color: var(--fdf-orange); }
.status-invoiced { background: var(--fdf-green-light); color: var(--fdf-green); }

@media (max-width: 1024px) {
    .quote-builder-layout { grid-template-columns: 1fr; }
    .material-search-wrap { width: 100%; }
    .qb-add-item { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════
   MATERIALS / PRICING PAGE
   ═══════════════════════════════════════════════ */
.mat-categories-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mat-cat-card {
    background: #fff; border-radius: var(--radius-lg); padding: 28px 24px;
    border: 2px solid var(--fdf-grey-200); cursor: pointer; text-align: center;
    transition: all var(--transition); position: relative;
}
.mat-cat-card:hover { border-color: var(--fdf-timber); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mat-cat-icon { font-size: 2rem; color: var(--fdf-timber); margin-bottom: 12px; }
.mat-cat-card h3 { font-size: 1.1rem; color: var(--fdf-timber-dark); margin-bottom: 6px; }
.mat-cat-card p { font-size: 0.78rem; color: var(--fdf-grey-400); margin: 0; }
.mat-cat-count {
    background: var(--fdf-sand); color: var(--fdf-timber); font-size: 0.72rem;
    font-weight: 700; padding: 2px 8px; border-radius: 10px; display: inline-block;
}
/* v3.3.0 — markup badge on category cards */
.cat-markup-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    white-space: nowrap;
}
.cat-markup-on  { background: #fef3c7; color: #92400e; }
.cat-markup-off { background: var(--fdf-grey-100, #f3f4f6); color: var(--fdf-grey-500, #6b7280); }
.cat-edit-btn:hover { color: var(--fdf-timber) !important; }
.mat-cat-add-card:hover { border-color: var(--fdf-timber) !important; }
.mat-cat-add-card:hover h3 { color: var(--fdf-timber) !important; }
.mat-cat-add-card:hover .mat-cat-icon { color: var(--fdf-timber) !important; }

.mat-subcats-list {}
.mat-subcat-group { margin-bottom: 16px; }
.mat-subcat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--fdf-sand); border-radius: var(--radius);
    cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--fdf-timber-dark);
    transition: background var(--transition);
}
.mat-subcat-header:hover { background: var(--fdf-grey-200); }
.mat-subcat-header i { transition: transform 0.2s; }
.mat-subcat-header.open i { transform: rotate(90deg); }
.mat-subcat-header .subcat-count { font-size: 0.75rem; color: var(--fdf-grey-400); font-weight: 400; }
.mat-subcat-items { display: none; }
.mat-subcat-items.open { display: block; }

.mat-item-row {
    display: grid; grid-template-columns: 1fr 100px 80px 60px; gap: 8px;
    align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--fdf-grey-100);
    font-size: 0.85rem;
}
.mat-item-row:hover { background: var(--fdf-grey-50); }
.mat-item-name { font-weight: 500; }
.mat-item-price {
    text-align: right; font-weight: 600; color: var(--fdf-green);
}
.mat-item-price input {
    width: 90px; padding: 4px 6px; border: 1px solid transparent;
    border-radius: var(--radius-sm); text-align: right; font-weight: 600;
    color: var(--fdf-green); background: transparent; font-size: 0.85rem;
}
.mat-item-price input:focus { border-color: var(--fdf-timber); background: #fff; outline: none; }
.mat-item-unit { font-size: 0.75rem; color: var(--fdf-grey-400); }
.mat-item-actions { text-align: right; }
.mat-item-edit { background: none; border: none; color: var(--fdf-grey-300); cursor: pointer; }
.mat-item-edit:hover { color: var(--fdf-timber); }

/* Modal */
.fdf-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content {
    position: relative; background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--fdf-grey-200);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--fdf-timber-dark); }
.modal-close { background: none; border: none; color: var(--fdf-grey-400); cursor: pointer; font-size: 1.1rem; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 14px 24px; border-top: 1px solid var(--fdf-grey-200);
    display: flex; gap: 8px; justify-content: flex-end;
}

@media (max-width: 768px) {
    .mat-categories-grid { grid-template-columns: 1fr 1fr; }
    .mat-item-row { grid-template-columns: 1fr 80px 60px 40px; }
}
@media (max-width: 480px) {
    .mat-categories-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════
   QUOTE BUILDER — Category Cards + Materials Panel
   ═══════════════════════════════════════════════ */
.qb-cat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qb-cat-btn {
    padding: 14px 10px; text-align: center; border-radius: var(--radius);
    border: 2px solid var(--fdf-grey-200); cursor: pointer; font-size: 0.82rem;
    font-weight: 600; color: var(--fdf-timber); background: var(--fdf-grey-50);
    transition: all var(--transition);
}
.qb-cat-btn i { display: block; font-size: 1.3rem; margin-bottom: 6px; color: var(--fdf-timber-light); }
.qb-cat-btn:hover { border-color: var(--fdf-timber); background: var(--fdf-sand); transform: translateY(-1px); }
.qb-cat-btn.active { border-color: var(--fdf-timber); background: var(--fdf-timber); color: #fff; }
.qb-cat-btn.active i { color: var(--fdf-gold-light); }

.qb-materials-panel {
    margin-top: 20px; background: #fff; border-radius: var(--radius-lg);
    border: 2px solid var(--fdf-timber); box-shadow: var(--shadow-md);
    overflow: hidden;
}
.qb-mp-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--fdf-sand); border-bottom: 1px solid var(--fdf-grey-200);
}
.qb-mp-header h3 { margin: 0; font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600; color: var(--fdf-timber-dark); }
.qb-mp-items { max-height: 400px; overflow-y: auto; }
.qb-mp-subcat {
    padding: 8px 16px; background: var(--fdf-grey-50); font-weight: 600;
    font-size: 0.78rem; color: var(--fdf-timber); text-transform: uppercase;
    letter-spacing: 0.04em; border-bottom: 1px solid var(--fdf-grey-200);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.qb-mp-subcat:hover { background: var(--fdf-sand); }
.qb-mp-subcat-items { display: none; }
.qb-mp-subcat-items.open { display: block; }
.qb-mp-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 16px 7px 28px; border-bottom: 1px solid var(--fdf-grey-100);
    font-size: 0.82rem; cursor: pointer; transition: background var(--transition);
}
.qb-mp-item:hover { background: var(--fdf-green-light); }
.qb-mp-item-name { flex: 1; }
.qb-mp-item-price { font-weight: 600; color: var(--fdf-green); margin: 0 12px; white-space: nowrap; }
.qb-mp-item-add {
    background: var(--fdf-timber); color: #fff; border: none; border-radius: var(--radius-sm);
    padding: 3px 10px; font-size: 0.72rem; font-weight: 600; cursor: pointer;
    transition: background var(--transition);
}
.qb-mp-item-add:hover { background: var(--fdf-timber-dark); }

/* New customer inline form */
.qb-new-cust-form {
    padding: 14px; background: var(--fdf-blue-light); border-radius: var(--radius);
    border: 2px solid var(--fdf-blue); margin-top: 8px;
}
.qb-new-cust-form .form-group label { font-size: 0.7rem; }
.qb-new-cust-form input { padding: 7px 10px; font-size: 0.85rem; }

@media (max-width: 1024px) {
    .qb-cat-cards { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .qb-cat-cards { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════
   PIPELINE CARDS (v2.2)
   ═══════════════════════════════════════════════ */
.nav-badge {
    background: #dc2626; color: #fff; font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
    margin-left: auto;
}
.nav-badge:empty { display: none; }

.btn-success { background: #16a34a; color: #fff; }

.stat-card.stat-newjobs { border-left-color: #16a34a; }
.stat-card.stat-newjobs:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card.stat-quotes { border-left-color: #7c3aed; }

.pipeline-card {
    background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #e5e5e5; margin: 0 0 12px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.pipeline-card.pipe-new { border-left-color: #16a34a; }
.pipeline-card.pipe-deposit_sent { border-left-color: #ea580c; }
.pipeline-card.pipe-in_progress { border-left-color: #3b82f6; }
.pipeline-card.pipe-final_invoice { border-left-color: #7c3aed; }
.pipeline-card.pipe-completed { border-left-color: #22c55e; }
.pipeline-info { flex: 1; min-width: 200px; }
.pipeline-info h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.pipeline-info p { font-size: 13px; color: #888; margin: 0; }
.pipeline-meta { display: flex; gap: 16px; font-size: 13px; color: #888; align-items: center; }
.pipeline-meta strong { color: #333; font-weight: 600; }
.pipeline-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pipe-badge {
    display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 11px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.pipe-badge-new { background: #dcfce7; color: #166534; }
.pipe-badge-deposit_sent { background: #fff7ed; color: #9a3412; }
.pipe-badge-in_progress { background: #eff6ff; color: #1d4ed8; }
.pipe-badge-final_invoice { background: #faf5ff; color: #6b21a8; }
.pipe-badge-completed { background: #f0fdf4; color: #15803d; }

.pipeline-empty { text-align: center; color: #888; padding: 40px; background: #fff; border-radius: 8px; }

@media (max-width: 768px) {
    .pipeline-card { flex-direction: column; align-items: flex-start; }
    .pipeline-actions { width: 100%; }
    .pipeline-actions .btn { flex: 1; text-align: center; }
}

/* ── v2.3.0 additions ─────────────────────────── */
.status-OVERDUE { background: #fef2f2; color: #dc2626; font-weight: 600; }
.status-OVERDUE::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #dc2626; margin-right: 4px; animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.btn-icon-del {
    background: none; border: none; color: #ccc; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.btn-icon-del:hover { color: #dc2626; background: #fef2f2; }

.cell-actions { text-align: center; }

/* ── Financials expandable rows ───────────────── */
.fin-month-row:hover { background: var(--fdf-sand) !important; }
.fin-month-row td:first-child { user-select: none; }
.fin-invoice-row:hover { background: #f0ede8 !important; }
.fin-invoices-wrap table { border-radius: 6px; overflow: hidden; }
.fin-invoices-wrap table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: #6B3A2A; }

/* ═══════════════════════════════════════════════
   PHASE 3: Leads, My Jobs, Schedule
   ═══════════════════════════════════════════════ */

/* ── My Jobs ──────────────────────────────────── */
.myjobs-day { margin-bottom: 16px; }
.myjobs-day-header { font-size: 14px; font-weight: 600; color: var(--fdf-charcoal); padding: 8px 12px; background: var(--fdf-sand); border-radius: 8px 8px 0 0; margin: 0; }
.myjobs-day-header.myjobs-today { background: #6B3A2A; color: #fff; }
.myjob-card { background: #fff; border: 1px solid var(--fdf-grey-200); border-top: none; padding: 14px 16px; }
.myjob-card:last-child { border-radius: 0 0 8px 8px; }
.myjob-card.myjob-in-progress { border-left: 4px solid #ea580c; }
.myjob-card.myjob-completed { border-left: 4px solid #16a34a; opacity: 0.7; }
.myjob-card.myjob-scheduled { border-left: 4px solid #2563eb; }
.myjob-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.myjob-time { font-size: 13px; color: #6B3A2A; font-weight: 600; }
.myjob-ref { color: #666; font-size: 13px; margin: 2px 0 6px; }
.myjob-desc { font-size: 13px; color: #555; margin: 0 0 6px; padding: 5px 8px; background: #f8f6f4; border-radius: 4px; }
.myjob-addr { display: block; font-size: 13px; color: #2563eb; text-decoration: none; margin: 4px 0; }
.myjob-addr:hover { text-decoration: underline; }
.myjob-phone { display: inline-block; font-size: 13px; color: #16a34a; text-decoration: none; margin: 4px 8px 4px 0; }
.myjob-instructions { font-size: 12px; color: #ea580c; margin: 6px 0 2px; background: #fff7ed; padding: 6px 8px; border-radius: 4px; }
.myjob-notes { font-size: 12px; color: #888; margin: 4px 0 0; }
.myjob-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.myjob-actions .btn { font-size: 12px; }
.myjob-status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; margin: 4px 0 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.myjob-badge-scheduled { background: #f1f5f9; color: #64748b; }
.myjob-badge-in-progress { background: #dcfce7; color: #16a34a; }
.myjob-badge-completed { background: #e0e7ff; color: #4338ca; }
.myjob-staff-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: #fff; margin: 2px 0 4px; }

/* Month accordion */
.myjobs-month-accordion { margin-bottom: 4px; border-radius: 8px; overflow: hidden; border: 1px solid var(--fdf-border, #e5e0dc); }
.myjobs-month-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--fdf-sidebar, #2c2420); color: #fff; cursor: pointer; font-weight: 700; font-size: 14px; user-select: none; transition: background 0.15s; }
.myjobs-month-header:hover { background: #3d332e; }
.myjobs-chevron { font-size: 11px; margin-right: 8px; transition: transform 0.2s; }
.myjobs-month-header.open .myjobs-chevron { transform: rotate(90deg); }
.myjobs-month-count { font-size: 12px; font-weight: 400; opacity: 0.7; }
.myjobs-month-body { display: none; padding: 0; }
.myjobs-month-body.open { display: block; }
.myjobs-day-count { display: inline-flex; align-items: center; justify-content: center; background: var(--fdf-amber, #b8860b); color: #fff; font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }

/* ── Schedule / Calendar Grid ─────────────────── */
.schedule-grid { overflow-x: auto; }
.sched-header { display: grid; grid-template-columns: 140px repeat(7, 1fr); gap: 1px; background: var(--fdf-sand); border-radius: 8px 8px 0 0; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; color: #6B3A2A; }
.sched-header > div { padding: 10px 8px; text-align: center; }
.sched-header > div:first-child { text-align: left; }
.sched-row { display: grid; grid-template-columns: 140px repeat(7, 1fr); gap: 1px; border-bottom: 1px solid var(--fdf-grey-200); min-height: 70px; }
.sched-staff-col { padding: 8px; font-size: 13px; font-weight: 500; display: flex; align-items: flex-start; gap: 6px; background: #fff; }
.sched-staff-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.sched-day-col { padding: 4px; background: #fff; min-height: 60px; }
.sched-cell { cursor: default; }
.sched-today { background: #fdf8f3 !important; }
.sched-block { background: #f5f0eb; border-radius: 4px; padding: 4px 6px; margin-bottom: 3px; cursor: pointer; font-size: 11px; transition: background 0.15s; }
.sched-block:hover { background: #ece5dd; }
.sched-block.sched-active { background: #fff7ed; }
.sched-block.sched-done { background: #f0fdf4; opacity: 0.7; }
.sched-block-time { font-weight: 600; color: #6B3A2A; display: block; }
.sched-block-name { display: block; font-weight: 500; }
.sched-block-ref { display: block; color: #888; }

/* ── Staff Assignment Row ─────────────────────── */
.staff-assignment-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0ede8; font-size: 13px; }
.staff-assignment-row:last-child { border-bottom: none; }

/* ── Mobile tweaks ────────────────────────────── */
@media (max-width: 768px) {
    .myjob-card { padding: 12px; }
    .myjob-header { flex-direction: column; align-items: flex-start; gap: 2px; }
    .sched-header, .sched-row { grid-template-columns: 100px repeat(7, 1fr); }
    .sched-staff-col { font-size: 11px; }
    .sched-block { font-size: 10px; padding: 3px 4px; }
}

/* ── Lead Detail ──────────────────────────────── */
.panel { background: #fff; border: 1px solid var(--fdf-grey-200); border-radius: 8px; padding: 16px; }
.mini-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0ede8; font-size: 13px; }
.mini-list-item:last-child { border-bottom: none; }
#ld-notes-display { background: #faf9f7; padding: 12px; border-radius: 6px; font-size: 13px; line-height: 1.6; }

/* ── Next Up highlight ────────────────────────── */
.myjobs-day-header.myjobs-next { background: #6B3A2A; color: #fff; }

/* ── Joinery Configurator ─────────────────────── */
.jc-lbl { display: block; font-size: 10px; font-weight: 700; color: #999; margin-top: 7px; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.jc-inp { width: 100%; padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; box-sizing: border-box; color: #333; background: #fff; }
.jc-sel { width: 100%; padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; box-sizing: border-box; color: #333; background: #fff; appearance: auto; }
.jc-tbtn { padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 600; color: #444; }
.jc-tbtn:disabled { opacity: 0.3; cursor: default; }
.qb-joinery-btn { padding: 2px 6px; border: 1px solid #b8860b; border-radius: 4px; background: none; color: #b8860b; font-size: 10px; font-weight: 600; cursor: pointer; margin-left: 4px; }
.qb-joinery-btn.has-config { background: #b8860b; color: #fff; }
.qb-joinery-preview { margin-top: 4px; padding: 4px; background: #faf8f6; border-radius: 4px; border: 1px solid #eee; display: inline-block; }
