:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1e3a5f;
  --accent-2: #c45c26;
  --accent-soft: #e8eef5;
  --success: #15803d;
  --danger: #b91c1c;
  --warning: #b45309;
  --sidebar-w: 240px;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: "Manrope", "Segoe UI", sans-serif;
  --field-h: 40px;
  --field-px: 12px;
  --field-py: 9px;
  --field-fs: 14px;
  --field-bg: #fff;
  --field-border: #d0d7e2;
  --field-focus: rgba(30, 58, 95, .28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

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

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #132337 0%, #1e3a5f 55%, #243b55 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .2s ease;
}
.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
}
.brand-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.nav { padding: 14px 10px; overflow-y: auto; flex: 1; }
.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: 12px 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav a.active { background: rgba(196, 92, 38, .25); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.search-dummy {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  min-width: 220px;
}
.user-menu { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user-menu form { display: inline; margin: 0; }

.content { padding: 24px 24px 56px; }

.sys-footer {
  position: sticky;
  bottom: 0;
  z-index: 18;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 8px 24px;
  background: #132337;
  color: #cbd5e1;
  font-size: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sys-item { display: flex; align-items: baseline; gap: 8px; }
.sys-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  font-weight: 700;
}
.sys-value { color: #e2e8f0; font-variant-numeric: tabular-nums; }
.sys-item[data-level="warn"] .sys-value { color: #fbbf24; }
.sys-item[data-level="danger"] .sys-value { color: #fb7185; }
.sys-time { margin-left: auto; color: #64748b; font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .sys-footer { padding: 8px 12px; font-size: 11px; }
  .sys-time { width: 100%; margin-left: 0; }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-header-actions,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  min-height: var(--field-h);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
  background: var(--accent);
  color: #fff;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-accent { background: var(--accent-2); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
}
table.data tr:hover td { background: #fafbfc; }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid > div { min-width: 0; }

/* Labels */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
  line-height: 1.3;
}
label > :is(input, select, textarea) {
  margin-top: 6px;
}
label.check,
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
label.check > input,
label.inline > input {
  margin-top: 0;
  width: auto;
}

/* Unified controls */
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="month"],
input[type="week"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--field-h);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  padding: var(--field-py) var(--field-px);
  font-family: var(--font);
  font-size: var(--field-fs);
  font-weight: 500;
  line-height: 1.35;
  background: var(--field-bg);
  color: var(--text);
  box-shadow: none;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
input:not([type]):hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="time"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="month"]:hover,
input[type="week"]:hover,
select:hover,
textarea:hover {
  border-color: #b6c0ce;
}
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--field-focus);
  background: #fff;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .85;
}
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  font-weight: 450;
}

/* Date / time: keep height consistent across browsers */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"] {
  min-height: var(--field-h);
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: .55;
  cursor: pointer;
}

/* File */
input[type="file"] {
  display: block;
  width: 100%;
  min-height: var(--field-h);
  padding: 8px 10px;
  border: 1px dashed var(--field-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
input[type="file"]:hover { border-color: #b6c0ce; background: #fff; }
input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--field-focus);
}

/* Checkbox / radio */
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: auto;
  appearance: auto;
}

/* Compact / inline toolbars (filters, headers) */
.filters,
.form-inline,
.page-header form,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters { margin-bottom: 12px; }
.filters > :is(input, select),
.form-inline > :is(input, select),
.page-header form > :is(input, select),
.toolbar > :is(input, select) {
  width: auto;
  min-width: 160px;
  max-width: 100%;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.field-row > :is(input, select, textarea) {
  width: auto;
  min-width: 0;
  flex: 1 1 160px;
}
.field-row > .btn { flex: 0 0 auto; }
.field-row > input[type="checkbox"],
.field-row > input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
}

.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; align-items: center; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-paid, .badge-done, .badge-won, .badge-active, .badge-completed { background: #dcfce7; color: #166534; }
.badge-lost, .badge-cancelled, .badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-draft, .badge-new { background: #f1f5f9; color: #475569; }
.badge-partial, .badge-in_progress, .badge-review { background: #ffedd5; color: #9a3412; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent-2); }

.kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 20px;
  align-items: stretch;
  min-height: calc(100vh - 180px);
  scroll-snap-type: x proximity;
}
.kanban-col {
  flex: 0 0 290px;
  width: 290px;
  background: linear-gradient(180deg, #e8eef5 0%, #eef2f6 100%);
  border-radius: 12px;
  border: 1px solid #dbe3ec;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 170px);
  scroll-snap-align: start;
  transition: background .15s ease, box-shadow .15s ease;
}
.kanban-col.is-over {
  background: #e2ebf5;
  box-shadow: inset 0 0 0 2px rgba(30, 58, 95, .25);
}
.kanban-col-head {
  padding: 12px 12px 10px;
  border-top: 3px solid #94a3b8;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.kanban-col-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}
.kanban-col-sum {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.kanban-col-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kanban-col-body {
  padding: 0 10px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}
.kanban-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 12px 18px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
  user-select: none;
}
.kanban-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging {
  opacity: .45;
  transform: rotate(1.5deg) scale(.98);
}
.kanban-card.is-drop-target {
  box-shadow: 0 0 0 2px rgba(196, 92, 38, .35);
}
.kanban-card-drag {
  position: absolute;
  left: 6px;
  top: 14px;
  width: 6px;
  height: 18px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    to bottom,
    #94a3b8 0 2px,
    transparent 2px 4px
  );
  opacity: .7;
}
.kanban-card-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
.kanban-card-title:hover { color: var(--accent-2); text-decoration: none; }
.kanban-card .amount { font-weight: 800; font-size: 13px; color: var(--accent); }
.kanban-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.kanban-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.kanban-placeholder {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  background: rgba(255,255,255,.55);
  margin-bottom: 8px;
  pointer-events: none;
}

/* Drawer / modal panel (amoCRM-like) */
.drawer-root[hidden] { display: none !important; }
.drawer-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s ease;
}
.drawer-root.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: relative;
  width: min(720px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
  display: flex;
  flex-direction: column;
  transform: translateX(24px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.drawer-root.is-open .drawer-panel {
  transform: translateX(0);
  opacity: 1;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc, #fff);
  flex-shrink: 0;
}
.drawer-head-actions { display: flex; gap: 8px; align-items: center; }
.drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}
.drawer-close:hover { color: var(--text); border-color: #cbd5e1; }
.drawer-body {
  overflow: auto;
  padding: 18px 20px 32px;
  flex: 1;
  background:
    radial-gradient(ellipse at top right, rgba(30,58,95,.04), transparent 40%),
    #fff;
}
.drawer-body.is-loading {
  opacity: .55;
  pointer-events: none;
}
.drawer-loading {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.panel-title-row h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}
.panel-title-row .amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.panel-grid .card { margin-bottom: 0; }
.panel-entity .card { box-shadow: none; }

body.drawer-open { overflow: hidden; }

@media (max-width: 700px) {
  .drawer-panel { width: 100%; }
  .kanban-col { flex-basis: 260px; width: 260px; }
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  padding: 10px 0 10px 14px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
  position: relative;
}
.timeline li::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent-2);
  border-radius: 50%;
  position: absolute;
  left: -5px; top: 16px;
}
.timeline .when { font-size: 12px; color: var(--muted); }

.empty { color: var(--muted); padding: 24px; text-align: center; }

/* Browser / in-app notifications */
.notify-wrap { position: relative; }
.notify-bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.notify-bell:hover { border-color: #cbd5e1; background: #f8fafc; }
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notify-badge[hidden] { display: none !important; }
.notify-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
}
.notify-dropdown[hidden] { display: none !important; }
.notify-dropdown-head,
.notify-dropdown-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.notify-dropdown-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  justify-content: center;
}
.notify-dropdown-list {
  max-height: 360px;
  overflow: auto;
}
.notify-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.notify-item:hover { background: #f8fafc; text-decoration: none; }
.notify-item.is-unread { background: #f3f7fb; }
.notify-item-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.notify-item-body { font-size: 12px; color: var(--muted); }
.notify-item-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.notify-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.notify-permission {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.notify-permission[hidden] { display: none !important; }
.notify-permission-inner {
  pointer-events: auto;
  width: min(640px, 100%);
  background: #132337;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .35);
}
.notify-permission-inner p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}
.notify-permission-actions { display: flex; gap: 8px; flex-shrink: 0; }
.notify-permission-actions .btn { white-space: nowrap; }

@media (max-width: 700px) {
  .notify-permission-inner { flex-direction: column; align-items: stretch; }
  .notify-permission-actions { width: 100%; }
  .notify-permission-actions .btn { flex: 1; }
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(30,58,95,.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(196,92,38,.15), transparent 45%),
    linear-gradient(160deg, #f8fafc, #e8eef5 50%, #f4f6f8);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.search-form { flex: 1; max-width: 420px; }
.search-form input { width: 100%; height: 36px; border-radius: 8px; border: 1px solid var(--border); padding: 0 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { font-size: 26px; font-weight: 800; }
.kpi-accent { background: linear-gradient(160deg, #1e3a5f, #132337); color: #fff; }
.kpi-accent span { color: #94a3b8; }
.deal-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.deal-hero h1 { margin: 0 0 6px; }
.deal-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.deal-kpis > div { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.deal-kpis span { display: block; font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 12px; color: var(--muted); white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent-2); font-weight: 700; }
.point-block { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.check-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gallery img, .gallery video { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.timeline-item audio { width: 100%; margin-top: 8px; }
.profit-card .profit-total { font-size: 22px; font-weight: 800; }
.suggest-box { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px; max-height: 240px; overflow: auto; box-shadow: var(--shadow); }
.suggest-box button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; cursor: pointer; }
.suggest-box button:hover { background: var(--accent-soft); }

@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .search-dummy { display: none; }
  .search-form { max-width: none; }
  .content { padding: 16px; }
  .deal-kpis { grid-template-columns: 1fr 1fr; }
  .tabs { scrollbar-width: none; }
}
