@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #0d0f12;
  --surface: #13161b;
  --surface2: #1a1f27;
  --surface3: #202630;
  --border: #252c38;
  --border2: #2e3847;
  --accent: #2dd4bf;
  --accent2: #0e7490;
  --accent3: #042f2e;
  --warn: #f59e0b;
  --warn-bg: #1c0a00;
  --warn-border: #78350f;
  --danger: #ef4444;
  --danger-bg: #200808;
  --danger-border: #7f1d1d;
  --success: #22c55e;
  --success-bg: #052e16;
  --success-border: #166534;
  --blue: #60a5fa;
  --blue-bg: #0c1a30;
  --blue-border: #1e3a5f;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #4a5568;
  --text4: #2d3748;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 5px;
  --radius-lg: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 240px; min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}

.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sidebar-logo small { display: block; color: var(--text3); font-size: 8px; letter-spacing: 1px; margin-top: 2px; }

.sidebar-section { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: none; }

.sidebar-label {
  font-family: var(--mono);
  font-size: 8.5px; letter-spacing: 2px;
  color: var(--text3); text-transform: uppercase;
  padding: 4px 20px 6px;
}

.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 20px;
  color: var(--text2); font-size: 13px;
  border-left: 2px solid transparent;
  cursor: pointer; transition: all 0.12s;
  text-decoration: none;
}
.sidebar-item:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--surface2); }
.sidebar-item .ico { font-size: 12px; width: 16px; text-align: center; }
.sidebar-item .badge {
  margin-left: auto;
  font-family: var(--mono); font-size: 9px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text3);
}
.sidebar-item.active .badge { background: var(--accent3); border-color: var(--accent2); color: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 9px; color: var(--text3);
  flex-shrink: 0;
}

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── MONEY VISIBILITY TOGGLE ───────────────────────────────────────────── */
.money-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 12px;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.money-toggle:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}
.money-toggle.hidden .money-icon-visible,
.money-toggle:not(.hidden) .money-icon-hidden {
  display: none;
}

.money-value {
  transition: filter 0.2s ease;
}

.money-hidden .money-value {
  filter: blur(8px);
  user-select: none;
}

/* ── SIDEBAR TOGGLE ────────────────────────────────────────────────────── */
.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 14px;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}
.sidebar-toggle:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}

.sidebar {
  transition: width 0.2s ease, min-width 0.2s ease, transform 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  transform: translateX(-100%);
  border-right: none;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .main-area {
  width: 100%;
}

.topbar {
  height: 52px; min-height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  flex-shrink: 0;
}
.topbar-info { flex: 1; }
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-sub { font-family: var(--mono); font-size: 9.5px; color: var(--text3); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── BREADCRUMB ─────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { font-family: var(--mono); font-size: 10px; color: var(--text4); }

/* ── FLASH MESSAGES ─────────────────────────────────────────────────────── */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13px; font-weight: 500;
  pointer-events: all;
  animation: slideIn 0.2s ease;
  min-width: 280px; max-width: 400px;
}
.flash-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.flash-error   { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger); }
.flash-warning { background: var(--warn-bg);    border-color: var(--warn-border);    color: var(--warn); }
.flash-info    { background: var(--blue-bg);    border-color: var(--blue-border);    color: var(--blue); }
.flash-close { margin-left: auto; cursor: pointer; opacity: 0.6; font-size: 16px; }
.flash-close:hover { opacity: 1; }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500; font-family: var(--sans);
  border-radius: var(--radius); border: 1px solid;
  cursor: pointer; transition: all 0.12s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent3); border-color: var(--accent2); color: var(--accent); }
.btn-primary:hover { background: #053d3b; border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: #2d0a0a; }
.btn-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }
.btn-icon { padding: 6px 8px; }
.btn[disabled], .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TAGS / BADGES ──────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 2px 7px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.5px; border: 1px solid;
  white-space: nowrap;
}
.tag-active, .tag-done     { color: var(--success); border-color: var(--success-border); background: var(--success-bg); }
.tag-pending               { color: var(--warn);    border-color: var(--warn-border);    background: var(--warn-bg); }
.tag-closed, .tag-cancelled{ color: var(--text3);   border-color: var(--border);         background: var(--surface2); }
.tag-draft                 { color: var(--blue);    border-color: var(--blue-border);    background: var(--blue-bg); }
.tag-progress              { color: var(--accent);  border-color: var(--accent2);        background: var(--accent3); }
.tag-paused                { color: var(--warn);    border-color: var(--warn-border);    background: var(--warn-bg); }
.tag-high                  { color: var(--danger);  border-color: var(--danger-border);  background: var(--danger-bg); }
.tag-medium                { color: var(--warn);    border-color: var(--warn-border);    background: var(--warn-bg); }
.tag-low                   { color: var(--text3);   border-color: var(--border);         background: var(--surface2); }
.tag-admin                 { color: var(--accent);  border-color: var(--accent2);        background: var(--accent3); }
.tag-manager               { color: var(--blue);    border-color: var(--blue-border);    background: var(--blue-bg); }
.tag-viewer                { color: var(--text3);   border-color: var(--border);         background: var(--surface2); }
.tag-owner                 { color: #7c3aed;        border-color: #a78bfa;               background: #ede9fe; }
.tag-member                { color: var(--blue);    border-color: var(--blue-border);    background: var(--blue-bg); }
/* Requirement types */
.tag-feature               { color: var(--accent);  border-color: var(--accent2);        background: var(--accent3); }
.tag-bug                   { color: var(--danger);  border-color: var(--danger-border);  background: var(--danger-bg); }
.tag-improvement           { color: var(--blue);    border-color: var(--blue-border);    background: var(--blue-bg); }
.tag-task                  { color: var(--text2);   border-color: var(--border);         background: var(--surface2); }
/* Requirement status */
.tag-backlog               { color: var(--text3);   border-color: var(--border);         background: var(--surface2); }
.tag-todo                  { color: var(--blue);    border-color: var(--blue-border);    background: var(--blue-bg); }
.tag-review                { color: var(--warn);    border-color: var(--warn-border);    background: var(--warn-bg); }
/* Priority */
.tag-critical              { color: #fff;           border-color: var(--danger);         background: var(--danger); }
.tag-danger                { color: var(--danger);  border-color: var(--danger-border);  background: var(--danger-bg); }

/* ── CARDS / PANELS ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title { font-size: 13px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 8px; }

/* ── KPI GRID ───────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative; overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent2);
}
.kpi-val { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 6px; }
.kpi-val.accent  { color: var(--accent); }
.kpi-val.success { color: var(--success); }
.kpi-val.warn    { color: var(--warn); }
.kpi-val.danger  { color: var(--danger); }
.kpi-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── CLIENT CARDS GRID ──────────────────────────────────────────────────── */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer; transition: border-color 0.12s, transform 0.12s;
  position: relative; overflow: hidden;
  text-decoration: none; display: block; color: var(--text);
}
.client-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent2); transition: background 0.12s;
}
.client-card:hover { border-color: var(--border2); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.client-card:hover::before { background: var(--accent); }
.cc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.cc-name { font-size: 14px; font-weight: 600; }
.cc-segment { font-size: 11px; color: var(--text2); margin-bottom: 10px; }
.cc-contact { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.cc-health { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 4px; }
.cc-health-fill { height: 100%; border-radius: 2px; background: var(--accent); }
.cc-health-label { font-family: var(--mono); font-size: 9px; color: var(--text3); margin-bottom: 12px; }
.cc-stats { display: flex; gap: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.cc-stat { flex: 1; text-align: center; }
.cc-stat + .cc-stat { border-left: 1px solid var(--border); }
.cc-stat-val { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.cc-stat-val.accent  { color: var(--accent); }
.cc-stat-val.warn    { color: var(--warn); }
.cc-stat-val.success { color: var(--success); font-size: 11px; }
.cc-stat-label { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ── SEARCH / FILTERS ───────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-wrap .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 12px; }
.search-input {
  width: 100%; padding: 8px 10px 8px 32px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px;
  font-family: var(--sans); outline: none; transition: border-color 0.12s;
}
.search-input:focus { border-color: var(--accent2); }
.search-input::placeholder { color: var(--text3); }

.filter-select {
  padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text2);
  font-size: 12px; font-family: var(--sans); outline: none;
  cursor: pointer; transition: border-color 0.12s;
}
.filter-select:focus { border-color: var(--accent2); }
.filter-select option { background: var(--surface2); }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  font-family: var(--mono); font-size: 9px;
  color: var(--text3); text-transform: uppercase; letter-spacing: 1px;
  text-align: left; font-weight: 500; white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface2); }
.table tbody tr.clickable { cursor: pointer; }
.td-primary { font-weight: 500; }
.td-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.td-mono { font-family: var(--mono); font-size: 11px; color: var(--text2); }
.td-actions { display: flex; gap: 6px; align-items: center; }
.table-empty { padding: 48px; text-align: center; color: var(--text3); }
.table-empty-ico { font-size: 28px; margin-bottom: 10px; opacity: 0.4; }

/* ── PAGINATION ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.pag-info { font-family: var(--mono); font-size: 10px; }
.pag-links { display: flex; gap: 4px; }
.pag-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 3px; font-size: 11px; color: var(--text2);
  text-decoration: none; transition: all 0.1s;
}
.pag-link:hover { border-color: var(--border2); color: var(--text); text-decoration: none; }
.pag-link.active { background: var(--accent3); border-color: var(--accent2); color: var(--accent); }
.pag-link.disabled { opacity: 0.3; pointer-events: none; }

/* ── FORMS ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: 9.5px;
  color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; font-family: var(--sans);
  outline: none; transition: border-color 0.12s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent2); }
.form-input::placeholder { color: var(--text3); }
.form-select option { background: var(--surface2); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.form-section-title {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 16px;
}

/* ── MODAL ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 540px; max-width: 95vw;
  max-height: 88vh; overflow-y: auto;
  padding: 24px;
  transform: translateY(12px); transition: transform 0.15s;
  box-shadow: var(--shadow);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { width: 680px; }
.modal-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── TABS ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-link {
  padding: 10px 18px;
  font-size: 12px; font-weight: 500; color: var(--text2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.tab-link:hover { color: var(--text); text-decoration: none; }
.tab-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  font-family: var(--mono); font-size: 9px;
  background: var(--surface2); padding: 1px 5px; border-radius: 3px;
}
.tab-link.active .tab-count { background: var(--accent3); color: var(--accent); }

/* ── DETAIL HEADER ──────────────────────────────────────────────────────── */
.detail-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 20px;
}
.dh-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.dh-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.dh-meta-item { display: flex; align-items: center; gap: 5px; }

/* ── MEETING DETAIL ─────────────────────────────────────────────────────── */
.meeting-section { margin-bottom: 24px; }
.meeting-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.meeting-section-title {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px;
}
.meeting-items { display: flex; flex-direction: column; gap: 6px; }
.meeting-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.meeting-item-bullet { color: var(--text3); font-size: 12px; margin-top: 1px; flex-shrink: 0; }
.meeting-item-text { font-size: 13px; flex: 1; }
.meeting-item-del { color: var(--text3); cursor: pointer; transition: color 0.1s; flex-shrink: 0; font-size: 13px; background: none; border: none; }
.meeting-item-del:hover { color: var(--danger); }
.meeting-add-form { display: flex; gap: 8px; margin-top: 8px; }
.meeting-add-input {
  flex: 1; padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; font-family: var(--sans); outline: none;
  transition: border-color 0.12s;
}
.meeting-add-input:focus { border-color: var(--accent2); }
.meeting-add-input::placeholder { color: var(--text3); }

/* ── ATTACHMENT LIST ────────────────────────────────────────────────────── */
.attachment-list { display: flex; flex-direction: column; gap: 6px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.attachment-ico { font-size: 18px; flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-meta { font-family: var(--mono); font-size: 10px; color: var(--text3); margin-top: 2px; }
.attachment-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── CONTRACT CARD ──────────────────────────────────────────────────────── */
.contract-value { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--accent); }

/* ── PERMISSIONS GRID ───────────────────────────────────────────────────── */
.perms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.perm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: all 0.1s;
}
.perm-item:hover { border-color: var(--border2); color: var(--text); }
.perm-item input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.perm-item.checked { background: var(--accent3); border-color: var(--accent2); color: var(--accent); }

/* ── UPLOAD ─────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent2); color: var(--accent); background: var(--accent3); }
.upload-zone input[type=file] { display: none; }

/* ── LOGIN ──────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(14,116,144,0.07) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(45,212,191,0.04) 0%, transparent 50%);
}
.login-box {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center; margin-bottom: 28px;
  font-family: var(--mono); font-size: 13px;
  color: var(--accent); letter-spacing: 3px; text-transform: uppercase;
}
.login-logo small { display: block; color: var(--text3); font-size: 9px; margin-top: 4px; letter-spacing: 1px; }
.login-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; text-align: center; }

/* ── EMPTY STATE ────────────────────────────────────────────────────────── */
.empty-state { padding: 48px 24px; text-align: center; color: var(--text3); }
.empty-state-ico { font-size: 36px; margin-bottom: 12px; opacity: 0.35; }
.empty-state-title { font-size: 14px; color: var(--text2); margin-bottom: 6px; }
.empty-state-sub { font-size: 12px; }

/* ── CONFIRM DIALOG ─────────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-lg);
  padding: 24px; width: 360px;
  box-shadow: var(--shadow);
  transform: scale(0.96); transition: transform 0.15s;
}
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--danger); }
.confirm-body  { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── MISC ───────────────────────────────────────────────────────────────── */
.sep-v { width: 1px; background: var(--border); align-self: stretch; }
.mono { font-family: var(--mono); }
.text-muted { color: var(--text2); }
.text-dim { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-right { text-align: right; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── MINI PROGRESS BAR ─────────────────────────────────────────────────── */
.mini-progress {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.mini-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── NOTIFICATIONS ─────────────────────────────────────────────────────── */
.notif-wrapper {
  position: relative;
}
.notif-bell {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s;
}
.notif-bell:hover {
  background: var(--surface2);
  border-color: var(--border2);
}
.notif-icon {
  font-size: 14px;
}
.notif-badge {
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}
.notif-dropdown.open {
  display: flex;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.notif-header-actions {
  display: flex;
  gap: 4px;
}
.notif-action-btn {
  background: var(--accent3);
  border: 1px solid var(--accent2);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
}
.notif-action-btn:hover {
  background: var(--accent2);
}
.notif-delete-all {
  background: var(--danger-bg);
  border-color: var(--danger-bg);
  color: var(--danger);
}
.notif-delete-all:hover {
  background: var(--danger);
  color: #fff;
}
.notif-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: var(--text);
}
.notif-item:hover {
  background: var(--surface2);
  text-decoration: none;
}
.notif-item.unread {
  background: var(--accent3);
  border-left: 3px solid var(--accent);
}
.notif-item.unread:hover {
  background: #053d3b;
}
.notif-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-msg {
  font-size: 11px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-time {
  font-size: 9px;
  color: var(--text3);
  margin-top: 4px;
  font-family: var(--mono);
}
.notif-empty {
  padding: 32px;
  text-align: center;
  color: var(--text3);
  font-size: 12px;
}
.notif-item-del {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.notif-item:hover .notif-item-del { opacity: 1; }
.notif-item-del:hover { color: var(--danger); }
