/* WebFull Care — Panel Design System */
/* Minimal light dashboard, Tailwind-inspired custom CSS */

:root {
  --brand: #2563eb;
  --brand-light: #eff6ff;
  --brand-dark: #1d4ed8;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green: #16a34a;
  --green-light: #dcfce7;
  --yellow: #d97706;
  --yellow-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --blue-light: #dbeafe;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.5;
}

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

/* ── Layout ──────────────────────────────────────────── */

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

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.content {
  flex: 1;
  padding: 28px 28px 48px;
  max-width: 1200px;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-100);
}

.sidebar__logo-icon {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}

.sidebar__nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar__section {
  padding: 6px 12px 2px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-top: 8px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 1px 8px;
  border-radius: 6px;
  color: var(--gray-600);
  font-size: .875rem;
  transition: background .12s, color .12s;
}

.sidebar__link:hover { background: var(--gray-50); color: var(--gray-900); text-decoration: none; }
.sidebar__link.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.sidebar__link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sidebar__link.active svg { opacity: 1; }

.sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid var(--gray-100);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
}

.user-block:hover { background: var(--gray-50); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-block__info { flex: 1; min-width: 0; }
.user-block__name { font-size: .8rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-block__role { font-size: .7rem; color: var(--gray-400); }

/* ── Topbar ──────────────────────────────────────────── */

.topbar__title { font-size: 1rem; font-weight: 600; color: var(--gray-800); }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

/* ── Page header ─────────────────────────────────────── */

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.375rem; font-weight: 700; color: var(--gray-900); }
.page-header__sub { font-size: .875rem; color: var(--gray-500); margin-top: 2px; }

/* ── Cards & Grid ────────────────────────────────────── */

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title { font-size: .875rem; font-weight: 600; color: var(--gray-700); }
.card__body { padding: 20px; }

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

/* ── Site cards ──────────────────────────────────────── */

.site-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s;
}

.site-card:hover { box-shadow: var(--shadow-md); }

.site-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.site-card__domain { font-weight: 600; font-size: .95rem; color: var(--gray-900); }
.site-card__meta { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--gray-500); }
.site-card__meta-row { display: flex; align-items: center; gap: 6px; }
.site-card__actions { margin-top: auto; }

/* ── Stats row ───────────────────────────────────────── */

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card__label { font-size: .75rem; font-weight: 500; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-card__value { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-top: 4px; }
.stat-card__sub { font-size: .75rem; color: var(--gray-400); margin-top: 2px; }

/* ── Table ───────────────────────────────────────────── */

.table-wrap {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header__title { font-size: .875rem; font-weight: 600; color: var(--gray-700); }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

tbody td {
  padding: 12px 16px;
  font-size: .875rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

/* ── Badges ──────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}

.badge--online { background: var(--green-light); color: var(--green); }
.badge--online::before { background: var(--green); }
.badge--warning { background: var(--yellow-light); color: var(--yellow); }
.badge--warning::before { background: var(--yellow); }
.badge--offline { background: var(--red-light); color: var(--red); }
.badge--offline::before { background: var(--red); }
.badge--maintenance { background: var(--gray-100); color: var(--gray-500); }
.badge--maintenance::before { background: var(--gray-400); }
.badge--new { background: var(--blue-light); color: var(--brand); }
.badge--new::before { background: var(--brand); }
.badge--closed { background: var(--gray-100); color: var(--gray-500); }
.badge--closed::before { background: var(--gray-400); }
.badge--info { background: var(--blue-light); color: var(--brand); }
.badge--info::before { background: var(--brand); }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none;
}

.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; color: #fff; }

.btn--secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn--secondary:hover { background: var(--gray-50); text-decoration: none; color: var(--gray-700); }

.btn--ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn--ghost:hover { background: var(--brand-light); text-decoration: none; }

.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }

.btn--sm { padding: 5px 10px; font-size: .8rem; }

/* ── Forms ───────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 500; color: var(--gray-700); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }

/* ── Alert ───────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: .875rem;
  margin-bottom: 16px;
}

.alert--warning { background: var(--yellow-light); color: #92400e; border: 1px solid #fcd34d; }
.alert--error { background: var(--red-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert--success { background: var(--green-light); color: #14532d; border: 1px solid #86efac; }
.alert--info { background: var(--blue-light); color: #1e40af; border: 1px solid #93c5fd; }

/* ── Progress bar ────────────────────────────────────── */

.progress-bar { background: var(--gray-200); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar__fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.progress-bar__fill--warn { background: var(--yellow); }
.progress-bar__fill--danger { background: var(--red); }

/* ── Detail header ───────────────────────────────────── */

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.detail-header__left { flex: 1; }
.detail-header__title { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 10px; }
.detail-header__sub { font-size: .875rem; color: var(--gray-500); margin-top: 4px; }
.detail-header__actions { display: flex; gap: 8px; align-items: center; }

/* ── Info list (key-value) ───────────────────────────── */

.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .875rem;
}
.info-row:last-child { border-bottom: none; }
.info-row__label { width: 160px; flex-shrink: 0; color: var(--gray-500); font-size: .8rem; }
.info-row__value { color: var(--gray-800); }

/* ── Log block ───────────────────────────────────────── */

.log-block {
  background: var(--gray-900);
  color: #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: .75rem;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 220px;
  overflow-y: auto;
}

/* ── Wizard steps ────────────────────────────────────── */

.steps { display: flex; gap: 0; margin-bottom: 28px; }
.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 16px;
  border-bottom: 2px solid var(--gray-200);
  position: relative;
}
.step.active { border-bottom-color: var(--brand); }
.step.done { border-bottom-color: var(--green); }
.step__num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
}
.step.active .step__num { background: var(--brand); color: #fff; }
.step.done .step__num { background: var(--green); color: #fff; }
.step__label { font-size: .8rem; color: var(--gray-500); }
.step.active .step__label { color: var(--brand); font-weight: 600; }

/* ── Login page ──────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-box__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-box__title { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.login-box__sub { font-size: .875rem; color: var(--gray-500); margin-bottom: 24px; }

/* ── Landing page ────────────────────────────────────── */

.landing-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-content { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.hero {
  text-align: center;
  padding: 80px 24px 60px;
}
.hero__eyebrow { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 12px; }
.hero__title { font-size: 2.5rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; margin-bottom: 16px; }
.hero__sub { font-size: 1.125rem; color: var(--gray-500); max-width: 560px; margin: 0 auto 32px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 60px 0; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.section-sub { font-size: 1rem; color: var(--gray-500); margin-bottom: 32px; }

.tariff-card {
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tariff-card.featured { border-color: var(--brand); }
.tariff-card__name { font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); }
.tariff-card__price { font-size: 2rem; font-weight: 800; color: var(--gray-900); }
.tariff-card__price span { font-size: .9rem; font-weight: 400; color: var(--gray-400); }
.tariff-card__features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tariff-card__features li { font-size: .875rem; color: var(--gray-600); display: flex; align-items: center; gap: 8px; }
.tariff-card__features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }

/* ── Demo bar ────────────────────────────────────────── */

.demo-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--gray-900);
  color: #e5e7eb;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: .8rem;
  z-index: 9999;
}

.demo-bar strong { color: #fff; }
.demo-bar a { color: #93c5fd; }
.demo-bar a:hover { color: #fff; }

.demo-bar .demo-links { display: flex; gap: 8px; align-items: center; }
.demo-bar .demo-sep { color: var(--gray-600); }

/* ── Breadcrumb ──────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--gray-400);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb__sep { color: var(--gray-300); }

/* ── Tabs ────────────────────────────────────────────── */

.tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; gap: 0; }
.tab {
  padding: 10px 16px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Empty state ─────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-400);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state__title { font-size: 1rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state__text { font-size: .875rem; margin-bottom: 20px; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .info-row__label { width: 120px; }
}

@media (max-width: 600px) {
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-header { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════════════════════ */

.kanban-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 -4px;
}

.kanban {
  display: flex;
  gap: 14px;
  min-width: 800px;
  padding: 0 4px;
  align-items: flex-start;
}

.kanban-col {
  flex: 1;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--gray-100);
  border-radius: 10px;
  overflow: hidden;
}

.kanban-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
  user-select: none;
}

.kanban-col__count {
  background: var(--gray-200);
  color: var(--gray-500);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .7rem;
  font-weight: 700;
}

.kanban-col--clarification .kanban-col__header { color: #6d28d9; }
.kanban-col--clarification .kanban-col__count { background: #ede9fe; color: #6d28d9; }
.kanban-col--review .kanban-col__header { color: #92400e; }
.kanban-col--review .kanban-col__count { background: var(--yellow-light); color: #92400e; }
.kanban-col--done .kanban-col__header { color: var(--green); }
.kanban-col--done .kanban-col__count { background: var(--green-light); color: var(--green); }

.kanban-col__body {
  flex: 1;
  padding: 6px 8px 10px;
  min-height: 120px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow .12s, transform .1s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.kanban-card__id {
  font-size: .7rem;
  color: var(--gray-400);
  font-family: monospace;
  margin-bottom: 4px;
}

.kanban-card__title {
  font-size: .825rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.kanban-card__site {
  font-size: .72rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.kanban-card__thumbs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.kanban-thumb {
  width: 36px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: rgba(0,0,0,.4);
  border: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}

.kanban-thumb--more {
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: .65rem;
  font-weight: 700;
}

.kanban-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--gray-400);
}

/* ── Kanban filters ──────────────────────────────────── */

.kanban-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.kanban-filters .form-select,
.kanban-filters .form-input {
  width: auto;
  padding: 7px 10px;
  font-size: .825rem;
}

.kanban-filters .form-input { min-width: 180px; }

/* ── New ticket form panel ───────────────────────────── */

.new-ticket-panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.new-ticket-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: .875rem;
  color: var(--gray-700);
}

.new-ticket-panel__header:hover { background: var(--gray-50); }

.new-ticket-panel__body {
  border-top: 1px solid var(--gray-100);
  padding: 18px;
  display: none;
}

.new-ticket-panel__body.open { display: block; }

/* ── Upload zone ─────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
  background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}

.upload-zone__icon { font-size: 2rem; margin-bottom: 8px; }

.upload-zone__title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.upload-zone__hint {
  font-size: .75rem;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.upload-zone__hint code {
  background: var(--gray-100);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: .72rem;
}

.upload-zone__btn {
  display: inline-block;
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-preview-item {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: rgba(0,0,0,.35);
  overflow: hidden;
  flex-shrink: 0;
}

.upload-preview-item__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  cursor: pointer;
  line-height: 1;
  border: none;
}

.upload-preview-item__remove:hover { background: var(--red); }

.upload-limit {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════
   TICKET DETAIL — gallery, lightbox, sidebar, nav
   ═══════════════════════════════════════════════════════ */

.ticket-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: flex-start;
}

.ticket-main { min-width: 0; }

.ticket-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}

.ticket-sidebar__card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ticket-sidebar__header {
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.ticket-sidebar__list {
  max-height: 65vh;
  overflow-y: auto;
}

.ticket-sidebar__item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}

.ticket-sidebar__item:last-child { border-bottom: none; }
.ticket-sidebar__item:hover { background: var(--gray-50); text-decoration: none; color: inherit; }
.ticket-sidebar__item.active { background: var(--brand-light); }

.ticket-sidebar__item-id {
  font-size: .68rem;
  color: var(--gray-400);
  font-family: monospace;
  margin-bottom: 2px;
}

.ticket-sidebar__item-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.ticket-sidebar__item.active .ticket-sidebar__item-title { color: var(--brand); }

/* ── Ticket gallery ──────────────────────────────────── */

.ticket-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.ticket-gallery__item {
  width: 100px;
  height: 78px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: rgba(0,0,0,.3);
  transition: box-shadow .12s, transform .1s;
  flex-shrink: 0;
}

.ticket-gallery__item:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.03);
}

.ticket-gallery__item::after {
  content: '🔍';
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: .75rem;
  opacity: 0;
  transition: opacity .15s;
}

.ticket-gallery__item:hover::after { opacity: 1; }

/* ── Lightbox ────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__inner {
  max-width: 800px;
  width: 100%;
  position: relative;
}

.lightbox__img {
  width: 100%;
  border-radius: 8px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  border: 2px solid rgba(255,255,255,.1);
}

.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  border: none;
  transition: background .15s;
}

.lightbox__close:hover { background: rgba(255,255,255,.3); }

.lightbox__caption {
  text-align: center;
  color: rgba(255,255,255,.6);
  font-size: .8rem;
  margin-top: 10px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  border: none;
  transition: background .15s;
}

.lightbox__nav:hover { background: rgba(255,255,255,.3); }
.lightbox__nav--prev { left: -48px; }
.lightbox__nav--next { right: -48px; }

/* ── Ticket prev/next bar ────────────────────────────── */

.ticket-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.ticket-nav__back {
  font-size: .825rem;
  color: var(--gray-500);
}

.ticket-nav__arrows {
  display: flex;
  gap: 6px;
}

/* ── Comment add block ───────────────────────────────── */

.ticket-comment-add {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
}

.ticket-comment-add__title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}

/* ── Mobile kanban tabs ──────────────────────────────── */

.kanban-mobile-tabs {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 14px;
}

.kanban-mobile-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}

.kanban-mobile-tab.active {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
}

/* ── Responsive overrides ────────────────────────────── */

@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-sidebar { position: static; }
}

@media (max-width: 768px) {
  .kanban-mobile-tabs { display: flex; }
  .kanban { min-width: unset; flex-direction: column; }
  .kanban-col { max-width: 100%; min-width: 0; display: none; }
  .kanban-col.mobile-active { display: flex; }
  .lightbox__nav--prev { left: -8px; }
  .lightbox__nav--next { right: -8px; }
}

/* ═══════════════════════════════════════════════════════
   TICKET CHAT / THREAD
   ═══════════════════════════════════════════════════════ */

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-msg {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  align-items: flex-start;
}

.chat-msg:last-child { border-bottom: none; }

.chat-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg__avatar--client { background: var(--brand-light); color: var(--brand); }
.chat-msg__avatar--admin  { background: var(--green-light); color: var(--green); }
.chat-msg__avatar--system { background: var(--gray-100); color: var(--gray-400); }

.chat-msg__body { flex: 1; min-width: 0; }

.chat-msg__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.chat-msg__author {
  font-size: .8rem;
  font-weight: 700;
  color: var(--gray-800);
}

.chat-msg__time {
  font-size: .72rem;
  color: var(--gray-400);
}

.chat-msg__role {
  font-size: .68rem;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: 4px;
  padding: 1px 6px;
}

.chat-msg__role--admin { background: var(--green-light); color: var(--green); }

.chat-msg__text {
  font-size: .875rem;
  color: var(--gray-700);
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-msg__images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-msg__img {
  width: 80px;
  height: 60px;
  border-radius: 5px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: rgba(0,0,0,.3);
  overflow: hidden;
  transition: box-shadow .12s, transform .1s;
}

.chat-msg__img:hover { box-shadow: var(--shadow-md); transform: scale(1.03); }

/* System event row */
.chat-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: .75rem;
  color: var(--gray-400);
  border-bottom: 1px dashed var(--gray-100);
}

.chat-event:last-child { border-bottom: none; }

.chat-event__icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  flex-shrink: 0;
}

/* Reply form */
.reply-form {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
}

.reply-form__title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}

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

/* Status change bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.status-bar__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-right: 4px;
}

.status-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}

.status-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.status-btn.current { border-color: var(--brand); color: var(--brand); background: var(--brand-light); pointer-events: none; }
.status-btn--clarification.current { border-color: #7c3aed; color: #7c3aed; background: #ede9fe; }
.status-btn--review.current { border-color: #d97706; color: #92400e; background: var(--yellow-light); }
.status-btn--done.current { border-color: var(--green); color: var(--green); background: var(--green-light); }

/* Ticket meta info list */
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.ticket-meta__item strong { color: var(--gray-700); }

/* ═══════════════════════════════════════════════════════
   MOBILE SIDEBAR OVERLAY
   ═══════════════════════════════════════════════════════ */

.topbar__menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
  color: var(--gray-600);
  font-size: 1.1rem;
}

.topbar__menu-btn:hover { background: var(--gray-50); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
}

.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* On mobile, sidebar becomes an overlay panel */
@media (max-width: 900px) {
  .topbar__menu-btn { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    z-index: 300;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main { margin-left: 0; }
}
