:root {
  --bg: #08111f;
  --panel: rgba(15, 28, 48, .86);
  --panel-strong: #12223a;
  --panel-soft: rgba(25, 42, 67, .72);
  --text: #eef6ff;
  --muted: #94a8c2;
  --mint: #35f2ad;
  --mint-dark: #0bcf8a;
  --amber: #ffc857;
  --red: #ff6b7a;
  --blue: #6aa9ff;
  --purple: #a98bff;
  --line: rgba(255, 255, 255, .09);
  --shadow: 0 22px 70px rgba(0, 0, 0, .28);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(53, 242, 173, .10), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(106, 169, 255, .10), transparent 30%),
    linear-gradient(145deg, #07101e 0%, #0b1628 48%, #0b1321 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column; padding: 22px 16px;
  background: rgba(6, 14, 26, .86); backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 24px; font-weight: 800; letter-spacing: -.02em; }
.brand b { color: var(--mint); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #032017; background: linear-gradient(135deg, var(--mint), #9dffd9); box-shadow: 0 10px 30px rgba(53,242,173,.22); }
.nav { display: grid; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 13px; color: var(--muted); transition: .18s ease; border: 1px solid transparent; }
.nav a span { width: 20px; text-align: center; color: #b8c8da; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.045); transform: translateX(2px); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(53,242,173,.13), rgba(53,242,173,.04)); border-color: rgba(53,242,173,.18); }
.nav a.active span { color: var(--mint); }
.sidebar-foot { margin-top: auto; padding: 14px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.025); }
.sidebar-foot small { display: block; margin-top: 5px; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(53,242,173,.09); }
.main { min-width: 0; padding: 26px 30px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.topbar-left, .top-actions { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); }
.user-chip > span:nth-child(2) { display: grid; min-width: 110px; }
.user-chip b { font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.user-chip > a { color: var(--muted); padding: 5px; }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #071c17; background: linear-gradient(135deg, #b7ffe3, var(--mint)); }
.icon-btn { border: 1px solid var(--line); color: var(--text); background: var(--panel-soft); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; cursor: pointer; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-primary { color: #052117; background: linear-gradient(135deg, var(--mint), #78ffd0); box-shadow: 0 12px 30px rgba(53,242,173,.17); }
.btn-secondary { color: var(--text); background: var(--panel-soft); border-color: var(--line); }
.btn-danger { color: #ffdce1; background: rgba(255,107,122,.12); border-color: rgba(255,107,122,.22); }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.card { background: linear-gradient(180deg, rgba(19,35,59,.92), rgba(12,24,42,.88)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.metric-card { position: relative; overflow: hidden; padding: 18px; min-height: 126px; }
.metric-card::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; right: -42px; top: -42px; background: rgba(53,242,173,.07); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric { margin-top: 9px; font-size: 32px; line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.metric-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 16px; margin-top: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.filter-grid { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 10px; width: 100%; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 650; }
.input, input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(5,15,29,.78); outline: none; transition: .16s ease; }
input, select { min-height: 43px; padding: 10px 12px; }
textarea { min-height: 108px; padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(53,242,173,.55); box-shadow: 0 0 0 4px rgba(53,242,173,.07); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--mint); }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 0 2px; }
.form-section { padding: 18px; margin-bottom: 14px; }
.form-section h3 { margin: 0 0 15px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: 1 / -1; }
.price-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 14px; border-radius: 14px; background: rgba(53,242,173,.055); border: 1px solid rgba(53,242,173,.14); }
.price-summary div { display: grid; gap: 4px; }
.price-summary small { color: var(--muted); }
.price-summary strong { font-size: 20px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(10,22,39,.72); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: #102039; font-size: 12px; font-weight: 700; }
tbody tr { transition: .14s ease; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
.client-cell { display: grid; gap: 3px; }
.client-cell small { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(106,169,255,.12); color: #a9cbff; border: 1px solid rgba(106,169,255,.16); }
.status-new, .status-quoted { background: rgba(106,169,255,.12); color: #b6d3ff; }
.status-awaiting_client, .status-awaiting_payment, .status-on_hold { background: rgba(255,200,87,.11); color: #ffe09a; border-color: rgba(255,200,87,.17); }
.status-paid, .status-in_translation, .status-review, .status-notary { background: rgba(169,139,255,.11); color: #d2c2ff; border-color: rgba(169,139,255,.17); }
.status-ready, .status-delivered { background: rgba(53,242,173,.11); color: #9dffd8; border-color: rgba(53,242,173,.17); }
.status-cancelled { background: rgba(255,107,122,.11); color: #ffc1c9; border-color: rgba(255,107,122,.17); }
.priority { display: inline-flex; padding: 5px 8px; border-radius: 9px; font-size: 11px; font-weight: 750; background: rgba(255,255,255,.05); color: var(--muted); }
.priority-urgent { color: #ffc2ca; background: rgba(255,107,122,.11); }
.priority-high { color: #ffe09a; background: rgba(255,200,87,.11); }
.late-text { color: #ff9ca8; font-weight: 750; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 16px; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.detail-item small { display: block; color: var(--muted); margin-bottom: 5px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.timeline-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgba(53,242,173,.10); color: var(--mint); }
.timeline-content { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.timeline-content small { color: var(--muted); }
.comment { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.comment-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.comment-head small { color: var(--muted); }
.file-list { display: grid; gap: 8px; }
.file-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.file-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(270px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-height: 520px; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,17,31,.52); }
.kanban-head { position: sticky; top: 0; padding: 13px; display: flex; justify-content: space-between; gap: 8px; background: rgba(16,32,57,.96); border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; z-index: 1; }
.kanban-body { min-height: 460px; padding: 10px; display: grid; align-content: start; gap: 9px; }
.kanban-card { cursor: grab; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, rgba(25,43,69,.96), rgba(15,29,50,.96)); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.kanban-card:active { cursor: grabbing; }
.kanban-card h4 { margin: 0 0 7px; font-size: 14px; }
.kanban-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.kanban-body.drag-over { outline: 2px dashed rgba(53,242,173,.5); outline-offset: -7px; border-radius: 12px; }
.flash { margin-bottom: 14px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); }
.flash-success { color: #a8ffdd; background: rgba(53,242,173,.09); border-color: rgba(53,242,173,.17); }
.flash-error { color: #ffc2ca; background: rgba(255,107,122,.09); border-color: rgba(255,107,122,.17); }
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; max-width: min(390px, calc(100vw - 36px)); }
.toast { opacity: 0; transform: translateY(8px); padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: #13243e; box-shadow: var(--shadow); transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info { border-color: rgba(106,169,255,.28); }
.login-page { display: grid; place-items: center; padding: 22px; }
.login-shell { width: min(430px, 100%); }
.login-card { padding: 25px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card h1 { margin: 0; font-size: 25px; }
.login-card .sub { margin: 4px 0 0; color: var(--muted); }
.login-card .btn { width: 100%; margin-top: 10px; }
.login-help { margin-top: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.alert { padding: 11px 13px; margin-bottom: 14px; border-radius: 12px; color: #ffc3cb; background: rgba(255,107,122,.10); border: 1px solid rgba(255,107,122,.18); }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 11px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.mt-16 { margin-top: 16px; }
.mobile-only { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .col-3 { grid-column: 1 / -1; }
  .section-grid, .detail-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 270px; transition: .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.48); }
  .mobile-only { display: inline-grid; place-items: center; }
  .main { padding: 20px 18px 34px; }
  .topbar { align-items: flex-start; }
  .user-chip > span:nth-child(2) { display: none; }
}
@media (max-width: 640px) {
  .cards, .form-grid, .detail-list, .price-summary, .filter-grid { grid-template-columns: 1fr; }
  .col-2, .col-3 { grid-column: auto; }
  .desktop-only { display: none !important; }
  .main { padding: 16px 13px 28px; }
  .topbar { margin-bottom: 18px; }
  .topbar h1 { font-size: 24px; }
  .card-pad, .form-section { padding: 14px; }
  th, td { padding: 11px 12px; }
  .toolbar { align-items: stretch; }
  .toolbar > * { width: 100%; }
  .toolbar .btn { width: 100%; }
}
