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

/* ── Design tokens ──
   TPE brand palette (see erp_assets_and_style_templates/.../RGMv2/reconciled/
   for provenance). Canonical --tk-* tokens are the source of truth; the old
   token names below are kept as aliases so the 22 pages that already
   reference var(--green) etc. keep working unchanged. This is a deliberate
   "foundation first" step — new code should use the --tk-* names directly;
   the old aliases go away once every page is swept individually. */
:root {
    --tk-blue:          #2a4f82;
    --tk-blue-dark:     #1d3a61;
    --tk-sidebar-dark:  #142944;  /* left nav (sidebar) + Client Detail's .profile-top header — darker than --tk-blue-dark, which the top nav still uses */
    --tk-blue-light:    #EEF1F5;
    --tk-yellow:        #ffc20e;
    --tk-yellow-light:  #fff3cc;
    --tk-yellow-dark:   #c49500;
    --tk-teal:          #0d9488;
    --tk-red:           #a5413c;
    --tk-red-light:     #F6ECEC;
    --tk-orange:        #d97706;
    --tk-orange-light:  #FBF1E6;
    --tk-green:         #2a8265;
    --tk-green-light:   #EAF2F0;
    --tk-emerald:       #49B275;  /* distinct from --tk-green (success) — for CTA/action buttons like "New Contact" so success and action-green don't share one meaning */
    --tk-emerald-light: #EDF7F1;
    --tk-emerald-dark:  #398B5B;
    --tk-info:          #185FA5;  /* distinct from --tk-blue (primary) — kept as its own semantic so "info" stays a real category, not a duplicate of primary */
    --tk-info-light:    #E6F1FB;
    --tk-bg:            #f5f4f0;
    --tk-card:          #ffffff;
    --tk-t1:            #1c1c1a;
    --tk-t2:            #5a5a54;
    --tk-t3:            #8a8a82;
    --tk-brd:           #EDEDED;

    /* PLACEHOLDER tokens — not supplied by the client, see reconciled/
       README.md. Flag for confirmation before ship. */
    --tk-purple:          #6b4c8f;
    --tk-purple-light:    #F1ECF5;
    --tk-burgundy:        #7a3b4a;
    --tk-burgundy-light:  #F3EAEC;

    /* ── legacy aliases (remove once the 22 pages are swept) ── */
    --green:        var(--tk-blue);
    --green-light:  var(--tk-green-light);
    --green-mid:    var(--tk-blue-dark);
    --green-accent: var(--tk-yellow);
    --slate:        var(--tk-blue-dark);
    --slate-light:  var(--tk-bg);
    --white:        var(--tk-card);
    --border:       var(--tk-brd);
    --text:         var(--tk-t1);
    --muted:        var(--tk-t2);
    --amber:        var(--tk-orange);
    --amber-light:  var(--tk-orange-light);
    --teal:         var(--tk-teal);
    --red:          var(--tk-red);
    --red-light:    var(--tk-red-light);

    font-family: 'Outfit', sans-serif;
}

body {
    background: #E8ECF0;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Typography ── */
.brand {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 18px;
    letter-spacing: .02em;
    text-decoration: none;
}
.brand span { color: var(--green-accent); }

/* ── CRM App Shell ── */
.crm-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Top nav ── */
.top-nav {
    height: 52px;
    background: var(--slate);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
    z-index: 10;
}
.nav-search-wrap { position: relative; }
.nav-search {
    width: 300px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 7px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: rgba(255,255,255,.4);
    font-size: 12px;
    cursor: text;
}
.nav-search i { font-size: 14px; }
.nav-search input {
    background: none; border: none; outline: none; flex: 1;
    color: #fff; font-size: 12px; font-family: 'Outfit', sans-serif;
}
.nav-search input::placeholder { color: rgba(255,255,255,.4); }
.search-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    width: 380px; max-width: calc(100vw - 32px);
    background: var(--white); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
    z-index: 300; overflow: hidden; display: none;
}
.search-menu.open { display: block; }
.search-menu-list { max-height: 420px; overflow-y: auto; }
.search-group-title {
    font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase;
    letter-spacing: .05em; padding: 10px 16px 4px;
}
.search-item {
    display: flex; gap: 10px; padding: 10px 16px; cursor: pointer; transition: background .1s;
    text-decoration: none; color: inherit;
}
.search-item:hover, .search-item.active { background: var(--slate-light); }
.search-item-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: var(--tk-blue-light); color: var(--green);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.search-item-body { flex: 1; min-width: 0; }
.search-item-title { font-size: 12px; font-weight: 600; color: var(--text); }
.search-item-subtitle { font-size: 11px; color: var(--muted); margin-top: 1px; }
.search-menu-empty, .search-menu-hint, .search-menu-loading {
    display: none; flex-direction: column; align-items: center; gap: 8px;
    padding: 32px 20px; color: var(--muted); text-align: center;
}
.search-menu-empty.show, .search-menu-hint.show, .search-menu-loading.show { display: flex; }
.search-menu-empty i, .search-menu-hint i, .search-menu-loading i { font-size: 24px; opacity: .35; }
.search-menu-loading i { opacity: .6; }
.search-menu-empty span, .search-menu-hint span, .search-menu-loading span { font-size: 12px; font-weight: 500; }
.search-viewall {
    display: none; align-items: center; justify-content: center; gap: 6px;
    padding: 11px; font-size: 12px; font-weight: 600; color: var(--green);
    text-decoration: none; border-top: 1px solid var(--border);
}
.search-viewall.show { display: flex; }
.search-viewall:hover { background: var(--slate-light); }
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-icon-btn {
    color: rgba(255,255,255,.55);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: .15s;
    display: flex;
    align-items: center;
}
.nav-icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── Body row (sidebar + content) ── */
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ── Sidebar ── */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--tk-sidebar-dark);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    cursor: pointer;
    transition: .15s;
    text-decoration: none;
    border-right: 3px solid transparent;
}
.sidebar-item:hover { background: rgba(255,255,255,.05); }
.sidebar-item.active {
    background: rgba(29,58,97,.2);
    border-right-color: var(--green-mid);
}
.sidebar-item i { font-size: 17px; color: rgba(255,255,255,.38); }
.sidebar-item.active i { color: var(--green-accent); }
.sidebar-item span { font-size: 12px; color: rgba(255,255,255,.38); font-weight: 500; }
.sidebar-item.active span { color: #fff; }
.sidebar-spacer { flex: 1; }
.sidebar-section-label {
    padding: 16px 18px 6px;
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,.28);
    text-transform: uppercase; letter-spacing: .07em;
}

/* ── Main content area ── */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.page-body {
    flex: 1;
    overflow-y: auto;
    background: var(--slate-light);
    padding: 28px 32px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-left: 8px;
}
.breadcrumb a { color: rgba(255,255,255,.45); text-decoration: none; }
.breadcrumb a:hover { color: rgba(255,255,255,.75); }
.breadcrumb .current { color: #fff; }
.breadcrumb i { font-size: 11px; }

/* ── Common components ── */
.badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}
.badge-active  { background: #D7EEE4; color: #1F6F4F; }
.badge-pending { background: var(--amber-light);  color: #854F0B; }
.badge-new     { background: var(--tk-info-light); color: var(--tk-info); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    transition: .15s;
    text-decoration: none;
}
.btn i { font-size: 15px; }
.btn-primary  { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-mid); }
/* "New Contact" CTA buttons — deliberately a different green from --tk-green (success), see --tk-emerald above. */
.btn-primary.btn-success-preview { background: var(--tk-emerald); }
.btn-primary.btn-success-preview:hover { background: var(--tk-emerald-dark); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--muted); background: var(--slate-light); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c73736; }
.btn-ghost    { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ── Soft (tinted) buttons — generalized from .activity-add-btn's treatment:
   light tinted background, colored text, subtle colored border. Used for
   secondary "add/log" actions (Client Detail's Log Activity / New Document),
   available in every semantic color so it's not just a one-off blue. ── */
.btn-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: .15s;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn-soft:hover { filter: brightness(.96); }
.btn-soft i { font-size: 14px; }
.btn-soft-primary { background: var(--tk-blue-light);   color: var(--tk-blue);   border-color: rgba(42,79,130,.18); }
.btn-soft-success { background: var(--tk-green-light);  color: var(--tk-green);  border-color: rgba(42,130,101,.18); }
.btn-soft-danger  { background: var(--tk-red-light);    color: var(--tk-red);    border-color: rgba(165,65,60,.18); }
.btn-soft-warning { background: var(--tk-orange-light); color: var(--tk-orange); border-color: rgba(217,119,6,.18); }
.btn-soft-info    { background: var(--tk-info-light);   color: var(--tk-info);   border-color: rgba(24,95,165,.18); }
.btn-soft-emerald { background: var(--tk-emerald-light); color: var(--tk-emerald-dark); border-color: rgba(73,178,117,.18); }

/* ── Card ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.card-body  { padding: 16px 18px; }

/* ── Form fields ── */
.form-group  { margin-bottom: 16px; }
.form-label  {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: .15s;
}
.form-control:focus {
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(29,58,97,.12);
}
.form-control::placeholder { color: var(--muted); opacity: .7; }
.form-control.is-invalid { border-color: var(--red); }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    background: var(--slate);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--white);
    border-radius: 14px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.login-logo {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--text);
    margin-bottom: 6px;
}
.login-logo span { color: var(--green); }
.login-tagline { font-size: 12px; color: var(--muted); margin-bottom: 28px; }
.login-heading { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 20px; }
.login-divider { height: 1px; background: var(--border); margin: 20px 0; }
.login-footer  { font-size: 11px; color: var(--muted); text-align: center; margin-top: 20px; }

/* Remember me / checkbox row */
.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.check-row input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; cursor: pointer; }

/* ── Additional badge variants ─────────────────────────────────────────── */
.badge-green  { background: #D7EEE4; color: #1F6F4F; }
.badge-muted  { background: var(--slate-light); color: var(--muted); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-amber  { background: var(--amber-light); color: #854F0B; }
.badge-blue   { background: var(--tk-info-light); color: var(--tk-info); }

/* ── Tab nav ────────────────────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    gap: 0;
}
.tab-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tab-count {
    font-size: 10px;
    background: var(--slate-light);
    color: var(--muted);
    border-radius: 10px;
    padding: 1px 6px;
    font-weight: 600;
}
.tab-btn.active .tab-count { background: var(--tk-blue-light); color: var(--green); }

/* ── Tag / scope chips ──────────────────────────────────────────────────── */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--tk-blue-light);
    color: var(--green);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
}
.tag-chip .remove {
    cursor: pointer;
    opacity: .6;
    font-size: 13px;
    line-height: 1;
    padding: 0 1px;
}
.tag-chip .remove:hover { opacity: 1; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── Pet chip ───────────────────────────────────────────────────────────── */
.pet-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--slate-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text);
}
.pet-chip .pet-icon { font-size: 16px; color: var(--muted); }
.pet-chip .pet-name { font-weight: 600; }
.pet-chip .pet-type { color: var(--muted); }
.pet-chip .remove {
    margin-left: 4px;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    opacity: .7;
}
.pet-chip .remove:hover { opacity: 1; color: var(--red); }
.pets-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Avatars (sized) ────────────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* ── Profile page header ────────────────────────────────────────────────── */
.profile-header {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}
.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 5px;
}
.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
}
.profile-meta-item i { font-size: 13px; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Alert / toast banner ───────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #D7EEE4; color: #1F6F4F; border: 1px solid #A9D4C9; }
.alert-danger  { background: var(--red-light);   color: var(--red);   border: 1px solid #FBCFCF; }
.alert-info    { background: var(--tk-info-light); color: var(--tk-info); border: 1px solid #AEC7E0; }
.alert-warning { background: var(--tk-orange-light); color: var(--tk-orange); border: 1px solid #EFCDA0; }
.alert i { font-size: 16px; flex-shrink: 0; }

/* ── Section divider ────────────────────────────────────────────────────── */
.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 10px;
}

/* ── Activity feed (timeline with circle icons) ─────────────────────────── */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 0;
    position: relative;
}
.activity-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 36px;
    bottom: -12px;
    width: 1.5px;
    background: var(--border);
    z-index: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 12px; color: var(--text); line-height: 1.45; }
.activity-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.activity-extra { display: none; }
.activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.activity-icon i { font-size: 12px; color: var(--muted); }
.activity-icon.green { border-color: var(--tk-green); background: var(--tk-green-light); }
.activity-icon.green i { color: var(--tk-green); }
.activity-icon.teal  { border-color: var(--teal); background: rgba(13,148,136,.1); }
.activity-icon.teal i  { color: var(--teal); }
.activity-icon.amber { border-color: var(--amber); background: var(--amber-light); }
.activity-icon.amber i { color: #854F0B; }
.activity-icon.blue  { border-color: var(--tk-info); background: var(--tk-info-light); }
.activity-icon.blue i  { color: var(--tk-info); }

/* ── New-Contact page components ────────────────────────────────────────── */
.nc-form-wrap { max-width: 760px; margin: 0 auto; }
.nc-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}
.nc-av {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--muted);
    flex-shrink: 0;
    border: 2px solid var(--white);
    box-shadow: 0 2px 10px rgba(28,28,26,.12);
    transition: background .2s, color .2s;
}
.nc-av.has-name { background: var(--green-mid); color: #fff; }
.nc-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
/* Form cards (used on New Contact and similar forms) */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
}
.form-card:last-child { margin-bottom: 0; }
.form-card-head {
    padding: 14px 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-card-head-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--slate-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color .2s, width .2s, height .2s;
}
.form-card-head-icon i { font-size: 13px; color: var(--muted); }
.form-card-title { font-size: 12px; font-weight: 600; color: var(--text); }
.form-card-body { padding: 14px 16px 16px; }

/* ── Section-complete checkmark (New Client page) — swaps the section's own
   header icon for a bold, solid-green check with a small pop animation ──── */
.form-card-head-icon .head-icon-complete { display: none; }
.form-card-head-icon.is-complete {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--tk-green);
}
.form-card-head-icon.is-complete .head-icon-default { display: none; }
.form-card-head-icon.is-complete .head-icon-complete {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}
.form-card-head-icon.is-complete .head-icon-complete.pop {
    animation: sectionCheckPop .4s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes sectionCheckPop {
    0%   { transform: scale(0); opacity: 0; }
    55%  { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); }
}
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addr-row { display: grid; grid-template-columns: 1fr 56px 90px; gap: 8px; }

/* ── Client Type segmented toggle (New Client page) ─────────────────────── */
.type-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    background: var(--slate-light);
    gap: 3px;
}
.type-toggle-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.type-toggle-option i { font-size: 15px; }
.type-toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-toggle-option.is-active { background: var(--white); color: var(--text); box-shadow: 0 1px 3px rgba(28,28,26,.12); }
.type-toggle-option:not(.is-active):hover { color: var(--text); }

/* ── Contacts repeater (New Client page) ─────────────────────────────────── */
.contact-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px 14px;
    margin-bottom: 12px;
    background: var(--slate-light);
}
.contact-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.contact-card-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.contact-remove {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.contact-remove:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }
.contact-remove i { font-size: 12px; }
.contact-flags { display: flex; gap: 20px; margin-top: 2px; }
.contact-flags .check-row { font-size: 12px; }

/* ── Address autocomplete + map preview (New Client page — visual only) ──── */
.addr-autocomplete { position: relative; }
.addr-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--muted);
    pointer-events: none;
}
.addr-input { padding-left: 34px; }
.addr-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(28,28,26,.14);
    z-index: 20;
    overflow: hidden;
}
.addr-suggestions.is-open { display: block; }
.addr-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
}
.addr-suggestion:hover { background: var(--slate-light); }
.addr-suggestion i { font-size: 13px; color: var(--muted); }

.map-preview {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--slate-light);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    overflow: hidden;
    text-align: center;
}
.map-preview-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(28,28,26,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28,28,26,.05) 1px, transparent 1px);
    background-size: 28px 28px;
}
.map-pin {
    position: relative;
    color: var(--tk-red);
    font-size: 26px;
    filter: drop-shadow(0 2px 3px rgba(28,28,26,.2));
    transition: transform .15s;
}
.map-preview.has-address .map-pin { transform: translateY(-3px); }
.map-preview-label { position: relative; font-size: 12px; color: var(--muted); max-width: 320px; }
.map-preview.has-address .map-preview-label { color: var(--text); font-weight: 500; }
.map-preview-actions { position: relative; display: flex; gap: 8px; margin-top: 4px; }

/* ── Client Profile dark header ─────────────────────────────────────────── */
.profile-top {
    background: var(--tk-sidebar-dark);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.profile-top-av {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.profile-top-name { font-size: 17px; font-weight: 600; color: #fff; }
.profile-top-sub  { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 3px; }

/* ── Profile tabs (text-only, 12px) ─────────────────────────────────────── */
.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.p-tab {
    font-size: 12px;
    font-weight: 500;
    padding: 9px 16px;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.p-tab:hover { color: var(--text); }
.p-tab.act { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.p-tab-count {
    font-size: 10px;
    background: var(--slate-light);
    color: var(--muted);
    border-radius: 10px;
    padding: 1px 6px;
    font-weight: 600;
}
.p-tab.act .p-tab-count { background: var(--tk-blue-light); color: var(--green); }

/* ── Overview info grid (compact read tiles) ────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.info-field {
    background: var(--white);
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
}
.info-field .lbl {
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.info-field .val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.info-field .val-empty { color: var(--muted); font-style: italic; font-weight: 400; }

/* ── Scope card (inline add/remove) ─────────────────────────────────────── */
.scope-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.scope-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.scope-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--tk-blue-light);
    color: var(--green);
    border: 1px solid rgba(42,79,130,.18);
    border-radius: 14px;
    padding: 4px 8px 4px 12px;
    font-size: 12px;
    font-weight: 500;
}
.scope-tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--green);
    font-size: 12px;
    line-height: 1;
    padding: 0;
    opacity: .55;
    transition: opacity .12s;
    display: flex;
    align-items: center;
}
.scope-tag-remove:hover { opacity: 1; }

/* ── Activity tab: header, log panel, show more ─────────────────────────── */
.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.activity-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    color: var(--green);
    background: var(--tk-blue-light);
    border: 1px solid rgba(42,79,130,.18);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}
.activity-add-btn:hover { background: #DCE6F0; }
.activity-add-btn i { font-size: 13px; }

/* ── Contacts section (Client Detail → Overview) ─────────────────────────── */
.contacts-list { display: flex; flex-direction: column; gap: 8px; }
.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
.contact-row-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--slate-light);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.contact-row-info { flex: 1; min-width: 0; }
.contact-row-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact-row-name { font-size: 13px; font-weight: 600; color: var(--text); }
.contact-row-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contact-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.contact-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.contact-icon-btn:hover { background: var(--slate-light); color: var(--text); }
.contact-icon-btn.danger:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }
.contact-icon-btn i { font-size: 12px; }

/* ── Primary-contact → client info sync confirm (Contact Person drawer) ─── */
.sync-confirm {
    margin-top: 16px;
    background: var(--tk-info-light);
    border: 1px solid rgba(24,95,165,.18);
    border-radius: 8px;
    padding: 12px 14px;
}
.sync-confirm-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}
.sync-confirm-head i { color: var(--tk-info); font-size: 14px; }
.sync-confirm-row { margin-bottom: 10px; }
.sync-confirm-row:last-of-type { margin-bottom: 0; }
.sync-confirm-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
}
.sync-confirm-values {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
}
.sync-confirm-old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.sync-confirm-new { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.sync-confirm-values i { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.sync-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.log-activity-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.log-type-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.log-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    color: var(--muted);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: .15s;
}
.log-type-btn:hover { border-color: var(--green-mid); color: var(--green); }
.log-type-btn.active { border-color: var(--green-mid); color: var(--green); background: var(--tk-blue-light); font-weight: 600; }
.log-type-btn i { font-size: 13px; }

.log-activity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.activity-show-more-wrap {
    padding: 10px 0 2px;
    text-align: center;
}
.activity-show-more-wrap button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    padding: 5px 12px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.activity-show-more-wrap button:hover { color: var(--green); background: var(--tk-blue-light); }
.activity-show-more-wrap button i { font-size: 12px; }

/* ── Overview two-column layout (activity + photos) ─────────────────────── */
.overview-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* ── Photo grid placeholders ─────────────────────────────────────────────── */
/* ── Activity item dots menu ─────────────────────────────────────────────── */
.activity-menu-wrap {
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
    padding-top: 2px;
    opacity: 0;
    transition: opacity .15s;
    margin-left: auto;
}
.activity-item:hover .activity-menu-wrap { opacity: 1; }
.activity-dots-btn {
    width: 24px; height: 24px;
    border-radius: 5px;
    background: none; border: none;
    cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1;
    transition: background .12s, color .12s;
}
.activity-dots-btn:hover { background: var(--slate-light); color: var(--text); }
.activity-dropdown {
    position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.1);
    min-width: 120px; z-index: 50; display: none; overflow: hidden;
}
.activity-dropdown.open { display: block; }
.activity-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; font-size: 13px; font-weight: 500;
    font-family: 'Outfit', sans-serif; color: var(--text);
    background: none; border: none; cursor: pointer;
    width: 100%; text-align: left; transition: background .1s;
}
.activity-dropdown-item:hover { background: var(--slate-light); }
.activity-dropdown-item.danger { color: var(--red); }
.activity-dropdown-item.danger:hover { background: var(--red-light); }
.activity-dropdown-item i { font-size: 14px; }

/* Validation summary */
.validation-summary {
    background: var(--red-light);
    border: 1px solid #FBCFCF;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--red);
    margin-bottom: 16px;
}

/* ── Compact pet chips — info-grid tile (matches 02-client-profile.html exactly) ── */
.scope-tag-sm { display:inline-flex; align-items:center; gap:3px; background:var(--tk-blue-light); color:var(--green); border:1px solid rgba(42,79,130,.18); border-radius:10px; padding:2px 5px 2px 8px; font-size:10px; font-weight:500; }
.scope-tag-remove-sm { background:none; border:none; cursor:pointer; color:var(--green); font-size:10px; line-height:1; padding:0; opacity:.55; transition:.12s; display:flex; align-items:center; }
.scope-tag-remove-sm:hover { opacity:1; }
.scope-tag-add-sm { display:inline-flex; align-items:center; gap:3px; background:transparent; color:var(--muted); border:1.5px dashed var(--border); border-radius:10px; padding:2px 7px; font-size:10px; font-weight:500; cursor:pointer; transition:.15s; }
.scope-tag-add-sm:hover { border-color:var(--green-mid); color:var(--green); }
.pet-input-row { display:none; align-items:center; gap:4px; flex-wrap:wrap; width:100%; margin-top:2px; }
.scope-input-sm { background:var(--white); border:1.5px solid var(--green-mid); border-radius:10px; padding:2px 8px; font-size:10px; font-weight:500; color:var(--text); outline:none; width:72px; font-family:'Outfit',sans-serif; }
.pet-type-select-sm { background:var(--white); border:1.5px solid var(--green-mid); border-radius:6px; padding:2px 5px; font-size:10px; font-weight:500; color:var(--text); outline:none; font-family:'Outfit',sans-serif; cursor:pointer; }
.pet-confirm-btn-sm { width:20px; height:20px; border-radius:50%; background:var(--green); border:none; cursor:pointer; color:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:.15s; }
.pet-confirm-btn-sm:hover { background:var(--green-mid); }
.pet-cancel-btn-sm { width:20px; height:20px; border-radius:50%; background:transparent; border:1px solid var(--border); cursor:pointer; color:var(--muted); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:.15s; }
.pet-cancel-btn-sm:hover { border-color:var(--red); color:var(--red); }

/* ── AJAX chip animations ── */
@keyframes chipEnter {
    from { opacity: 0; transform: scale(.75); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes chipExit {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.7); }
}
.chip-enter { animation: chipEnter .18s cubic-bezier(.34,1.56,.64,1) both; }
.chip-exit  { animation: chipExit  .15s ease both; pointer-events: none; }

/* ── Shared spin animation (loading spinners) ── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.validation-summary ul { margin: 0; padding-left: 16px; }

/* ── Edit Drawer ─────────────────────────────────────────────────────────── */
.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.28);
    z-index: 200; opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: all; }

.edit-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 94vw;
    background: var(--white); z-index: 201;
    box-shadow: -4px 0 32px rgba(0,0,0,.13);
    transform: translateX(110%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column; overflow: hidden;
}
.edit-drawer.open { transform: translateX(0); }

.drawer-head {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.drawer-close {
    width: 28px; height: 28px; border-radius: 6px;
    background: transparent; border: 1px solid var(--border);
    cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: .12s;
}
.drawer-close:hover { border-color: var(--red); color: var(--red); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot {
    padding: 14px 20px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
    flex-shrink: 0;
}

/* ── Inline field editing ────────────────────────────────────────────────── */
.ie-field { position: relative; }
.ie-val {
    cursor: pointer; border-radius: 4px;
    padding: 1px 20px 1px 4px; margin: -1px 0 -1px -4px;
    transition: background .12s; display: inline-block; max-width: 100%;
}
.ie-val:hover { background: var(--slate-light); }
.ie-pencil {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    opacity: 0; transition: opacity .12s; pointer-events: none;
    color: var(--muted); font-size: 9px;
}
.ie-field:hover .ie-pencil { opacity: .6; }
.ie-edit-row { display: none; align-items: center; gap: 4px; margin-top: 2px; }
.ie-edit-row.active { display: flex; }
.ie-input {
    background: var(--white); border: 1.5px solid var(--green-mid);
    border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 500;
    color: var(--text); outline: none; font-family: 'Outfit', sans-serif;
    flex: 1; min-width: 0;
}
.ie-input:focus { border-color: var(--green); }
.ie-input.err   { border-color: var(--red); }
.ie-select {
    background: var(--white); border: 1.5px solid var(--green-mid);
    border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 500;
    color: var(--text); outline: none; font-family: 'Outfit', sans-serif;
    cursor: pointer; flex: 1;
}
.ie-ok {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--green); border: none; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: .15s;
}
.ie-ok:hover { background: var(--green-mid); }
.ie-cancel {
    width: 26px; height: 26px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border);
    cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: .15s;
}
.ie-cancel:hover { border-color: var(--red); color: var(--red); }
.ie-err { font-size: 11px; color: var(--red); margin-top: 3px; display: none; }
.ie-err.show { display: block; }

/* ── Notification Bell ───────────────────────────────────────────────────── */
.nav-notif-wrap { position: relative; }
.notif-badge {
    position: absolute; top: -2px; right: -4px;
    min-width: 15px; height: 15px; padding: 0 3px;
    background: var(--red, #E24B4A); color: #fff;
    border-radius: 8px; font-size: 9px; font-weight: 700;
    align-items: center; justify-content: center;
    line-height: 1; box-shadow: 0 0 0 2px var(--slate);
}
.notif-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; max-width: calc(100vw - 32px);
    background: var(--white); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
    z-index: 300; overflow: hidden; display: none;
}
.notif-menu.open { display: block; }
.notif-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600; color: var(--text);
    text-transform: uppercase; letter-spacing: .04em;
}
.notif-mark-all {
    font-size: 11px; font-weight: 500; color: var(--green);
    background: none; border: none; cursor: pointer; padding: 0;
    text-transform: none; letter-spacing: normal; font-family: 'Outfit', sans-serif;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-menu-list { max-height: 360px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--slate-light); }
.notif-item.unread { background: var(--tk-blue-light); }
.notif-item.unread:hover { background: #DCE6F0; }
.notif-item-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--slate-light); color: var(--muted);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notif-item.unread .notif-item-icon { background: var(--tk-blue-light); color: var(--green); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12px; font-weight: 600; color: var(--text); }
.notif-item-msg { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-item-time { font-size: 10px; color: var(--muted); margin-top: 4px; }
.notif-menu-empty {
    display: none; flex-direction: column; align-items: center; gap: 8px;
    padding: 36px 20px; color: var(--muted); text-align: center;
}
.notif-menu-empty i { font-size: 26px; opacity: .35; }
.notif-menu-empty span { font-size: 12px; font-weight: 500; }

/* ── Nav Avatar Menu ─────────────────────────────────────────────────────── */
.nav-avatar-wrap { position: relative; }
.avatar-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--white); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
    min-width: 180px; z-index: 300; overflow: hidden; display: none;
}
.avatar-menu.open { display: block; }
.avatar-menu-name {
    padding: 12px 16px 10px; font-size: 12px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.avatar-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 14px; font-weight: 500;
    color: var(--text); text-decoration: none;
    background: none; border: none; cursor: pointer;
    width: 100%; text-align: left; font-family: 'Outfit', sans-serif;
    transition: background .1s;
}
.avatar-menu-item:hover { background: var(--slate-light); }
.avatar-menu-item i { font-size: 15px; color: var(--muted); }

/* ── Bottom Tab Bar ──────────────────────────────────────────────────────── */
.bottom-tabs {
    display: none; /* mobile only — enabled via media query */
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 56px; background: var(--white);
    border-top: 1px solid var(--border); z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none;
    font-size: 10px; font-weight: 500; font-family: 'Outfit', sans-serif;
    transition: color .12s; background: none; border: none;
    cursor: pointer; padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
}
.bottom-tab i { font-size: 22px; line-height: 1; }
.bottom-tab.active { color: var(--green); }
.bottom-tab:active { opacity: .7; }

/* ── More Bottom Sheet ───────────────────────────────────────────────────── */
.more-sheet-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.3); z-index: 150;
}
.more-sheet-backdrop.open { display: block; }
.more-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--white); border-radius: 18px 18px 0 0;
    z-index: 151; padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.more-sheet.open { transform: translateY(0); }
.more-sheet-handle {
    width: 36px; height: 4px; background: var(--border);
    border-radius: 2px; margin: 12px auto 8px;
}
.more-sheet-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px; color: var(--text); text-decoration: none;
    font-size: 15px; font-weight: 500; font-family: 'Outfit', sans-serif;
    transition: background .1s; background: none; border: none;
    cursor: pointer; width: 100%; text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.more-sheet-item:active { background: var(--slate-light); }
.more-sheet-item.active { color: var(--green); }
.more-sheet-item i { font-size: 20px; width: 24px; text-align: center; color: var(--muted); }
.more-sheet-item.active i { color: var(--green); }
.more-sheet-section-label {
    padding: 10px 24px 4px;
    font-size: 10px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
    border-top: 1px solid var(--border); margin-top: 4px;
}

/* ── Client list ─────────────────────────────────────────────────────────── */
.client-row-sub {
    display: none; /* shown only on mobile */
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* ── Shared rich-text editor component (.rte-toolbar/.rte-btn/.rte-editor) — driven by
   wwwroot/js/rich-text-editor.js. Originally built for the Quote Detail page's Scope of
   Work editor; moved here so Settings → Scope of Work Templates can reuse the exact same
   toolbar/editor instead of duplicating the CSS per page. ── */
.rte-toolbar { display: flex; align-items: center; gap: 3px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.rte-btn {
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent;
    background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 14px; transition: .12s;
}
.rte-btn:hover { background: var(--slate-light); color: var(--text); }
.rte-btn.active { background: var(--green-light); color: var(--green); border-color: rgba(59,109,17,.18); }
.rte-divider { width: 1px; align-self: stretch; background: var(--border); margin: 2px 5px; }
.rte-editor {
    min-height: 90px; max-height: 320px; overflow-y: auto; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 7px; font-size: 13px; color: var(--text);
    line-height: 1.55; outline: none; transition: border-color .15s, box-shadow .15s;
    background: var(--white);
}
.rte-editor:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(99,153,34,.12); }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .8; }
.rte-editor ul, .rte-editor ol { padding-left: 20px; margin: 4px 0; }
.rte-editor p { margin: 0 0 8px; }
.rte-editor p:last-child { margin-bottom: 0; }
.rte-editor h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 4px 0 8px; }
.rte-editor h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 4px 0 6px; }

/* ── Shared @mention autocomplete (.nm-*) — driven by wwwroot/js/note-mentions.js. Used by
   both Clients/Detail.cshtml and Quotes/Detail.cshtml's Notes drawers; identical behavior on
   both, so the CSS lives here rather than duplicated per page (same call as .rte-* above). ── */
.note-mention {
    color: var(--tk-blue); background: var(--tk-blue-light); border-radius: 4px;
    padding: 0 3px; font-weight: 600; cursor: default;
}
.nm-dropdown {
    position: absolute; z-index: 500; min-width: 180px; max-width: 260px; max-height: 220px;
    overflow-y: auto; background: var(--white); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px;
}
.nm-option {
    padding: 7px 10px; font-size: 12.5px; font-weight: 500; color: var(--text);
    border-radius: 6px; cursor: pointer;
}
.nm-option.hl, .nm-option:hover { background: var(--slate-light); }

/* ── Mobile (≤ 768px) ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* ── Shell ───────────────────────────────────────────────────────────── */
    .sidebar     { display: none !important; }
    .bottom-tabs { display: flex; }
    .breadcrumb  { display: none; }
    .nav-search-wrap { display: none; }

    .page-body {
        padding: 16px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Client detail: profile top ──────────────────────────────────────── */
    .profile-top      { padding: 10px 16px; }
    .profile-top-name { font-size: 16px; }

    /* ── Client detail: tab bar — horizontal scroll ──────────────────────── */
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .profile-tabs::-webkit-scrollbar { display: none; }
    .p-tab { flex-shrink: 0; }

    /* ── Client detail: info grid — 2 columns ────────────────────────────── */
    .info-grid { grid-template-columns: 1fr 1fr; }

    /* ── Client detail: overview two-col — stack with gap ───────────────── */
    .overview-two-col { grid-template-columns: 1fr; gap: 20px; }

    /* ── Client detail: edit drawer → bottom sheet ───────────────────────── */
    .edit-drawer {
        width: 100%;
        max-width: 100%;
        top: auto;
        height: 88vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(110%);
    }
    .edit-drawer.open { transform: translateY(0); }

    /* ── New Contact form — single column ────────────────────────────────── */
    .nc-cols  { grid-template-columns: 1fr; }
    .name-row { grid-template-columns: 1fr 1fr; } /* first/last still side-by-side */

    /* ── Client list — condense to avatar · name+sub · status ───────────── */
    .client-table th:nth-child(n+3):nth-child(-n+7),
    .client-table td:nth-child(n+3):nth-child(-n+7) { display: none; }
    .client-row-sub { display: block; }
    .client-table td:first-child { padding-left: 12px; }
    .client-table td:last-child  { padding-right: 12px; }
    .client-table tr { -webkit-tap-highlight-color: transparent; }
}
