/* ============================================================
   Illy Caffe'Issimo — Admin Panel CSS
   Italian Premium Coffee · Mobile-First
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --red:         #C8102E;
  --red-dark:    #A00D24;
  --red-light:   #F5E6E9;
  --cream:       #FFFDF7;
  --white:       #FFFFFF;
  --graphite:    #1C1C1E;
  --graphite-md: #3A3A3C;
  --gray:        #6B7280;
  --gray-light:  #E5E7EB;
  --gray-bg:     #F9FAFB;
  --green:       #1A4731;
  --green-light: #EAF2ED;
  --yellow:      #F59E0B;
  --sidebar-w:   260px;
  --topbar-h:    60px;
  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08);
  --transition:  0.2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: var(--gray-bg); color: var(--graphite); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── Layout ─────────────────────────────────────────────────── */
.admin-body { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--graphite);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

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

/* Mobile: sidebar hidden by default */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.sidebar--open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .admin-layout { margin-left: 0; }
}

/* ── Sidebar overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
}
.sidebar-overlay.active { display: block; }

/* ── Sidebar brand ──────────────────────────────────────────── */
.sidebar__brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  white-space: nowrap;
}
.sidebar__brand-illy { color: var(--red); font-weight: 700; }
.sidebar__brand-rest { color: rgba(255,255,255,.9); font-weight: 500; }

/* ── Sidebar admin info ─────────────────────────────────────── */
.sidebar__admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar__username { color: rgba(255,255,255,.9); font-size: .85rem; font-weight: 600; }
.sidebar__role { color: rgba(255,255,255,.45); font-size: .72rem; }

/* ── Sidebar nav ────────────────────────────────────────────── */
.sidebar__nav { flex: 1; padding: 12px 0; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border-radius: 0;
}
.sidebar__link:hover { background: rgba(255,255,255,.06); color: white; }
.sidebar__link--active {
  background: rgba(200,16,46,.25);
  color: white;
  font-weight: 600;
}
.sidebar__link--active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.sidebar__icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.sidebar__link--active .sidebar__icon { opacity: 1; }
.sidebar__badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.sidebar__divider { height: 1px; background: rgba(255,255,255,.07); margin: 8px 0; }
.sidebar__section-label {
  display: block;
  padding: 8px 20px 4px;
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
}

/* ── Sidebar footer ─────────────────────────────────────────── */
.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  font-weight: 500;
  transition: color var(--transition);
  padding: 8px 0;
  width: 100%;
}
.sidebar__logout:hover { color: rgba(255,255,255,.85); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px;
  flex-shrink: 0;
}
.topbar__burger span {
  display: block;
  height: 2px;
  background: var(--graphite);
  border-radius: 2px;
  transition: all var(--transition);
}
@media (max-width: 1023px) {
  .topbar__burger { display: flex; }
}
.topbar__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--graphite);
  flex: 1;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* ── Admin main ─────────────────────────────────────────────── */
.admin-main { padding: 24px; flex: 1; }
@media (max-width: 767px) { .admin-main { padding: 16px; } }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .88rem;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  border: 1.5px solid transparent;
}
.btn--primary { background: var(--red); color: white; border-color: var(--red); }
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--ghost { background: transparent; color: var(--graphite-md); border-color: var(--gray-light); }
.btn--ghost:hover { border-color: var(--graphite-md); color: var(--graphite); }
.btn--danger { background: transparent; color: #DC2626; border-color: #FCA5A5; }
.btn--danger:hover { background: #FEF2F2; }
.btn--success { background: var(--green); color: white; border-color: var(--green); }
.btn--sm { padding: 7px 14px; font-size: .82rem; }
.btn--xs { padding: 4px 10px; font-size: .78rem; border-radius: var(--radius-sm); }
.btn--block { width: 100%; justify-content: center; }
.btn-inline { background: none; border: none; color: var(--red); text-decoration: underline; font-size: inherit; cursor: pointer; padding: 0; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash-container { padding: 0 24px; margin-top: 8px; }
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.flash--success { background: var(--green-light); color: var(--green); border: 1px solid #A7D7BB; }
.flash--danger,
.flash--error   { background: var(--red-light); color: var(--red-dark); border: 1px solid #F5C2CB; }
.flash--warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.flash--info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.flash__close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: inherit; opacity: .6; }
.flash__close:hover { opacity: 1; }

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-card__icon svg { width: 22px; height: 22px; }
.kpi-card--reviews .kpi-card__icon    { background: #EFF6FF; color: #2563EB; }
.kpi-card--rating .kpi-card__icon     { background: #FEF9C3; color: #CA8A04; }
.kpi-card--complaints .kpi-card__icon { background: var(--red-light); color: var(--red); }
.kpi-card--progress .kpi-card__icon   { background: #FEF3C7; color: #D97706; }
.kpi-card--resolved .kpi-card__icon   { background: var(--green-light); color: var(--green); }
.kpi-card__value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--graphite);
  line-height: 1;
}
.kpi-card__star { font-size: 1.2rem; color: var(--yellow); }
.kpi-card__label { font-size: .75rem; color: var(--gray); font-weight: 500; margin-top: 4px; }

/* ── Charts ─────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 767px) { .charts-row { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  overflow: hidden;
}
.chart-card__header {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chart-card__title { font-weight: 600; font-size: .95rem; color: var(--graphite); }
.chart-card__link  { font-size: .82rem; color: var(--red); font-weight: 500; }
.chart-card__body  { padding: 16px 20px 20px; }
.chart-card__body--bar { padding: 16px 20px 20px; }

/* Category bars */
.cat-bars { display: flex; flex-direction: column; gap: 10px; }
.cat-bar { display: flex; align-items: center; gap: 10px; }
.cat-bar__label { width: 120px; font-size: .8rem; color: var(--gray); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar__track { flex: 1; height: 8px; background: var(--gray-light); border-radius: 4px; overflow: hidden; }
.cat-bar__fill  { height: 100%; background: var(--red); border-radius: 4px; transition: width .6s ease; }
.cat-bar__count { width: 28px; text-align: right; font-size: .8rem; font-weight: 600; color: var(--graphite-md); }

/* Dashboard bottom */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 767px) { .dashboard-bottom { grid-template-columns: 1fr; } }

/* Recent complaints list */
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.recent-item:hover { background: var(--gray-bg); }
.recent-item__rating { font-weight: 700; font-size: .85rem; min-width: 30px; }
.recent-item__rating--1, .recent-item__rating--2 { color: var(--red); }
.recent-item__rating--3 { color: var(--yellow); }
.recent-item__body { flex: 1; min-width: 0; }
.recent-item__name { font-weight: 600; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item__meta { font-size: .75rem; color: var(--gray); }

/* ── Data Table ─────────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  overflow: hidden;
  margin-bottom: 16px;
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
  padding: 12px 16px;
  background: var(--gray-bg);
  color: var(--gray);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-bg); }
.row--complaint td { background: #FFF8F9; }
.row--complaint:hover td { background: #FEEEF1; }
.empty-row { text-align: center; color: var(--gray); font-style: italic; padding: 32px !important; }

.td--id    { color: var(--gray); width: 50px; }
.td--name  { font-weight: 500; }
.td--date  { color: var(--gray); white-space: nowrap; }
.td--rating, .td--status, .td--actions { white-space: nowrap; }

.td-name__text { margin-right: 6px; }
.complaint-dot { color: var(--red); font-size: .6rem; vertical-align: super; }

/* ── Rating pills ───────────────────────────────────────────── */
.rating-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.rating-pill--1, .rating-pill--2 { background: var(--red-light); color: var(--red-dark); }
.rating-pill--3 { background: #FEF3C7; color: #92400E; }
.rating-pill--4, .rating-pill--5 { background: var(--green-light); color: var(--green); }

/* ── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge--new         { background: #EFF6FF; color: #2563EB; }
.status-badge--in_progress { background: #FEF3C7; color: #D97706; }
.status-badge--resolved    { background: var(--green-light); color: var(--green); }
.status-badge--closed      { background: var(--gray-bg); color: var(--gray); }

.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge--danger  { background: var(--red-light); color: var(--red); }
.badge--success { background: var(--green-light); color: var(--green); }
.badge--warning { background: #FEF3C7; color: #92400E; }

/* ── Mini chips ─────────────────────────────────────────────── */
.mini-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 500;
  background: var(--gray-bg);
  color: var(--gray);
  border: 1px solid var(--gray-light);
}
.mini-chip--more { opacity: .7; }
.mini-chip--complaint { background: var(--red-light); color: var(--red-dark); border-color: #F5C2CB; }

/* ── Chips row ──────────────────────────────────────────────── */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip--static { padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--gray-light); font-size: .83rem; background: var(--gray-bg); color: var(--graphite-md); }

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.filter-bar__group { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.filter-bar__actions { display: flex; gap: 6px; }
.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: .84rem;
  color: var(--graphite);
  background: var(--white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
}
.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(200,16,46,.1);
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 16px; }
.pagination__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-light);
  font-size: .85rem; font-weight: 500;
  color: var(--graphite-md);
  background: var(--white);
  transition: all var(--transition);
}
.pagination__btn:hover { border-color: var(--red); color: var(--red); }
.pagination__btn--active { background: var(--red); color: white; border-color: var(--red); }
.pagination__ellipsis { padding: 0 4px; color: var(--gray); }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal__title { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.modal__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal__close:hover { background: var(--gray-bg); color: var(--graphite); }
.modal__body { padding: 20px 24px; }
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast--success { background: var(--green); color: white; }
.toast--error   { background: var(--red); color: white; }
.toast--info    { background: var(--graphite); color: white; }

/* ── Form fields ────────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field:last-child { margin-bottom: 0; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--graphite-md); text-transform: uppercase; letter-spacing: .05em; }
.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: .92rem;
  color: var(--graphite);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-error { font-size: .8rem; color: var(--red); font-weight: 500; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.form-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-light); }
.form-subheading { font-weight: 600; font-size: .88rem; color: var(--gray); text-transform: uppercase; letter-spacing: .06em; margin: 20px 0 10px; }
.field-hint { font-size: .78rem; color: var(--gray); }
.required { color: var(--red); }
.hidden { display: none !important; }
.text-muted { color: var(--gray); font-size: .85rem; }

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--graphite-md); user-select: none; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 40px; height: 22px;
  background: var(--gray-light);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform var(--transition);
}
.toggle-input:checked + .toggle-track { background: var(--green); }
.toggle-input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── Detail layout ──────────────────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  padding: 24px;
  margin-bottom: 16px;
}
.detail-card__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.detail-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-card__header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-light); }
.detail-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.detail-section__title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray); margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-field__label { display: block; font-size: .75rem; color: var(--gray); margin-bottom: 2px; }
.detail-field__value { font-size: .92rem; font-weight: 500; color: var(--graphite); }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-meta__date { font-size: .83rem; color: var(--gray); }

/* ── Star display ───────────────────────────────────────────── */
.detail-rating { display: flex; align-items: center; gap: 4px; }
.star--filled { color: var(--yellow); font-size: 1.3rem; }
.star--empty  { color: var(--gray-light); font-size: 1.3rem; }
.detail-rating__num { font-weight: 700; font-size: .95rem; color: var(--graphite-md); margin-left: 6px; }

/* ── Review quote ───────────────────────────────────────────── */
.review-quote {
  background: var(--gray-bg);
  border-left: 3px solid var(--red);
  padding: 14px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .95rem;
  color: var(--graphite-md);
  font-style: italic;
  line-height: 1.6;
}

/* ── Notes card ─────────────────────────────────────────────── */
.notes-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  overflow: hidden;
}
.notes-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
}
.notes-card__title { font-weight: 600; font-size: .9rem; }
.notes-card__hint  { font-size: .75rem; color: #92400E; background: #FEF3C7; padding: 2px 8px; border-radius: 999px; }
.notes-list { padding: 12px 20px; max-height: 300px; overflow-y: auto; }
.note-item { padding: 10px 0; border-bottom: 1px solid var(--gray-light); }
.note-item:last-child { border-bottom: none; }
.note-item__header { display: flex; gap: 10px; margin-bottom: 4px; }
.note-item__author { font-weight: 600; font-size: .82rem; color: var(--graphite-md); }
.note-item__date   { font-size: .78rem; color: var(--gray); }
.note-item__text   { font-size: .9rem; color: var(--graphite); line-height: 1.5; }
.notes-empty       { text-align: center; color: var(--gray); font-style: italic; font-size: .88rem; padding: 16px 0; }
.notes-form { padding: 16px 20px; border-top: 1px solid var(--gray-light); }
.notes-form__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ── Status / Priority controls ─────────────────────────────── */
.status-card, .info-card, .action-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  padding: 18px;
  margin-bottom: 12px;
}
.status-card__title, .info-card__title { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gray); margin-bottom: 12px; }
.status-current { margin-bottom: 12px; }
.status-actions, .priority-actions { display: flex; flex-direction: column; gap: 6px; }
.status-btn, .priority-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
  border: 1.5px solid var(--gray-light);
  background: transparent;
  color: var(--graphite-md);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.status-btn--active, .status-btn:hover { border-color: var(--red); background: var(--red-light); color: var(--red-dark); font-weight: 600; }
.priority-btn--high.priority-btn--active, .priority-btn--high:hover    { border-color: var(--red); background: var(--red-light); color: var(--red-dark); }
.priority-btn--normal.priority-btn--active, .priority-btn--normal:hover { border-color: var(--yellow); background: #FFFBEB; color: #92400E; }
.priority-btn--low.priority-btn--active, .priority-btn--low:hover       { border-color: var(--green); background: var(--green-light); color: var(--green); }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--gray-light); font-size: .84rem; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--gray); }
.info-row code { font-size: .8rem; background: var(--gray-bg); padding: 1px 6px; border-radius: 4px; }

/* ── Complaints list ────────────────────────────────────────── */
.complaints-list { display: flex; flex-direction: column; gap: 10px; }
.complaint-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.complaint-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.complaint-card--priority-high   { border-left: 4px solid var(--red); }
.complaint-card--priority-normal { border-left: 4px solid var(--yellow); }
.complaint-card--priority-low    { border-left: 4px solid var(--green); }
.complaint-card__priority { padding: 16px 12px; display: flex; align-items: flex-start; font-size: 1rem; }
.complaint-card__body { flex: 1; padding: 14px 16px; }
.complaint-card__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.complaint-card__name { font-weight: 600; font-size: .95rem; }
.complaint-card__location { font-size: .82rem; color: var(--gray); margin-bottom: 6px; }
.complaint-card__cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.complaint-card__comment { font-size: .88rem; color: var(--graphite-md); font-style: italic; line-height: 1.5; }
.complaint-card__meta { padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-content: space-between; border-left: 1px solid var(--gray-light); }
.complaint-card__date { font-size: .78rem; color: var(--gray); white-space: nowrap; }
.complaint-card__notes { font-size: .8rem; color: var(--gray); }
.separator { color: var(--gray-light); }

/* ── Branches ───────────────────────────────────────────────── */
.branches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.branch-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}
.branch-card:hover { box-shadow: var(--shadow-md); }
.branch-card--inactive { opacity: .7; }
.branch-card__header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; }
.branch-card__icon { font-size: 1.5rem; flex-shrink: 0; }
.branch-card__name { font-weight: 700; font-size: .95rem; color: var(--graphite); }
.branch-card__slug { font-size: .75rem; color: var(--gray); font-family: monospace; }
.branch-card__body { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.branch-card__row { display: flex; align-items: flex-start; gap: 8px; font-size: .84rem; color: var(--graphite-md); }
.branch-card__icon-sm { flex-shrink: 0; font-size: .9rem; }
.branch-card__links { display: flex; flex-wrap: wrap; gap: 6px; }
.branch-link { font-size: .8rem; color: var(--red); text-decoration: underline; }
.branch-card__footer { padding: 12px 18px; border-top: 1px solid var(--gray-light); display: flex; gap: 6px; flex-wrap: wrap; background: var(--gray-bg); }

/* ── Zones ──────────────────────────────────────────────────── */
.zones-list { display: flex; flex-direction: column; gap: 10px; }
.zone-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-light); overflow: hidden; }
.zone-card__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--gray-light); background: var(--gray-bg); }
.zone-card__name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.zone-card__icon { font-size: 1rem; }
.zone-card__actions { display: flex; gap: 6px; }
.zone-card__body { padding: 14px 18px; }
.zone-card__meta { display: flex; align-items: center; gap: 16px; font-size: .83rem; color: var(--gray); margin-bottom: 10px; }

/* ── Tables grid ────────────────────────────────────────────── */
.zone-section { margin-bottom: 28px; }
.zone-section__header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--gray-light); }
.zone-section__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }
.zone-section__count { font-size: .8rem; color: var(--gray); background: var(--gray-bg); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--gray-light); }
.zone-empty { font-size: .85rem; color: var(--gray); font-style: italic; padding: 12px 0; }

.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.table-tile {
  background: var(--white);
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-md);
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  position: relative;
  transition: all var(--transition);
}
.table-tile:hover { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.08); }
.table-tile--inactive { opacity: .5; }
.table-tile__type-icon { font-size: 1.6rem; }
.table-tile__label { font-weight: 600; font-size: .85rem; color: var(--graphite); }
.table-tile__type { font-size: .72rem; }
.table-tile__inactive-badge { font-size: .65rem; background: var(--yellow); color: #92400E; padding: 1px 6px; border-radius: 999px; }
.table-tile__actions { display: flex; gap: 4px; margin-top: 6px; }
.table-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gray-light);
  color: var(--gray);
  background: var(--white);
  transition: all var(--transition);
}
.table-action-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.table-action-btn--danger:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }

/* ── Login page ─────────────────────────────────────────────── */
.login-body { background: var(--cream); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-page { width: 100%; max-width: 420px; position: relative; }

.login-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.login-bg__circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  opacity: .06;
}
.login-bg__circle--1 { width: 500px; height: 500px; top: -200px; right: -150px; }
.login-bg__circle--2 { width: 350px; height: 350px; bottom: -100px; left: -100px; }

.login-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
  padding: 40px 36px 36px;
  position: relative;
  z-index: 1;
}
@media (max-width: 480px) { .login-card { padding: 32px 24px 28px; } }

.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand__cup { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.login-brand__name { font-family: var(--font-serif); font-size: 1.5rem; }
.login-brand__illy { color: var(--red); font-weight: 700; }
.login-brand__rest { color: var(--graphite); font-weight: 500; }
.login-brand__sub  { font-size: .88rem; color: var(--gray); margin-top: 6px; }

.login-step { }
.login-field { margin-bottom: 18px; }
.login-label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--graphite-md); margin-bottom: 8px; }
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--graphite);
  background: var(--white);
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.login-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(200,16,46,.1); }
.login-input--code { font-size: 1.1rem; font-weight: 600; letter-spacing: .05em; text-align: center; }
.login-error { font-size: .82rem; color: var(--red); margin-top: 6px; font-weight: 500; }

.login-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  border: 2px solid transparent;
  transition: all var(--transition);
  min-height: 50px;
  margin-bottom: 10px;
}
.login-btn--primary { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: white; box-shadow: 0 4px 14px rgba(200,16,46,.3); }
.login-btn--primary:hover { box-shadow: 0 6px 20px rgba(200,16,46,.4); transform: translateY(-1px); }
.login-btn--primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-btn--ghost { background: transparent; color: var(--gray); border-color: var(--gray-light); }
.login-btn--ghost:hover { border-color: var(--graphite-md); color: var(--graphite); }
.login-btn__spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.login-btn.loading .login-btn__text { opacity: .6; }
.login-btn.loading .login-btn__spinner { display: block; }

.login-telegram-notice { display: flex; align-items: center; gap: 8px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 18px; font-size: .88rem; color: #1D4ED8; font-weight: 500; }
.login-timer { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--gray); margin-bottom: 16px; padding: 8px 12px; background: var(--gray-bg); border-radius: var(--radius-sm); }
.login-timer__value { font-weight: 700; color: var(--graphite-md); font-variant-numeric: tabular-nums; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--gray); font-style: italic; font-size: .88rem; padding: 16px; }
.empty-state--good { color: var(--green); background: var(--green-light); border-radius: var(--radius-sm); }
.empty-state-block { text-align: center; padding: 60px 24px; }
.empty-state-block__icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state-block__title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.empty-state-block__text { color: var(--gray); font-size: .9rem; margin-bottom: 20px; }

/* ── Zone/branch helpers ─────────────────────────────────────── */
.zone-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-light); }
.zone-item:last-child { border-bottom: none; }
.zone-item__name { font-weight: 500; font-size: .9rem; }
.zone-item__meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--gray); }
.zone-list { margin-top: 4px; }

/* ── Utility ────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease forwards; }

/* ── OTP input with fixed prefix ───────────────────────────── */
.otp-input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.otp-input-wrapper:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200,16,46,.1);
}
.otp-prefix {
  padding: 14px 0 14px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--graphite-md);
  white-space: nowrap;
  user-select: none;
  letter-spacing: .03em;
}
.otp-input-wrapper .login-input--code {
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding-left: 4px;
  flex: 1;
  min-width: 0;
}
.otp-input-wrapper .login-input--code:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

/* ============================================================
   EXTENSIONS v2 — SLA, Audit Log, FGA, Analytics, Sentiment,
   Complaint history, Photo, Mobile improvements
   ============================================================ */

/* ── SLA pills & bars ───────────────────────────────────────── */
.sla-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.sla-pill--ok   { background: var(--green-light); color: var(--green); }
.sla-pill--warn { background: #FEF3C7; color: #D97706; }
.sla-pill--bad  { background: var(--red-light);   color: var(--red); }

/* SLA detail block */
.sla-card { border-left: 4px solid var(--yellow) !important; }
.sla-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}
.sla-stat { display: flex; flex-direction: column; gap: 2px; }
.sla-stat__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); }
.sla-stat__value { font-size: 1rem; font-weight: 700; color: var(--graphite); }
.sla-stat--ok     { color: var(--green); }
.sla-stat--warn   { color: #D97706; }
.sla-stat--breached { color: var(--red); }

.sla-bar-wrap { margin-bottom: 8px; }
.sla-bar-track {
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}
.sla-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.sla-bar--ok   { background: var(--green); }
.sla-bar--warn { background: #F59E0B; }
.sla-bar--bad  { background: var(--red); }

/* ── Complaint card SLA breach highlight ────────────────────── */
.complaint-card--sla-breach {
  border-color: var(--red) !important;
  background: #FFF8F9;
}
.complaint-card--priority-critical { border-left: 4px solid var(--red); }

/* ── Priority buttons — critical ────────────────────────────── */
.priority-btn--critical.priority-btn--active,
.priority-btn--critical:hover {
  border-color: #7F1D1D;
  background: #FEF2F2;
  color: #7F1D1D;
}

/* ── Complaint photo ────────────────────────────────────────── */
.review-photo-wrap {
  display: inline-block;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 100%;
  border: 1.5px solid var(--gray-light);
}
.review-photo {
  max-width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.review-photo:hover { transform: scale(1.02); }

.complaint-photo-preview {
  margin-top: 4px;
  line-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-light);
}
.complaint-photo-thumb {
  width: 56px;
  height: 40px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
}
.complaint-photo-thumb:hover { transform: scale(1.1); }
.complaint-card__photo-badge { font-size: .85rem; }
.complaint-card__assigned { font-size: .78rem; color: var(--gray); }

/* ── Complaint timeline history ─────────────────────────────── */
.history-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-left: 2px solid var(--gray-light);
  margin-left: 8px;
  padding-left: 16px;
  position: relative;
}
.timeline-item__dot {
  position: absolute;
  left: -6px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-light);
  border: 2px solid var(--white);
  flex-shrink: 0;
}
.timeline-dot--created       { background: #2563EB; }
.timeline-dot--status_changed{ background: var(--yellow); }
.timeline-dot--action_taken  { background: var(--green); }
.timeline-dot--note_added    { background: var(--graphite-md); }
.timeline-dot--escalated     { background: var(--red); }
.timeline-item__body { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.timeline-item__time { font-size: .75rem; color: var(--gray); white-space: nowrap; }
.timeline-item__who  { font-size: .8rem; font-weight: 600; color: var(--graphite-md); }
.timeline-item__desc { font-size: .85rem; color: var(--graphite); }

/* ── History list (actions) ─────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 12px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  font-size: .84rem;
}
.history-item__time  { color: var(--gray); white-space: nowrap; }
.history-item__event { font-weight: 600; color: var(--graphite); }
.history-item__who   { color: var(--graphite-md); }
.history-item__note  { color: var(--gray); font-style: italic; width: 100%; margin-top: 2px; }

/* ── Sentiment ──────────────────────────────────────────────── */
.sentiment-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sentiment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
}
.sentiment-badge--positive { background: var(--green-light); color: var(--green); }
.sentiment-badge--neutral  { background: var(--gray-bg);     color: var(--gray); border: 1px solid var(--gray-light); }
.sentiment-badge--negative { background: var(--red-light);   color: var(--red-dark); }
.sentiment-issues { margin-top: 4px; }

/* ── Audit log specific ─────────────────────────────────────── */
.audit-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.audit-meta { font-size: .84rem; margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.audit-row--failed td { background: #FFF8F9; }
.audit-td-time { white-space: nowrap; }
.audit-time { display: block; font-weight: 600; font-size: .85rem; }
.audit-date { display: block; font-size: .72rem; color: var(--gray); }
.audit-admin { font-weight: 600; font-size: .85rem; }
.audit-action {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 700;
  background: var(--gray-bg);
  color: var(--graphite-md);
  white-space: nowrap;
  font-family: monospace;
}
.audit-entity-id { font-size: .78rem; background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }
.audit-td-desc { font-size: .84rem; max-width: 280px; }
.audit-td-entity { white-space: nowrap; }
.audit-td-ip { white-space: nowrap; }
.audit-ip { font-size: .78rem; color: var(--gray); }

/* ── FGA GROUP dashboard ────────────────────────────────────── */
.fga-header {
  background: linear-gradient(135deg, var(--graphite) 0%, #2D2D30 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.fga-header__badge {
  background: gold;
  color: var(--graphite);
  font-weight: 800;
  font-size: .85rem;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.fga-header__sub { color: rgba(255,255,255,.6); font-size: .85rem; }

.fga-section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--graphite);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fga-section-link { font-size: .82rem; color: var(--red); font-weight: 500; margin-left: auto; }
.fga-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 767px) { .fga-grid-2 { grid-template-columns: 1fr; } }

.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }

/* ── Analytics ──────────────────────────────────────────────── */
.analytics-periods { margin-bottom: 16px; }
.analytics-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.period-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.period-tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
  border: 1.5px solid var(--gray-light);
  color: var(--graphite-md);
  transition: all var(--transition);
  background: var(--white);
}
.period-tab:hover { border-color: var(--red); color: var(--red); }
.period-tab--active { background: var(--red); color: white; border-color: var(--red); }

.analytics-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.highlight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1.5px solid;
  flex: 1;
  min-width: 220px;
}
.highlight-card--best { background: var(--green-light); border-color: #A7D7BB; }
.highlight-card--warn { background: #FEF3C7; border-color: #FCD34D; }
.highlight-card__emoji { font-size: 1.5rem; }
.highlight-card__label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); }
.highlight-card__value { font-size: .95rem; font-weight: 700; color: var(--graphite); }

.analytics-section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.analytics-best-badge {
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 600;
  background: #FEF9C3;
  color: #92400E;
  padding: 3px 10px;
  border-radius: 999px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .analytics-grid { grid-template-columns: 1fr; } }

.cat-bar__pct { color: var(--gray); }

/* Sortable table headers */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--red); }

/* ── KPI SLA warning card ───────────────────────────────────── */
.kpi-card--sla-warn .kpi-card__icon { background: #FEF3C7; color: #D97706; }

/* ── Sidebar FGA link ───────────────────────────────────────── */
.sidebar__link--fga { background: rgba(218,165,32,.1); }
.sidebar__link--fga:hover { background: rgba(218,165,32,.2); }
.sidebar__link--fga.sidebar__link--active { background: rgba(218,165,32,.25); }

/* ── Mobile responsive improvements ────────────────────────── */
@media (max-width: 767px) {

  /* KPI grid: 2 columns on small screens */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 12px; gap: 10px; }
  .kpi-card__value { font-size: 1.4rem; }
  .kpi-card__icon { width: 36px; height: 36px; }
  .kpi-card__icon svg { width: 18px; height: 18px; }

  /* Filter bar: stack vertically */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar__group { flex-direction: column; }
  .filter-select, .filter-input { min-width: 0; width: 100%; }
  .filter-bar__actions { justify-content: flex-end; }

  /* Complaints list */
  .complaint-card { flex-direction: column; }
  .complaint-card__meta {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px solid var(--gray-light);
    padding: 10px 14px;
    align-items: center;
  }

  /* Detail layout: single column */
  .detail-layout { grid-template-columns: 1fr; }

  /* Audit log table: hide less important columns */
  .audit-td-ip, .audit-td-entity { display: none; }

  /* Charts: single column */
  .charts-row { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }

  /* Analytics: single column */
  .analytics-grid { grid-template-columns: 1fr; }
  .fga-grid-2 { grid-template-columns: 1fr; }

  /* SLA row: wrap */
  .sla-row { gap: 10px; }
  .sla-stat { min-width: 80px; }

  /* Branch compare table: allow horizontal scroll */
  .branch-compare-table { font-size: .8rem; }

  /* Topbar adjustments */
  .topbar__title { font-size: .95rem; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .audit-periods { flex-direction: row; flex-wrap: wrap; }
  .analytics-highlights { flex-direction: column; }
  .highlight-card { min-width: 0; }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
  .btn, .status-btn, .priority-btn, .period-tab,
  .sidebar__link, .pagination__btn {
    min-height: 44px;
    min-width: 44px;
  }
  .status-btn, .priority-btn { padding: 10px 14px; }
  .table-action-btn { width: 36px; height: 36px; }
  .filter-select, .filter-input { min-height: 44px; font-size: 16px; /* prevent iOS zoom */ }
  .form-input, .form-select, .form-textarea { font-size: 16px; }
}

/* No horizontal overflow anywhere */
body, .admin-main, .admin-layout { overflow-x: hidden; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── OTP login: remove prefix wrapper (digits-only now) ─────── */
.otp-input-wrapper { display: block; border: none; padding: 0; }
.otp-prefix { display: none; }
.otp-input-wrapper .login-input--code {
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  width: 100%;
}
.otp-input-wrapper .login-input--code:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200,16,46,.1);
  outline: none;
}

/* ── Login logo (replaces emoji cup) ───────────────────────── */
.login-brand__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.login-brand__logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
  /* no border, no box-shadow, no background */
}

/* ── Sidebar brand with logo ────────────────────────────────── */
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  /* no border, no background */
}
.sidebar__brand-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  white-space: nowrap;
}

/* Remove highlight-card emoji space */
.highlight-card__emoji { display: none; }
