/* ============================================================
   Valrom 30 de ani – Alocare mese
   ============================================================ */
:root {
  --navy: #0B3C74;
  --navy-600: #0f4c8f;
  --blue: #1F6FD1;
  --blue-100: #DBE9FF;
  --gold: #F5A623;
  --gold-100: #FFF1D6;
  --bg: #EEF2F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --text: #1A1F2B;
  --muted: #5B6270;
  --muted-2: #8B93A3;
  --border: #DDE3EC;
  --border-2: #C9D2DF;
  --danger: #DC2626;
  --danger-100: #FDE2E2;
  --success: #16A34A;
  --success-100: #DCFCE7;
  --warn: #D97706;
  --warn-100: #FEF3C7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .18);
  --radius: 10px;
  --panel-w: 430px;

  --cat-soci: #7C3AED;      --cat-soci-bg: #EDE4FF;
  --cat-furnizori: #EA580C; --cat-furnizori-bg: #FFE9D6;
  --cat-clienti: #0F9D6E;   --cat-clienti-bg: #D8F5EA;
  --cat-angajati: #2563EB;  --cat-angajati-bg: #DBE9FF;
  --cat-exangajati: #6B7280;--cat-exangajati-bg: #E9ECF1;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
::selection { background: var(--gold-100); }

/* ---------- butoane ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 13px; line-height: 1.2;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: #b7c2d2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-600); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1f2b; }
.btn.danger { color: var(--danger); border-color: #f3b4b4; background: #fff5f5; }
.btn.danger:hover { background: var(--danger-100); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(11, 60, 116, .08); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.xs { padding: 2px 7px; font-size: 11.5px; border-radius: 6px; }
.btn.block { width: 100%; justify-content: center; }
.btn.icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }
.btn .caret { font-size: 10px; opacity: .7; }

/* ---------- inputuri ---------- */
input[type=text], input[type=search], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; background: #fff;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 111, 209, .15); }
textarea { resize: vertical; min-height: 64px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
label.check input { width: auto; margin: 0; }

/* ---------- badge-uri ---------- */
.badge {
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; line-height: 1.3;
}
.badge.soci { background: var(--cat-soci-bg); color: var(--cat-soci); }
.badge.furnizori { background: var(--cat-furnizori-bg); color: var(--cat-furnizori); }
.badge.clienti { background: var(--cat-clienti-bg); color: var(--cat-clienti); }
.badge.angajati { background: var(--cat-angajati-bg); color: var(--cat-angajati); }
.badge.exangajati { background: var(--cat-exangajati-bg); color: var(--cat-exangajati); }
.badge.table { background: var(--navy); color: #fff; font-size: 11px; }
.badge.free { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.soci { background: var(--cat-soci); } .dot.furnizori { background: var(--cat-furnizori); }
.dot.clienti { background: var(--cat-clienti); } .dot.angajati { background: var(--cat-angajati); }
.dot.exangajati { background: var(--cat-exangajati); }

/* ============================================================
   Pagini autentificare / instalare
   ============================================================ */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #dbe9ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fff1d6 0%, transparent 60%), var(--bg); }
.auth-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.auth-brand h1 { font-size: 17px; margin: 0; color: var(--navy); line-height: 1.25; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.auth-logo { width: 54px; height: 54px; border-radius: 14px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; flex: none; letter-spacing: -1px; }
.auth-logo span { color: var(--gold); font-size: 14px; margin-left: 1px; margin-top: 8px; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 11.5px; margin: 18px 0 0; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.alert.error { background: var(--danger-100); color: #991b1b; }
.alert.success { background: var(--success-100); color: #166534; }
.alert.info { background: var(--blue-100); color: #1e3a8a; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 8px; }
.checks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.checks li { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); }
.checks li.ok span { color: var(--success); font-weight: 700; }
.checks li.bad span { color: var(--danger); font-weight: 700; }
.checks li.bad { background: var(--danger-100); }

/* ============================================================
   Aplicație
   ============================================================ */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar ---------- */
.topbar {
  height: 58px; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; flex: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--navy); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 16px; letter-spacing: -1px; flex: none; }
.brand .logo span { color: var(--gold); font-size: 10px; margin-left: 1px; margin-top: 6px; }
.brand .t { line-height: 1.15; min-width: 0; }
.brand .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .t small { font-size: 11px; opacity: .75; white-space: nowrap; }
.stats { display: flex; gap: 6px; margin-left: 12px; }
.stat { background: rgba(255,255,255,.1); border-radius: 8px; padding: 5px 10px; line-height: 1.1; min-width: 74px; }
.stat b { display: block; font-size: 16px; }
.stat small { font-size: 10.5px; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }
.stat.warn b { color: var(--gold); }
.topbar .spacer { flex: 1; }
.topbar .btn { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; }
.topbar .btn:hover { background: rgba(255,255,255,.18); }
.topbar .btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1f2b; }
.topbar .btn.gold:hover { background: #ffb63f; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #1a1f2b; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* ---------- dropdown ---------- */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--text); border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 250px; padding: 6px; z-index: 50; display: none; border: 1px solid var(--border);
}
.dd.open .dd-menu { display: block; }
.dd-menu .dd-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); padding: 8px 10px 4px; font-weight: 700; }
.dd-menu button, .dd-menu a { display: flex; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; gap: 10px; align-items: center; font-size: 13px; color: var(--text); text-decoration: none; }
.dd-menu button:hover, .dd-menu a:hover { background: var(--surface-2); }
.dd-menu button:disabled { opacity: .45; }
.dd-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-menu .ico { width: 20px; text-align: center; color: var(--muted); }

/* ---------- layout principal ---------- */
.main { flex: 1; display: flex; min-height: 0; }
.map-wrap { flex: 1; position: relative; min-width: 0; background: var(--bg); overflow: hidden;
  background-image: radial-gradient(circle, #d6dde8 1px, transparent 1px); background-size: 22px 22px; }
.map-wrap svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.map-wrap.panning svg { cursor: grabbing; }
.map-tools { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-tools .btn { width: 36px; height: 36px; padding: 0; justify-content: center; box-shadow: var(--shadow); font-size: 16px; }
.map-legend {
  position: absolute; bottom: 12px; left: 12px; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); box-shadow: var(--shadow); z-index: 5; align-items: center;
}
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; }
.sw.empty { background: #fff; border-color: #94A3B8; }
.sw.partial { background: #E6F4EA; border-color: #34A853; }
.sw.full { background: #DBE9FF; border-color: #1F6FD1; }
.sw.over { background: #FDE2E2; border-color: #DC2626; }
.map-hint { position: absolute; top: 12px; right: 12px; background: rgba(11,60,116,.92); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 12px; z-index: 5; box-shadow: var(--shadow); max-width: 320px; display: none; }
.map-hint.show { display: block; }
.map-hint b { color: var(--gold); }

/* SVG */
svg .stage rect { fill: #1e293b; stroke: #0f172a; }
svg .stage text { fill: #fff; font-weight: 800; font-size: 20px; letter-spacing: 3px; }
svg .desk rect { fill: #fff; stroke: #475569; stroke-width: 1.5; }
svg .desk text { fill: #334155; font-size: 11px; font-weight: 600; }
svg .wall { stroke: #64748b; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .entrance path { fill: #fff; stroke: #475569; stroke-width: 1.5; }
svg .entrance text { fill: #475569; font-size: 10px; font-weight: 600; }
svg .zone-label { fill: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

svg .tbl { cursor: pointer; }
svg .tbl .shape { stroke-width: 2.2; transition: fill .15s, stroke .15s; }
svg .tbl.empty .shape { fill: #fff; stroke: #94A3B8; }
svg .tbl.partial .shape { fill: #E6F4EA; stroke: #34A853; }
svg .tbl.full .shape { fill: #DBE9FF; stroke: #1F6FD1; }
svg .tbl.over .shape { fill: #FDE2E2; stroke: #DC2626; }
svg .tbl:hover .shape { filter: brightness(.96); stroke-width: 3; }
svg .tbl.selected .shape { stroke: var(--navy); stroke-width: 4; filter: drop-shadow(0 0 6px rgba(11,60,116,.55)); }
svg .tbl.drop .shape { stroke: var(--gold); stroke-width: 4; stroke-dasharray: 6 4; fill: var(--gold-100); }
svg .tbl.dim { opacity: .28; }
svg .tbl .nr { font-size: 15px; font-weight: 800; fill: #0B3C74; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
svg .tbl .cnt { font-size: 9.5px; font-weight: 700; fill: #475569; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
svg .tbl.over .cnt { fill: #b91c1c; }
svg .tbl.full .cnt { fill: #1d4ed8; }
svg .tbl.partial .cnt { fill: #15803d; }
svg .tbl .ring { fill: none; stroke: #fff; stroke-width: 3; pointer-events: none; }
svg .tbl .ring-fill { fill: none; stroke-width: 3; pointer-events: none; stroke-linecap: round; opacity: .9; }
svg .tbl.partial .ring-fill { stroke: #34A853; }
svg .tbl.full .ring-fill { stroke: #1F6FD1; }
svg .tbl.over .ring-fill { stroke: #DC2626; }
svg .tbl .pins { pointer-events: none; }
svg .tbl .pins circle { stroke: #fff; stroke-width: 1; }

/* ---------- panel dreapta ---------- */
.panel { width: var(--panel-w); flex: none; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; z-index: 6; }
.tabs { display: flex; border-bottom: 1px solid var(--border); flex: none; background: var(--surface-2); }
.tab { flex: 1; padding: 11px 10px; text-align: center; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); background: var(--surface); }
.tab .pill { background: var(--border); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.tab.active .pill { background: var(--navy); color: #fff; }
.tab-body { flex: 1; min-height: 0; display: none; flex-direction: column; }
.tab-body.active { display: flex; }

/* lista persoane */
.filters { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); flex: none; display: flex; flex-direction: column; gap: 8px; }
.search { position: relative; }
.search input { padding-left: 32px; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted-2); font-size: 16px; display: none; }
.search.has .clear { display: block; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-2); background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }
.chip .n { opacity: .7; font-weight: 500; }
.filters .row { display: flex; gap: 6px; align-items: center; }
.filters select { width: auto; padding: 5px 8px; font-size: 12.5px; flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; }
.toggle input { margin: 0; }

.list { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.list-empty { padding: 32px 20px; text-align: center; color: var(--muted-2); font-size: 13px; }
.grp { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; font-size: 12.5px; }
.grp .co { font-weight: 700; color: var(--navy); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: grab; }
.grp .co small { font-weight: 600; color: var(--muted-2); margin-left: 4px; }
.grp .btn { flex: none; }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-bottom: 1px solid #edf0f5; cursor: grab; transition: background .1s; }
.row:hover { background: #f8fafc; }
.row.dragging { opacity: .4; }
.row.assigned { background: #fff; }
.row.highlight { background: var(--gold-100); }
.row .grab { color: #c3cad6; font-size: 14px; flex: none; width: 10px; }
.row .info { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.row .nm .present { color: var(--success); font-size: 12px; }
.row .sub { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.row .sub .co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.row .sub .resp::before { content: "· "; }
.row .note { font-size: 11px; color: #8a2c0d; font-style: italic; }
.row .act { display: flex; gap: 4px; flex: none; opacity: .55; transition: opacity .1s; }
.row:hover .act { opacity: 1; }
.row .btn.xs { min-width: 26px; height: 26px; justify-content: center; }
.row .tblnr { font-weight: 800; color: var(--navy); font-size: 12px; background: var(--blue-100); border-radius: 6px; padding: 2px 7px; cursor: pointer; flex: none; }
.row .tblnr:hover { background: #c7dbff; }
.row .seat { color: var(--muted-2); font-size: 11px; width: 18px; text-align: right; flex: none; font-weight: 600; }
.list-foot { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; flex: none; background: var(--surface-2); }
.bulk { display: flex; gap: 6px; align-items: center; }

/* drop zone dezalocare */
.dropzone { margin: 8px 12px; border: 2px dashed var(--border-2); border-radius: 10px; padding: 10px; text-align: center; font-size: 12px; color: var(--muted); display: none; }
.dropzone.show { display: block; }
.dropzone.over { border-color: var(--danger); background: var(--danger-100); color: var(--danger); }

/* ---------- panou masă ---------- */
.thead { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); flex: none; }
.thead .top { display: flex; align-items: center; gap: 10px; }
.thead h2 { margin: 0; font-size: 20px; color: var(--navy); display: flex; align-items: baseline; gap: 8px; }
.thead h2 small { font-size: 12px; color: var(--muted); font-weight: 600; }
.thead .top .btn { margin-left: auto; }
.occ { margin-top: 10px; }
.occ .bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.occ .bar i { display: block; height: 100%; background: var(--success); border-radius: 999px; transition: width .2s; }
.occ.full .bar i { background: var(--blue); }
.occ.over .bar i { background: var(--danger); }
.occ .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }
.occ .lbl b { color: var(--text); }
.cap-edit { display: inline-flex; align-items: center; gap: 4px; }
.cap-edit input { width: 58px; padding: 2px 6px; font-size: 12px; text-align: center; }
.tcats { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tnotes { margin-top: 8px; }
.tnotes textarea { min-height: 40px; font-size: 12.5px; padding: 6px 8px; }
.tadd { padding: 8px 12px; border-bottom: 1px solid var(--border); flex: none; position: relative; }
.tadd .sugg { position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 30; max-height: 280px; overflow-y: auto; display: none; }
.tadd .sugg.show { display: block; }
.tadd .sugg .row { cursor: pointer; }
.tadd .sugg .grp { position: static; }
.tfoot { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; flex: none; background: var(--surface-2); }
.tfoot .btn { flex: 1; justify-content: center; }
.no-table { padding: 40px 24px; text-align: center; color: var(--muted); }
.no-table .big { font-size: 42px; margin-bottom: 8px; }
.no-table p { margin: 6px 0; font-size: 13px; line-height: 1.5; }

/* ---------- modale ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .14s; }
.modal.lg { max-width: 860px; }
.modal.sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 16px; color: var(--navy); flex: 1; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 14px 14px; }
.modal-f .left { margin-right: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--border); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .mono { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; white-space: nowrap; }
.export-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.exp { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.exp .ico { font-size: 22px; width: 36px; text-align: center; }
.exp .t { flex: 1; }
.exp .t b { display: block; font-size: 13.5px; }
.exp .t small { color: var(--muted); font-size: 12px; }
.exp .acts { display: flex; gap: 6px; }
.act-log { font-size: 12.5px; }
.act-log .it { display: flex; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.act-log .it .when { color: var(--muted-2); white-space: nowrap; font-variant-numeric: tabular-nums; width: 112px; flex: none; font-size: 11.5px; }
.act-log .it .who { font-weight: 700; color: var(--navy); width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-log .it .what { flex: 1; }
.act-log .it .what b { font-weight: 600; }
.act-log .it .what .arrow { color: var(--muted-2); }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: up .18s; max-width: 92vw; }
.toast.err { background: #991b1b; }
.toast.ok { background: #166534; }
.toast .btn { background: rgba(255,255,255,.14); border-color: transparent; color: #fff; padding: 4px 10px; }
.toast .btn:hover { background: rgba(255,255,255,.26); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* ---------- ghost drag ---------- */
.drag-ghost { position: fixed; top: -1000px; left: -1000px; background: var(--navy); color: #fff; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-lg); pointer-events: none; z-index: 999; white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --panel-w: 380px; }
  .stat { min-width: 62px; padding: 4px 8px; }
  .stat b { font-size: 14px; }
  .brand .t small { display: none; }
}
@media (max-width: 900px) {
  .main { flex-direction: column; }
  .panel { width: 100%; height: 52%; border-left: 0; border-top: 1px solid var(--border); }
  .map-wrap { height: 48%; flex: none; }
  .stats { display: none; }
  .map-legend { display: none; }
  .brand .t b { font-size: 12.5px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .btn .txt { display: none; }
}
.hide { display: none !important; }
kbd { background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; font-family: inherit; }
