/* ========================================================================
   Bewerbo PDF Generator — Dashboard UI
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Pacifico&display=swap');

:root {
  /* ---- Цвета эталонного макета ---------- */
  --bg-deep:       #2b342a;
  --bg-deeper:     #222a21;
  --card-ivory:    #f4f1e8;
  --card-white:    #ffffff;
  --card-muted:    #ecebe1;
  --accent-dark:   #3e4a3a;
  --accent-deep:   #2e3a2a;
  --accent-soft:   #e8ecdc;
  --accent-lime:   #a3c47a;
  --accent-lime-2: #7fa858;
  --text-dark:     #1f2b1e;
  --text-muted:    #6b7562;
  --text-soft:     #98a08e;
  --border-line:   #dcd8c8;
  --danger:        #c75a4a;

  --shadow-sm: 0 1px 2px rgba(30,40,25,0.06);
  --shadow-md: 0 4px 14px rgba(30,40,25,0.08);
  --shadow-lg: 0 18px 40px rgba(20,30,15,0.18);

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 26px;

  --sidebar-w-collapsed: 72px;
  --sidebar-w-expanded:  220px;

  --font-brand: 'Pacifico', 'Brush Script MT', cursive;
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* ============================== Layout ============================== */

.app {
  padding: 18px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
  gap: 18px;
  transition: grid-template-columns .25s ease;
}
body.sidebar-expanded .app {
  grid-template-columns: var(--sidebar-w-expanded) 1fr;
}

/* ----------------------- Sidebar ----------------------- */

.sidebar {
  background: var(--card-ivory);
  border-radius: var(--r-lg);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  position: relative;
  overflow: visible;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid transparent;
}
.sidebar .brand-mark {
  width: 44px; height: 44px;
  background: var(--accent-dark);
  color: var(--accent-lime);
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-brand);
  font-size: 28px;
  line-height: 1;
  padding-bottom: 3px;
  flex: 0 0 44px;
  box-shadow: var(--shadow-sm);
}
.sidebar .brand-name {
  font-family: var(--font-brand);
  font-size: 24px;
  color: var(--accent-dark);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  width: 0;
  transition: opacity .2s, width .2s;
}
body.sidebar-expanded .sidebar .brand-name {
  opacity: 1;
  width: auto;
}

.sidebar-toggle {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  width: 100%;
  color: var(--text-muted);
}
.sidebar-toggle .toggle-icon {
  transition: transform .2s ease;
}
body.sidebar-expanded .sidebar-toggle .toggle-icon {
  transform: rotate(180deg);
}

.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .nav-sep {
  height: 1px;
  background: var(--border-line);
  margin: 10px 6px;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar .nav-item .ico {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
}
.sidebar .nav-item .ico svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar .nav-item .label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
body.sidebar-expanded .sidebar .nav-item .label {
  opacity: 1;
  pointer-events: auto;
}
.sidebar .nav-item:hover { background: var(--accent-soft); color: var(--accent-dark); }
.sidebar .nav-item.active {
  background: var(--accent-dark);
  color: var(--card-ivory);
}

.sidebar .bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-line);
}

/* ----------------------- Main ----------------------- */

.main {
  background: var(--card-ivory);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 36px);
  overflow: hidden;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.top-left .brand-inline {
  font-family: var(--font-brand);
  font-size: 28px;
  color: var(--accent-dark);
  line-height: 1;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--border-line);
}
.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-dark);
}
.topbar .search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.topbar .search input {
  width: 100%;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  padding: 10px 14px 10px 38px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dark);
  outline: none;
  transition: border .15s;
}
.topbar .search input:focus { border-color: var(--accent-lime-2); }
.topbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--text-muted); }

.topbar .pills { display: flex; gap: 8px; align-items: center; }

/* Lang switcher */
.lang-switch {
  display: inline-flex;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch .lang-btn {
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  height: 28px;
  min-width: 38px;
  border-radius: 999px;
  padding: 0 10px;
  letter-spacing: 0.5px;
  transition: background .15s, color .15s;
}
.lang-switch .lang-btn[aria-pressed="true"] {
  background: var(--accent-dark);
  color: var(--card-ivory);
}

/* Bell */
.bell-wrap, .profile-wrap { position: relative; }
.topbar .pill-btn {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
}
.topbar .pill-btn .dot {
  width: 8px; height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
  position: absolute; top: 8px; right: 8px;
  box-shadow: 0 0 0 2px var(--card-white);
}
.topbar .pill-btn .badge-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  display: grid; place-items: center;
  border: 2px solid var(--card-ivory);
}

/* Profile */
.topbar .profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.topbar .profile:hover { background: var(--card-ivory); }
.topbar .profile .avatars { display: inline-flex; align-items: center; }
.avatar-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--card-white);
  margin-left: -8px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 11px;
  display: grid; place-items: center;
}
.avatar-circle:first-child { margin-left: 0; }
.topbar .profile .name { font-weight: 600; font-size: 13px; color: var(--text-dark); }
.topbar .profile .chev { color: var(--text-muted); width: 14px; }

/* Popovers */
.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: 360px;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  animation: popIn .14s ease-out;
}
.popover[hidden] { display: none; }
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.popover-header .link-btn {
  border: 0;
  background: transparent;
  color: var(--accent-lime-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 4px 6px;
  border-radius: 6px;
}
.popover-header .link-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }

.popover-body {
  max-height: 380px;
  overflow-y: auto;
}
.popover-body::-webkit-scrollbar { width: 6px; }
.popover-body::-webkit-scrollbar-thumb { background: var(--border-line); border-radius: 3px; }
.popover-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Notification item */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-muted);
  cursor: default;
  position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: rgba(163,196,122,.08); }
.notif-item .notif-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-item .notif-content { flex: 1; min-width: 0; }
.notif-item .notif-title { font-weight: 600; font-size: 13px; color: var(--text-dark); }
.notif-item .notif-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.notif-item .notif-time { font-size: 11px; color: var(--text-soft); margin-top: 4px; }
.notif-item .unread-mark {
  position: absolute;
  top: 14px; right: 12px;
  width: 8px; height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
}

/* User popover */
.user-popover { min-width: 240px; }
.user-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  border-bottom: 1px solid var(--card-muted);
}
.user-item:last-child { border-bottom: 0; }
.user-item:hover:not(:disabled) { background: var(--card-ivory); }
.user-item:disabled { cursor: default; }
.user-item.active { background: var(--accent-soft); }
.user-item .name { font-weight: 600; font-size: 13px; color: var(--text-dark); flex: 1; display: flex; align-items: center; gap: 6px; }
.user-item .user-badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
}
.user-item .check { color: var(--accent-lime-2); }
.user-item .check[hidden] { display: none; }
.user-item.user-logout {
  color: var(--danger);
  border-top: 1px solid var(--card-muted);
  margin-top: 0;
}
.user-item.user-logout .ico {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 16px; line-height: 1;
}
.user-item.user-logout:hover { background: rgba(199,90,74,.08); }

.profile.viewing-as {
  border-color: var(--accent-lime-2);
  box-shadow: 0 0 0 2px rgba(127,168,88,.18);
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--card-white);
  border-radius: var(--r-md);
  padding: 14px 16px;
  border: 1px solid var(--border-line);
}
.kpi .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.kpi .value { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.kpi .trend { font-size: 11px; color: var(--accent-lime-2); margin-top: 2px; }
.kpi .trend.down { color: #c37a4a; }

/* Pages */
.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
}
.page[hidden] { display: none; }
.placeholder-block {
  margin-top: 14px;
  padding: 40px;
  border: 2px dashed var(--border-line);
  border-radius: var(--r-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--card-ivory);
}

/* Content grid */
.content {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left column */
.panel {
  background: var(--card-white);
  border: 1px solid var(--border-line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.panel h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.panel .sub { font-size: 12px; color: var(--text-muted); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #414b3a 0%, #2b342a 100%);
  color: var(--card-ivory);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(163,196,122,.25), transparent 70%);
  border-radius: 50%;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 999px;
}
.hero .badge .dot { width: 6px; height: 6px; background: var(--accent-lime); border-radius: 50%; animation: pulse 1.5s infinite; }
.hero h3 { font-size: 20px; font-weight: 700; margin-top: 12px; }
.hero .hero-caption { font-size: 12px; opacity: .8; margin-top: 4px; max-width: 70%; }
.hero .hero-actions { display: flex; gap: 8px; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: .5; }
}

/* AI чат */
.ai-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ai-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--card-ivory);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  max-height: 320px;
}
.ai-messages::-webkit-scrollbar { width: 6px; }
.ai-messages::-webkit-scrollbar-thumb { background: var(--border-line); border-radius: 3px; }

.msg {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 82%;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}
.msg.user { align-self: flex-end; background: var(--accent-dark); color: var(--card-ivory); border-bottom-right-radius: 4px; }
.msg.ai   { align-self: flex-start; background: var(--card-white); border: 1px solid var(--border-line); border-bottom-left-radius: 4px; }
.msg a { color: var(--accent-lime-2); font-weight: 600; border-bottom: 1px dashed; }
.msg .tool-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
}

.ai-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--card-ivory);
  border-radius: 18px;
  padding: 6px 6px 6px 14px;
  flex-shrink: 0;
  max-height: 150px;
  overflow: hidden;
}
.ai-input textarea,
.ai-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-dark);
  font-family: inherit;
  resize: none;
  line-height: 1.4;
  padding: 10px 0;
  max-height: 120px;
  overflow-y: auto;
  box-sizing: border-box;
}
.ai-input textarea { width: 100%; }
.ai-input textarea::-webkit-scrollbar { width: 5px; }
.ai-input textarea::-webkit-scrollbar-thumb { background: var(--border-line); border-radius: 3px; }
.ai-input .send {
  background: var(--accent-dark);
  color: var(--card-ivory);
  border: 0;
  height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s;
}
.ai-input .send:hover { transform: translateY(-1px); }
.ai-input .send:disabled { opacity: .6; cursor: wait; }

/* Right column: список шаблонов */
.right-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.templates-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; }
.templates-list::-webkit-scrollbar { width: 6px; }
.templates-list::-webkit-scrollbar-thumb { background: var(--border-line); border-radius: 3px; }

.tpl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-white);
  border: 1px solid var(--border-line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tpl-item:hover { background: var(--card-ivory); border-color: var(--accent-lime-2); }
.tpl-item.active { border-color: var(--accent-dark); background: var(--card-ivory); }

.tpl-item .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid; place-items: center;
  font-size: 18px;
}
.tpl-item .meta { flex: 1; }
.tpl-item .meta .name { font-weight: 700; font-size: 13px; }
.tpl-item .meta .desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tpl-item .count {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.tpl-item .chev { color: var(--text-muted); }
.tpl-item.active .icon { background: var(--accent-dark); color: var(--accent-lime); }

.add-btn {
  margin-top: auto;
  background: var(--accent-dark);
  color: var(--card-ivory);
  border: 0;
  padding: 14px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background .15s;
}
.add-btn:hover { background: var(--accent-deep); }

.add-btn.ghost {
  background: var(--card-white);
  color: var(--accent-dark);
  border: 1.5px dashed var(--accent-dark);
  margin-top: 0;
}
.add-btn.ghost:hover { background: var(--accent-soft); }
.add-btn.ghost.drag {
  background: var(--accent-soft);
  border-style: solid;
  border-color: var(--accent-lime-2);
  transform: scale(1.02);
}

/* =================== Modal =================== */
.modal-root {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-root[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(43, 52, 42, 0.52);
  backdrop-filter: blur(3px);
  animation: fadeIn .12s ease-out;
}
.modal {
  position: relative;
  width: 460px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--card-ivory);
  border: 1px solid var(--border-line);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  animation: popIn .16s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn  { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 6px;
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}
.modal-x {
  width: 30px; height: 30px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
}
.modal-x:hover { background: rgba(0,0,0,.05); color: var(--text-dark); }

.modal-body {
  padding: 8px 24px 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-body .field { display: flex; flex-direction: column; gap: 6px; }
.modal-body .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-body .field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input:not([type]) {
  width: 100%;
  border: 1.5px solid var(--border-line);
  border-radius: var(--r-md);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--card-white);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.modal-body input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(43, 52, 42, 0.10);
}

.radio-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.radio-tiles label {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-line);
  border-radius: var(--r-md);
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--card-white);
  cursor: pointer;
  text-align: center;
  transition: all .12s;
}
.radio-tiles input { position: absolute; opacity: 0; pointer-events: none; }
.radio-tiles label:hover { border-color: var(--accent-dark); }
.radio-tiles label:has(input:checked) {
  background: var(--accent-dark);
  color: var(--card-ivory);
  border-color: var(--accent-dark);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.btn-primary {
  background: var(--accent-dark);
  color: var(--card-ivory);
  border: 1.5px solid var(--accent-dark);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--text-dark);
  border: 1.5px solid var(--border-line);
}
.btn-secondary:hover { background: var(--card-white); border-color: var(--accent-dark); }

/* Drag-n-drop overlay */
.drop-overlay {
  position: fixed; inset: 0;
  background: rgba(43, 52, 42, 0.82);
  color: #f4f1e8;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 999;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.drop-overlay.show { display: flex; }
.drop-overlay .icon {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--accent-lime);
  display: grid; place-items: center;
  color: var(--accent-dark);
  font-size: 36px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.drop-overlay .hint { font-size: 18px; font-weight: 600; }
.drop-overlay .sub  { font-size: 13px; opacity: .75; }

/* Таблица */
.table-panel { grid-column: 1 / -1; }
.table-panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-panel th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-line);
}
.table-panel td {
  padding: 12px;
  border-bottom: 1px solid var(--border-line);
  color: var(--text-dark);
}
.table-panel tr:last-child td { border-bottom: 0; }
.table-panel tr:hover { background: var(--card-ivory); }

.badge-template {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.btn-sm {
  background: var(--accent-dark);
  color: var(--card-ivory);
  border: 0;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-sm:hover { background: var(--accent-deep); }
.btn-sm.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--border-line);
}
.btn-sm.ghost:hover { background: var(--accent-soft); }
.btn-sm.ghost.light {
  color: #f4f1e8;
  border-color: rgba(255,255,255,.25);
}
.btn-sm.ghost.light:hover { background: rgba(255,255,255,.08); }

/* Inline action buttons in applicants table */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: var(--card-white);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all .12s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-dark); }
.icon-btn-share:hover { background: var(--accent-soft); color: var(--accent-dark); }
.icon-btn-danger:hover { background: rgba(199,90,74,.10); color: var(--danger); border-color: var(--danger); }

/* Adaptive */
@media (max-width: 1100px) {
  .content { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .top-left .brand-inline { display: none; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; padding: 10px; }
  body.sidebar-expanded .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--accent-dark);
  color: var(--card-ivory);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all .2s;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8a3a33; }
