/* ── Variables — Light Theme ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --card-shadow: 0 2px 8px rgba(16,24,40,0.08);
  --surface2: #f3f4f8;
  --border: #d0d5e8;
  --border-light: #f0f1f7;
  --accent: #3b6ef5;
  --accent-light: #eef2fe;
  --accent-dark: #2a57d8;
  --green: #12b76a;
  --green-light: #ecfdf5;
  --red: #f04438;
  --red-light: #fef3f2;
  --yellow: #f79009;
  --yellow-light: #fffaeb;
  --orange: #ef6820;
  --text: #101828;
  --text-secondary: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow: 0 1px 3px rgba(16,24,40,0.1), 0 1px 2px rgba(16,24,40,0.06);
  --shadow-md: 0 4px 8px -2px rgba(16,24,40,0.1), 0 2px 4px -2px rgba(16,24,40,0.06);
  --shadow-lg: 0 12px 16px -4px rgba(16,24,40,0.08), 0 4px 6px -2px rgba(16,24,40,0.03);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --font-head: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --nav-h: 60px;
  --sidebar-w: 248px;
}

/* ── Reset ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Typography ─────────────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

/* ── Layout ─────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; overflow-y: auto; transition: transform .3s; }
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; background: var(--bg); }
.page-header { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--surface); }
.page-body { padding: 1.75rem; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar-logo { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border-light); }
.sidebar-logo .app-name { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; color: var(--text); line-height: 1.3; letter-spacing: -0.3px; }
.sidebar-logo .app-name span { color: var(--accent); }
.sidebar-logo .app-role { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-light); margin-top: 0.2rem; font-weight: 500; }
.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem; }
.nav-section { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-light); padding: 0.5rem 0.75rem; margin-top: 0.5rem; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; color: var(--muted); font-size: 0.875rem; cursor: pointer; transition: all .15s; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; margin-bottom: 1px; }
.nav-item:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-item.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; opacity: 0.8; }
.sidebar-bottom { padding: 0.75rem; border-top: 1px solid var(--border-light); }
.sidebar-user { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.6rem; padding: 0.5rem 0.5rem; }
.sidebar-user strong { display: block; color: var(--text); font-size: 0.875rem; font-weight: 600; }

/* ── Top bar (mobile) ───────────────────────────────────────────── */
.topbar { display: none; align-items: center; justify-content: space-between; padding: 0 1rem; height: var(--nav-h); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 99; box-shadow: var(--shadow-sm); }
.topbar-logo { font-family: var(--font-head); font-weight: 800; font-size: 1rem; color: var(--text); letter-spacing: -0.3px; }
.topbar-logo span { color: var(--accent); }
.hamburger { background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; padding: 0.3rem; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.8rem; font-family: var(--font-body); cursor: pointer; border: 1px solid transparent; transition: all .15s; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(59,110,245,0.2); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface2); border-color: var(--border); }
.btn-danger { background: var(--red-light); color: var(--red); border-color: #fecdca; }
.btn-danger:hover:not(:disabled) { background: #fee4e2; }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover:not(:disabled) { background: #0fa55f; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-lg { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
.btn-icon { padding: 0.4rem; border-radius: var(--radius-sm); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.4rem; }
.form-control { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.55rem 0.85rem; color: var(--text); font-family: var(--font-body); font-size: 0.875rem; outline: none; transition: all .15s; box-shadow: var(--shadow-sm); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,110,245,0.1); }
.form-control::placeholder { color: var(--muted-light); }
select.form-control option { background: var(--surface); color: var(--text); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.form-error { font-size: 0.75rem; color: var(--red); margin-top: 0.3rem; }

/* File upload */
.file-upload { border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; cursor: pointer; transition: all .15s; background: var(--surface2); }
.file-upload:hover { border-color: var(--accent); background: var(--accent-light); }
.file-upload input { display: none; }
.file-upload .upload-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.file-upload p { color: var(--muted); font-size: 0.82rem; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-title { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; color: var(--text); }
.card-body { padding: 1.25rem; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); }
.stat-card .stat-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-blue .stat-value { color: var(--accent); }
.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }
.stat-yellow .stat-value { color: var(--yellow); }
.stat-muted .stat-value { color: var(--muted); }

/* Territory cards */
.territory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.territory-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .2s; box-shadow: var(--shadow-sm); }
.territory-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.territory-card .tc-map { height: 140px; background: var(--surface2); overflow: hidden; }
.territory-card .tc-map img { width: 100%; height: 100%; object-fit: cover; }
.territory-card .tc-map .no-map { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted-light); font-size: 2rem; }
.territory-card .tc-body { padding: 0.9rem 1.1rem; }
.territory-card .tc-number { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--text); }
.territory-card .tc-streets { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.territory-card .tc-footer { padding: 0.65rem 1.1rem; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-toolbar { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
td { padding: 0.65rem 1rem; font-size: 0.85rem; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }
.table-responsive { overflow-x: auto; }

/* Editable cell */
.editable-cell { cursor: pointer; border-radius: 4px; padding: 0.2rem 0.4rem; transition: background .12s; }
.editable-cell:hover { background: var(--surface2); }
.cell-input { background: var(--surface); border: 1px solid var(--accent); border-radius: 4px; padding: 0.2rem 0.4rem; color: var(--text); font-size: 0.85rem; width: 100%; outline: none; box-shadow: 0 0 0 2px rgba(59,110,245,0.1); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.55rem; border-radius: 20px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-orange { background: #fff4ed; color: var(--orange); }
.badge-gray { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* ── Modals ─────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,0.4); z-index: 999; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--text); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem 1.25rem; display: flex; justify-content: flex-end; gap: 0.6rem; border-top: 1px solid var(--border-light); }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0.2rem; line-height: 1; border-radius: 4px; }
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; gap: 0; }
.tab { padding: 0.65rem 1.1rem; font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Search bar ─────────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted-light); pointer-events: none; font-size: 0.85rem; }
.search-wrap .form-control { padding-left: 2.1rem; }

/* ── Misc ───────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: 1.25rem 0; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.875rem; }

/* ── Toast notifications ────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; padding: 0.8rem 1.2rem; border-radius: var(--radius); font-size: 0.85rem; max-width: 320px; z-index: 9999; opacity: 0; transform: translateY(8px); transition: all .25s; pointer-events: none; box-shadow: var(--shadow-lg); border: 1px solid transparent; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green-light); border-color: #a9efd1; color: #027948; }
.toast-error { background: var(--red-light); border-color: #fecdca; color: #b42318; }
.toast-info { background: var(--accent-light); border-color: #c7d7fd; color: var(--accent-dark); }

/* ── Lang toggle ────────────────────────────────────────────────── */
.lang-toggle { font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; letter-spacing: 0.06em; transition: all .15s; }
.lang-toggle:hover { color: var(--text); border-color: var(--text); }

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { display: flex; align-items: center; justify-content: center; height: 100vh; flex-direction: column; gap: 1rem; color: var(--muted); font-size: 0.85rem; background: var(--bg); }
.loading-screen .spinner { width: 32px; height: 32px; border-width: 3px; }

/* ── Login page ─────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 50%, #f5f7ff 100%); padding: 1.5rem; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.login-logo { font-family: var(--font-head); font-weight: 800; font-size: 1.75rem; text-align: center; margin-bottom: 0.4rem; color: var(--text); letter-spacing: -0.5px; }
.login-logo span { color: var(--accent); }
.login-subtitle { text-align: center; color: var(--muted); font-size: 0.875rem; margin-bottom: 2rem; }
.login-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.login-forgot { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 0.75rem; cursor: pointer; }
.login-forgot:hover { color: var(--accent); }
.login-lang { display: flex; justify-content: center; margin-top: 1.5rem; }
.login-error { background: var(--red-light); border: 1px solid #fecdca; border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; color: var(--red); font-size: 0.82rem; margin-bottom: 1rem; display: none; }
.login-error.show { display: block; }

/* ── Territory detail ───────────────────────────────────────────── */
.terr-header { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.terr-map-thumb { width: 200px; height: 140px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.terr-map-thumb img { width: 100%; height: 100%; object-fit: cover; }
.terr-map-thumb .no-map { display: flex; align-items: center; justify-content: center; height: 100%; background: var(--surface2); color: var(--muted-light); font-size: 2rem; }
.terr-info h2 { font-family: var(--font-head); font-weight: 800; font-size: 1.75rem; color: var(--text); }
.terr-info .streets { color: var(--muted); font-size: 0.875rem; margin-top: 0.3rem; }
.terr-info .meta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* Address row highlight */
tr.row-expired td { background: var(--red-light); }
tr.row-visited td { background: var(--green-light); }

/* Progress bar */
.progress-bar { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 0.5rem; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

/* ── Coverage grid ──────────────────────────────────────────────── */
.coverage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }
.cov-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem; text-align: center; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm); }
.cov-cell:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cov-cell .cov-num { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--text); }
.cov-cell .cov-label { font-size: 0.6rem; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }
.cov-cell.cov-assigned { border-color: var(--accent); background: var(--accent-light); }
.cov-cell.cov-expired { border-color: var(--red); background: var(--red-light); }
.cov-cell.cov-available { opacity: 0.6; }
.cov-cell.cov-returned { border-color: var(--green); background: var(--green-light); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .topbar { display: flex; }
  .page-body { padding: 1rem; }
  .page-header { padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .terr-map-thumb { width: 100%; height: 180px; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: fixed; bottom: 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem 0.75rem; }
}

/* ── Sidebar overlay (mobile) ───────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,0.3); z-index: 99; backdrop-filter: blur(2px); }
.sidebar-overlay.open { display: block; }

/* ── Terr chip (assign page) ────────────────────────────────────── */
.terr-chip { padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.75rem; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); transition: all .12s; user-select: none; font-weight: 500; }
.terr-chip:hover { border-color: var(--accent); color: var(--accent); }
.terr-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.terr-chip.assigned { opacity: 0.4; cursor: not-allowed; background: var(--surface2); }
.terr-chip.expired { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ── Pub card (assign page) ─────────────────────────────────────── */
.pub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm); }
.pub-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pub-card.selected { border-color: var(--accent); background: var(--accent-light); }
.pub-card.pub-full { opacity: 0.55; }
.pub-card .pub-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.pub-card .pub-count { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
