:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --border: #d9e2ee;
  --ink: #142033;
  --green: #0f8f63;
  --blue: #2563eb;
  --amber: #c77700;
  --red: #dc2626;
  --violet: #6d28d9;
  --shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: #eef2f7; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: var(--shadow); }
.brand { margin-bottom: 18px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0; line-height: 1.1; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.brand-sidebar { margin: 0 0 8px; padding: 7px 4px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-sidebar h1 { color: #fff; font-size: 19px; }
.brand-sidebar p { color: #a6b3c3; }

.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field label, .check { font-size: 12px; font-weight: 750; color: #334155; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.field input, .field textarea, .field select, .search, .inline-form input, .mini-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .search:focus, .inline-form input:focus, .mini-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn {
  min-height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.btn.small { min-height: 30px; padding: 0 9px; font-size: 12px; }
.btn.square { width: 36px; padding: 0; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }

.app { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { background: #101827; color: #fff; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 100vh; height: 100vh; position: sticky; top: 0; }
.nav { display: grid; gap: 12px; align-content: start; flex: 1; overflow: auto; padding-right: 2px; }
.nav-section { display: grid; gap: 5px; }
.nav-section > span { color: #7f8da3; font-size: 11px; font-weight: 850; text-transform: uppercase; padding: 0 10px 3px; }
.nav button {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 11px;
  text-align: left;
  display: flex;
  align-items: center;
  font-weight: 750;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; display: grid; gap: 10px; color: #94a3b8; }
.sidebar-link { min-height: 36px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; color: #fff; text-decoration: none; display: flex; align-items: center; padding: 0 11px; font-weight: 800; }
.sidebar-footer small { line-height: 1.45; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 58px; border-bottom: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 10px; }
.topbar h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.userbar { display: flex; align-items: center; gap: 10px; }
.content { padding: 16px; overflow: auto; flex: 1; }
.app-footer { min-height: 44px; border-top: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; color: var(--muted); font-size: 12px; }
.app-footer a { color: var(--ink); font-weight: 800; text-decoration: none; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; margin-top: 12px; }
.dashboard-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.accounting-workspace, .mailing-workspace, .admin-workspace { grid-template-columns: 380px minmax(0, 1fr); }
.support-workspace { grid-template-columns: minmax(0, 1fr) 360px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
  min-width: 0;
}
.panel.loading, .panel.error { min-height: 120px; display: grid; place-items: center; }
.panel-main { overflow: hidden; }
.side-panel { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow: auto; }
.panel h3, .detail-main h3, .detail-side h3 { margin: 0 0 11px; font-size: 14px; letter-spacing: 0; }
.panel h4, .kanban-card h4 { margin: 0; letter-spacing: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.toolbar, .actions-row, .link-grid { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { justify-content: flex-end; }
.actions-row { margin-bottom: 12px; }
.search { min-width: min(320px, 100%); }

.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 13px; min-height: 80px; display: grid; align-content: center; gap: 6px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 750; }
.stat strong { font-size: 24px; line-height: 1.1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: #475569; text-align: left; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); padding: 9px; }
td { border-bottom: 1px solid #edf2f7; padding: 9px; vertical-align: top; }
tr:hover td { background: #f8fafc; }
.right { text-align: right; }
.muted { color: var(--muted); }

.pill { display: inline-flex; align-items: center; min-height: 22px; border-radius: 7px; padding: 0 8px; font-size: 11px; font-weight: 850; border: 1px solid transparent; white-space: nowrap; }
.pill.new, .pill.draft { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.pill.diagnostic, .pill.sent { background: #fef3c7; color: #a16207; border-color: #fde68a; }
.pill.waiting_client, .pill.waiting_part, .pill.overdue { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.pill.repairing, .pill.accepted { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.pill.ready, .pill.paid { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pill.delivered, .pill.cancelled, .pill.refused, .pill.expired { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.priority { display: inline-flex; align-items: center; min-height: 20px; border-radius: 7px; padding: 0 7px; font-size: 10px; font-weight: 850; background: #f1f5f9; color: #475569; }
.priority.high, .priority.urgent { background: #fee2e2; color: #b91c1c; }
.priority.low { background: #ecfdf5; color: #047857; }
.notify-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 7px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 900;
  border: 1px solid transparent;
}
.notify-pill.on { background: rgba(25,217,140,.14); color: #8bf0c3; border-color: rgba(25,217,140,.28); }
.notify-pill.off { background: rgba(255,92,120,.14); color: #ffa7b6; border-color: rgba(255,92,120,.28); }
.notify-check {
  border: 1px solid rgba(32,217,242,.16);
  border-radius: 8px;
  background: rgba(32,217,242,.06);
  padding: 10px 12px;
}

.kanban { display: grid; grid-template-columns: repeat(4, minmax(258px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.kanban-column { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; min-height: 410px; display: flex; flex-direction: column; min-width: 0; }
.kanban-column header { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); }
.kanban-column header h4 { font-size: 13px; }
.kanban-column header span { min-width: 24px; min-height: 22px; display: grid; place-items: center; border-radius: 7px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 850; }
.kanban-list { display: grid; gap: 8px; padding: 9px; align-content: start; min-width: 0; overflow: hidden; }
.kanban-card { background: #fff; border: 1px solid #dbe3ee; border-left: 4px solid #94a3b8; border-radius: 8px; padding: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); display: grid; gap: 8px; min-width: 0; overflow: hidden; }
.kanban-card.priority-high, .kanban-card.priority-urgent { border-left-color: var(--red); }
.kanban-card.priority-low { border-left-color: var(--green); }
.kanban-card.type-order { border-left-color: var(--violet); }
.kanban-card h4 { font-size: 13px; line-height: 1.25; }
.kanban-card p { margin: 0; font-size: 12px; line-height: 1.35; }
.kanban-card.overdue { box-shadow: 0 0 0 1px rgba(220,38,38,.28), 0 12px 28px rgba(220,38,38,.08); }
.kanban-card.is-compact { gap: 6px; }
.card-line { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; min-width: 0; }
.card-line > strong { min-width: 0; overflow-wrap: anywhere; }
.card-line > span { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; max-width: 48%; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.card-title-row h4 { min-width: 0; overflow-wrap: anywhere; }
.card-footer { display: grid; grid-template-columns: 1fr; gap: 7px; align-items: stretch; min-width: 0; }
.card-primary-actions { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(86px, .55fr); gap: 6px; min-width: 0; }
.card-primary-actions .btn { width: 100%; min-width: 0; padding-left: 7px; padding-right: 7px; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.card-actions.secondary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-actions .btn { width: 100%; min-width: 0; justify-content: center; overflow: hidden; padding-left: 6px; padding-right: 6px; text-overflow: ellipsis; white-space: nowrap; }
.card-actions .danger-action { grid-column: auto; }
.view-more { font-weight: 900; }
.mini-select { width: 100%; min-width: 0; min-height: 30px; padding: 5px 7px; font-size: 12px; }
.ticket-type, .deadline-pill, .equipment-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.ticket-type.repair { background: rgba(37,99,235,.12); color: #bfdbfe; border: 1px solid rgba(37,99,235,.24); }
.ticket-type.order { background: rgba(109,40,217,.16); color: #ddd6fe; border: 1px solid rgba(109,40,217,.28); }
.deadline-pill { background: rgba(251,191,36,.12); color: #f8d47b; border: 1px solid rgba(251,191,36,.28); }
.deadline-pill.overdue { background: rgba(220,38,38,.18); color: #ffb4c0; border-color: rgba(220,38,38,.32); }
.deadline-pill.review { background: rgba(25,217,140,.12); color: #9ff4cb; border-color: rgba(25,217,140,.25); }
.deadline-pill.review-pending { background: rgba(32,217,242,.13); color: #99f5ff; border-color: rgba(32,217,242,.28); }
.equipment-tag { flex: 0 0 auto; background: rgba(251,191,36,.16); color: #ffd38a; border: 1px solid rgba(251,191,36,.24); max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.alert-dot {
  width: 32px;
  min-height: 30px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 999px;
  background: rgba(148,163,184,.12);
  color: var(--muted);
  font-weight: 950;
}
.alert-dot.danger { background: rgba(220,38,38,.18); border-color: rgba(220,38,38,.38); color: #ffb4c0; }
.kanban-check, .kanban-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  font-weight: 850;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.form-grid .wide, .wide { grid-column: 1 / -1; }
.line-row { display: grid; grid-template-columns: minmax(170px, 1fr) 66px 88px 72px 36px; gap: 7px; margin-bottom: 7px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .52); padding: 18px; display: grid; place-items: center; }
.modal { width: min(1180px, 100%); max-height: min(880px, calc(100vh - 36px)); overflow: auto; background: #fff; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 26px 80px rgba(15, 23, 42, .28); padding: 16px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: 0; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 12px; align-items: start; }
.detail-grid.compact { grid-template-columns: minmax(0, 1fr) 320px; }
.detail-main, .detail-side { min-width: 0; }
.detail-side { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.two-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mini-list { display: grid; gap: 7px; margin-bottom: 12px; }
.mini-item { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 9px; text-align: left; display: grid; gap: 5px; }
.mini-item strong { font-size: 13px; }
.mini-item span { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.relation-box { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.relation-box p { margin: 6px 0; color: var(--muted); }
.timeline { display: grid; gap: 8px; margin-bottom: 10px; }
.event { border-left: 3px solid #cbd5e1; padding: 0 0 0 10px; }
.event span { color: var(--muted); font-size: 11px; font-weight: 750; }
.event strong { display: block; font-size: 12px; margin-top: 2px; }
.event p { margin: 3px 0 0; color: #334155; font-size: 13px; }
.support-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.support-column { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 340px; }
.support-column header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.support-column h4 { margin: 0; font-size: 13px; }
.support-column header span { min-width: 24px; min-height: 22px; display: grid; place-items: center; border-radius: 7px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 850; }
.support-card { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 10px; text-align: left; display: grid; gap: 6px; }
.support-card strong { font-size: 13px; line-height: 1.3; }
.support-card small, .support-card p { color: var(--muted); margin: 0; font-size: 12px; line-height: 1.35; }
.event.admin { border-left-color: var(--blue); }
.event.client { border-left-color: var(--green); }
.mail-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.mail-folders { position: sticky; top: 74px; }
.mail-list { overflow-x: auto; }
.mail-message { display: grid; gap: 12px; }
.mail-frame { width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.mini-item.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.empty { border: 1px dashed #cbd5e1; border-radius: 8px; color: var(--muted); padding: 11px; font-size: 13px; text-align: center; }
.alert { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

#noticeRoot { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; }
.notice { border-radius: 8px; padding: 10px 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-weight: 750; }
.notice.error { background: var(--red); }

@media (max-width: 1180px) {
  .workspace, .accounting-workspace, .mailing-workspace, .admin-workspace, .support-workspace, .dashboard-workspace, .mail-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; max-height: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; display: block; padding: 10px; min-height: 0; height: auto; }
  .brand-sidebar { display: none; }
  .nav { display: flex; gap: 6px; overflow-x: auto; }
  .nav-section { display: contents; }
  .nav-section > span, .sidebar-footer { display: none; }
  .nav button { flex: 0 0 auto; min-height: 34px; padding: 0 10px; }
  .topbar { min-height: 54px; padding: 0 12px; }
  .topbar h2 { font-size: 16px; }
  .userbar .muted { display: none; }
  .content { padding: 12px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .summary-grid, .detail-grid, .detail-grid.compact, .two-lists, .form-grid { grid-template-columns: 1fr; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .toolbar { justify-content: stretch; }
  .toolbar .btn, .toolbar .search { width: 100%; }
  .kanban { grid-template-columns: repeat(4, minmax(250px, 82vw)); }
  .support-board { grid-template-columns: repeat(4, minmax(250px, 82vw)); }
  .kanban-column { min-height: 330px; }
  .line-row { grid-template-columns: 1fr 60px 80px 66px 36px; }
  table { min-width: 640px; }
  .panel, .detail-main { overflow-x: auto; }
  .modal-backdrop { padding: 10px; align-items: stretch; }
  .modal { max-height: calc(100vh - 20px); padding: 12px; }
  .modal-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 520px) {
  .line-row { grid-template-columns: 1fr 54px 72px 60px 34px; gap: 5px; }
  .line-row input { padding-left: 7px; padding-right: 7px; }
  .card-footer { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; align-items: flex-start; padding: 10px 12px; }
  .actions-row .btn, .link-grid .btn { width: 100%; }
  .stat strong { font-size: 20px; }
}

/* Atelier Electro high-tech direction */
:root {
  --bg: #060a12;
  --panel: #0e1624;
  --panel-soft: #111d2e;
  --text: #edf5ff;
  --muted: #91a0b8;
  --border: #213149;
  --ink: #21d7ef;
  --cyan: #20d9f2;
  --pink: #ef4bd8;
  --green: #19d98c;
  --blue: #4b8dff;
  --amber: #f6b23d;
  --red: #ff5c78;
  --violet: #b86cff;
  --shadow: 0 18px 55px rgba(0, 0, 0, .35);
}

body {
  background:
    linear-gradient(rgba(32, 217, 242, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 217, 242, .04) 1px, transparent 1px),
    radial-gradient(circle at 70% 20%, rgba(32, 217, 242, .12), transparent 36%),
    #060a12;
  background-size: 58px 58px, 58px 58px, auto, auto;
  color: var(--text);
}

.public-home { min-height: 100vh; color: var(--text); overflow: hidden; }
.public-strip {
  min-height: 42px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(90deg, #9b2cff, #22d8f4);
  color: #07101d;
  font-weight: 850;
}
.public-strip span { font-weight: 650; }
.public-nav {
  max-width: 1760px;
  margin: 0 auto;
  min-height: 88px;
  padding: 0 7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(5, 9, 17, .78);
  border-bottom: 1px solid rgba(32, 217, 242, .1);
}
.public-brand { display: flex; align-items: center; gap: 14px; }
.public-brand > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}
.public-brand strong { display: block; font-size: 19px; }
.public-brand small { color: var(--cyan); font-size: 11px; font-weight: 850; }
.public-nav nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.public-nav a { color: #b8c2d5; text-decoration: none; font-weight: 750; }
.public-nav a:hover { color: var(--cyan); }
.public-hero {
  max-width: 1760px;
  margin: 0 auto;
  padding: 52px 7vw 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 660px);
  gap: 56px;
  align-items: center;
}
.public-kicker {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 26px;
}
.public-copy h1 {
  margin: 0;
  max-width: 880px;
  font-size: 68px;
  line-height: 1.07;
}
.public-copy h1 span {
  display: block;
  color: #8cf7ff;
}
.public-copy p {
  max-width: 760px;
  margin: 28px 0 0;
  color: #c8d2e2;
  font-size: 22px;
  line-height: 1.55;
}
.public-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.public-metrics {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 42px;
  padding-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.public-metrics div { display: grid; gap: 7px; }
.public-metrics strong { color: var(--cyan); font-size: 24px; }
.public-metrics span { color: var(--muted); font-size: 13px; font-weight: 750; }
.public-contact {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto 34px;
  border: 1px solid rgba(32,217,242,.14);
  border-radius: 8px;
  background: rgba(14,22,36,.72);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding: 16px;
  font-size: 13px;
}
.public-contact strong { color: #f4f8ff; }
.public-diagnostic { position: relative; }
.diag-badge {
  position: absolute;
  right: 28px;
  top: -26px;
  z-index: 2;
  border: 1px solid rgba(32, 217, 242, .25);
  border-radius: 8px;
  background: #0d1626;
  color: #eaf7ff;
  padding: 16px 20px;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.diag-card {
  min-height: 640px;
  border: 1px solid rgba(32, 217, 242, .22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 29, 46, .92), rgba(8, 13, 24, .96));
  box-shadow: inset 0 0 55px rgba(32, 217, 242, .07), var(--shadow);
  padding: 38px;
  display: grid;
  align-content: start;
  gap: 22px;
}
.diag-status { color: var(--muted); font-weight: 850; font-size: 12px; }
.diag-status span {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}
.diag-card h2 { margin: 0; font-size: 24px; }
.diag-card p { color: #b9c5d7; line-height: 1.55; margin: 0; }
.public-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 14px;
}
.public-tabs button {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: #aab6c9;
  font-weight: 900;
}
.public-tabs button.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #06101c;
  box-shadow: 0 0 22px rgba(32,217,242,.24);
}
.public-form { margin-top: 4px; }
.msg.error { color: var(--red); }

.app { background: rgba(6, 10, 18, .78); }
.sidebar {
  background: #080f1d;
  border-right: 1px solid rgba(32,217,242,.12);
  box-shadow: 18px 0 55px rgba(0,0,0,.24);
}
.brand-sidebar { border-bottom-color: rgba(32,217,242,.14); }
.brand-sidebar h1 { color: #f7fbff; }
.brand-sidebar p { color: var(--cyan); }
.nav-section > span { color: #65758f; }
.nav button { color: #b7c2d5; }
.nav button.active, .nav button:hover {
  background: rgba(32,217,242,.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--cyan);
}
.sidebar-link { border-color: rgba(32,217,242,.18); }
.main { background: rgba(7, 11, 20, .72); }
.topbar, .app-footer {
  background: rgba(9, 15, 27, .94);
  border-color: var(--border);
}
.app-footer { justify-content: center; text-align: center; flex-wrap: wrap; }
.content { background: transparent; }
.panel, .stat, .detail-side, .mini-item, .relation-box, .support-card, .mail-frame {
  background: rgba(14, 22, 36, .94);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 16px 45px rgba(0,0,0,.18);
}
.panel h3, .detail-main h3, .detail-side h3, .panel h4 { color: #f4f8ff; }
.field label, .check { color: #b9c5d7; }
.field input, .field textarea, .field select, .search, .inline-form input, .mini-select {
  background: #08111f;
  color: var(--text);
  border-color: #263852;
}
.field input:focus, .field textarea:focus, .field select:focus, .search:focus, .inline-form input:focus, .mini-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(32,217,242,.16);
}
.btn {
  background: #0b1526;
  color: #e8f1ff;
  border-color: #2a3b55;
}
.btn:hover { border-color: rgba(32,217,242,.55); }
.btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05101d;
  box-shadow: 0 0 22px rgba(32,217,242,.2);
}
.btn.green { background: var(--green); border-color: var(--green); color: #04130d; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: #dce8f7; }
.muted, .mini-item span, .relation-box p, .event span { color: var(--muted); }
.stat { min-height: 86px; }
.stat span { color: var(--muted); }
.stat strong { color: #f8fbff; }
th { color: #9fb0c8; border-bottom-color: var(--border); }
td { border-bottom-color: rgba(255,255,255,.07); }
tr:hover td { background: rgba(32,217,242,.05); }
.empty {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.12);
  color: var(--muted);
}
.empty.compact { padding: 8px; text-align: left; }
.alert {
  background: rgba(246,178,61,.1);
  border-color: rgba(246,178,61,.35);
  color: #ffd89a;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.tickets-workspace, .docs-workspace { margin-top: 0; }
.kanban-tools { justify-content: space-between; }
.kanban {
  grid-template-columns: repeat(4, minmax(278px, 1fr));
  gap: 12px;
  padding-bottom: 10px;
}
.kanban-column {
  background: rgba(9, 17, 30, .96);
  border-color: rgba(32,217,242,.12);
  min-height: 510px;
}
.kanban-column header { border-bottom-color: rgba(32,217,242,.12); }
.kanban-column header span {
  background: rgba(32,217,242,.12);
  color: var(--cyan);
}
.kanban-card {
  background: #0d1728;
  border-color: #253852;
  border-left-color: var(--cyan);
  color: var(--text);
}
.kanban-card.priority-high { border-left-color: var(--amber); }
.kanban-card.priority-urgent { border-left-color: var(--red); }
.kanban-card.priority-low { border-left-color: var(--green); }
.kanban-card.type-order { border-left-color: var(--violet); }
.card-footer { grid-template-columns: 1fr; }
.modal-backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(9px); }
.modal {
  background: #0b1322;
  border-color: rgba(32,217,242,.22);
  color: var(--text);
  box-shadow: 0 32px 100px rgba(0,0,0,.58);
}
.modal-head { border-bottom-color: var(--border); }
.eyebrow { color: var(--cyan); }
.document-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.client-picker { position: relative; }
.selected-client {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(32,217,242,.18);
  background: rgba(32,217,242,.06);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
}
.selected-client.empty { color: var(--muted); border-style: dashed; background: rgba(255,255,255,.03); }
.selected-client span { color: var(--muted); font-size: 12px; }
.client-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.client-result {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid #263852;
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 10px;
}
.client-result:hover { border-color: var(--cyan); }
.client-result span { color: var(--muted); font-size: 12px; }
.client-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inline-create {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(32,217,242,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
}
.pill.new, .pill.draft { background: rgba(75,141,255,.16); color: #9cc2ff; border-color: rgba(75,141,255,.3); }
.pill.diagnostic, .pill.sent { background: rgba(246,178,61,.16); color: #ffd28c; border-color: rgba(246,178,61,.32); }
.pill.waiting_client, .pill.waiting_part, .pill.overdue { background: rgba(255,92,120,.14); color: #ff9aac; border-color: rgba(255,92,120,.28); }
.pill.repairing, .pill.accepted { background: rgba(184,108,255,.16); color: #d5b5ff; border-color: rgba(184,108,255,.3); }
.pill.ready, .pill.paid { background: rgba(25,217,140,.14); color: #7ff0bd; border-color: rgba(25,217,140,.28); }
.pill.delivered, .pill.cancelled, .pill.refused, .pill.expired { background: rgba(145,160,184,.14); color: #c9d3e2; border-color: rgba(145,160,184,.25); }

@media (max-width: 1180px) {
  .public-hero { grid-template-columns: 1fr; }
  .public-copy h1 { font-size: 52px; }
  .diag-card { min-height: 0; }
  .document-modal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .public-strip { align-items: flex-start; flex-direction: column; padding: 9px 14px; gap: 2px; }
  .public-nav { padding: 14px; min-height: auto; align-items: flex-start; flex-direction: column; }
  .public-nav nav { justify-content: flex-start; gap: 10px; }
  .public-hero { padding: 30px 14px 38px; gap: 34px; }
  .public-copy h1 { font-size: 42px; }
  .public-copy p { font-size: 18px; }
  .public-metrics { grid-template-columns: 1fr; }
  .diag-badge { position: static; display: inline-flex; margin-bottom: 10px; }
  .diag-card { padding: 20px; }
  .mini-stats { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, minmax(270px, 84vw)); }
  .card-footer { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .public-copy h1 { font-size: 34px; }
  .public-tabs { grid-template-columns: 1fr; }
  .public-actions .btn, .public-nav .btn { width: 100%; }
  .diag-card { padding: 16px; }
  .line-row { grid-template-columns: 1fr; }
}
