/* ============================================================
   T-Creations Client Portal — Core Stylesheet
   Phase 0 · v2 (refined SaaS layout)
   Brand reference: tcreationsllc.com
   ============================================================ */

:root {
  /* Brand greens */
  --green-900: #0C2419;
  --green-800: #12352A;
  --green-700: #1B4332;   /* Primary — site theme colour */
  --green-600: #245B45;
  --green-500: #2D6A4F;
  --green-400: #3F8266;
  --green-100: #E3EFE9;
  --green-050: #F3F8F5;

  /* Accents */
  --mint:   #10B981;
  --blue:   #3B82F6;
  --amber:  #F59E0B;
  --violet: #8B5CF6;
  --cyan:   #0EA5E9;
  --red:    #EF4444;

  /* Neutrals — light, airy, HubSpot-like */
  --bg:      #F5F8F7;
  --surface: #FFFFFF;
  --line:    #E8EDEB;
  --line-2:  #F1F5F3;
  --text:    #172B23;
  --muted:   #5F7169;
  --faint:   #93A29B;

  /* Shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Elevation — very soft */
  --sh-1: 0 1px 2px rgba(23,43,35,.05);
  --sh-2: 0 1px 3px rgba(23,43,35,.05), 0 6px 18px rgba(23,43,35,.05);
  --sh-3: 0 12px 40px rgba(23,43,35,.12);

  /* Layout */
  --sidebar-w: 244px;
  --topbar-h:  64px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--green-600); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--green-400); }

h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 600; letter-spacing: -.022em; line-height: 1.25; }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p  { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--green-400); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D5DEDA; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #BCC9C3; background-clip: content-box; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--green-800);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  /* A green edge runs the full height, so the white logo band
     stops cleanly instead of blending into the topbar. */
  border-right: 2px solid var(--green-600);
}

/* A white band at the top so the mark sits on its own colour */
.sidebar__brand {
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  background: #fff;
  border-bottom: 2px solid var(--green-600);
}
.sidebar__mark {
  height: 34px;
  width: auto;
  display: block;
  flex: none;
}
.sidebar__wordmark {
  color: var(--green-700);
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.sidebar__wordmark small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}

.sidebar__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.40);
  padding: 16px 22px 8px;
  font-weight: 600;
}

.nav { list-style: none; margin: 0; padding: 0 12px; flex: 1; overflow-y: auto; }
.nav li { margin-bottom: 1px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.72);
  font-size: 14px; font-weight: 450;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.is-active { background: rgba(255,255,255,.13); color: #fff; font-weight: 550; }
.nav .ico {
  width: 18px; height: 18px; flex: none;
  display: grid; place-items: center;
  opacity: .8;
}
.nav a.is-active .ico { opacity: 1; }
.ico-svg { display: block; }

.sidebar__foot { padding: 14px 16px 18px; }
.help-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.help-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- Main ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__title { font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.topbar__sub   { font-size: 12px; color: var(--muted); line-height: 1.3; }
.topbar__right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { color: var(--green-700); }
.icon-btn:hover { background: var(--green-050); border-color: var(--green-100); }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 9px; display: grid; place-items: center;
  border: 2px solid #fff;
}

/* ---------- Avatars ---------- */
.avatar-wrap {
  position: relative;
  display: inline-block;
  width: var(--avatar-size, 36px);
  height: var(--avatar-size, 36px);
  flex: none;
  vertical-align: middle;
}
.avatar-img,
.avatar-initials {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: grid; place-items: center;
  object-fit: cover;
  font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 0 0 1px rgba(23,43,35,.06) inset;
}

.avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: var(--badge-size, 14px); height: var(--badge-size, 14px);
  border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid #fff;
  color: #fff;
  box-shadow: 0 1px 3px rgba(23,43,35,.18);
}
.avatar-badge--admin { background: var(--green-700); }
.avatar-badge--owner { background: var(--mint); }
.avatar-badge svg { display: block; }

.avatar-presence {
  position: absolute; right: -1px; top: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #fff;
}

/* On the dark sidebar and topbar the ring should not glow white */
.topbar .avatar-badge, .topbar .avatar-presence { border-color: #fff; }

/* Person row: avatar plus name and meta */
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person__name { font-weight: 550; line-height: 1.35; }
.person__meta { font-size: 12.5px; color: var(--faint); }

/* Old class kept so nothing breaks mid-upgrade */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-700); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  flex: none;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tabs a {
  padding: 10px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--green-700); border-bottom-color: var(--green-700); font-weight: 600; }

/* ---------- Photo upload ---------- */
.avatar-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-upload__hint { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.file-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 7px;
}
.file-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 100px;
}

/* ---------- Preview banner ---------- */
.preview-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px;
  background: #FEF3C7;
  border-bottom: 1px solid #FDE68A;
  color: #92400E;
  font-size: 13px;
}
body.is-preview .topbar { top: 0; }
body.is-preview .sidebar { top: 0; }

/* ---------- Filter chips ---------- */
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { background: var(--green-050); color: var(--text); }
.chip.is-active {
  background: var(--green-700); border-color: var(--green-700); color: #fff; font-weight: 550;
}
details > summary::-webkit-details-marker { display: none; }

/* ---------- Bulk action bar ---------- */
.bulk-bar {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: var(--green-800);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.bulk-bar.is-visible { display: flex; }
.bulk-bar__count {
  color: #fff; font-size: 13.5px; font-weight: 600;
  padding-right: 6px; white-space: nowrap;
}
.bulk-bar__group { display: flex; gap: 6px; align-items: center; }
.bulk-bar .select { padding: 7px 10px; font-size: 13px; }
.bulk-bar .btn--ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.16); }
.bulk-bar .btn--ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.bulk-bar .btn--primary { background: #fff; color: var(--green-800); }
.bulk-bar .btn--primary:hover { background: #EAF3EE; color: var(--green-800); }

input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green-600); }

@media (max-width: 700px) {
  .bulk-bar { gap: 8px; }
  .bulk-bar__group { width: 100%; }
  .bulk-bar__group .select { flex: 1; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline__item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 1px; background: var(--line);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  width: 27px; height: 27px; flex: none;
  border-radius: 50%;
  background: var(--green-050);
  border: 1px solid var(--green-100);
  display: grid; place-items: center;
  color: var(--green-600);
  position: relative; z-index: 1;
}
.timeline__dot .ico-svg { width: 13px; height: 13px; }
.timeline__body { padding-top: 3px; min-width: 0; }

/* ---------- Inline row actions (safe inside scrollable tables) ---------- */
.row-actions > summary { list-style: none; cursor: pointer; display: inline-block; }
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions__panel {
  margin-top: 10px;
  padding: 12px;
  background: #FBFCFC;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  min-width: 260px;
}
.row-actions__panel form { margin: 0; }

/* ---------- Account menu ---------- */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; display: block;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 216px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  padding: 6px;
  z-index: 50;
}
.menu__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu__name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.menu__meta { font-size: 12px; color: var(--muted); word-break: break-all; }
.menu__item {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text);
}
.menu__item:hover { background: var(--green-050); color: var(--text); }
.menu__item--danger { color: #9B1C1C; }
.menu__item--danger:hover { background: #FEF2F2; color: #9B1C1C; }

/* ---------- Content ---------- */
.content { padding: 28px; flex: 1; max-width: 1440px; width: 100%; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p  { color: var(--muted); margin: 0; font-size: 14px; max-width: 640px; }

.mobile-toggle { display: none; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 22px;
}
.card--flush { padding: 0; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
}
.card--flush .card__head { border-bottom: 1px solid var(--line-2); }
.card__head h3 { margin: 0; }
.card__body { padding: 22px; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px 18px 18px;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.stat:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }

.stat__top { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.stat__key {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
}
.stat__value {
  font-size: 30px; font-weight: 650;
  letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__meta { font-size: 12px; color: var(--faint); margin-top: 7px; }

.tick { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.tick--blue   { background: var(--blue); }
.tick--amber  { background: var(--amber); }
.tick--violet { background: var(--violet); }
.tick--cyan   { background: var(--cyan); }
.tick--mint   { background: var(--mint); }
.tick--red    { background: var(--red); }
.tick--green  { background: var(--green-600); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px; font-weight: 550; font-family: inherit;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .ico-svg { margin-right: -1px; }
.btn--primary { background: var(--green-700); color: #fff; box-shadow: var(--sh-1); }
.btn--primary:hover { background: var(--green-600); color: #fff; }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--green-050); border-color: var(--green-100); }
.btn--danger { background: var(--red); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 550; line-height: 1.5;
  background: var(--green-050); color: var(--green-600);
  border: 1px solid var(--green-100);
}
.pill--ok   { background: #E7F7F0; color: #08694C; border-color: #C4EBDB; }
.pill--warn { background: #FFF7E8; color: #96620C; border-color: #FAE3B4; }
.pill--bad  { background: #FEF2F2; color: #9B1C1C; border-color: #FBD5D5; }
.pill--flat { background: #F2F5F4; color: var(--muted); border-color: var(--line); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--online  { background: var(--mint); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.dot--away    { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.dot--offline { background: #C2CDC8; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 11px 22px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 600;
  background: #FBFCFC;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: #FAFCFB; }
.table .num { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 550;
  margin-bottom: 6px; color: var(--text);
}
.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(45,106,79,.13);
}
.textarea { min-height: 108px; resize: vertical; }
.hint { font-size: 12px; color: var(--faint); margin-top: 5px; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--r);
  font-size: 14px; margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert__icon { flex: none; font-size: 14px; line-height: 1.5; }
.alert--success { background: #ECFAF4; color: #08694C; border-color: #C9EDDE; }
.alert--error   { background: #FEF2F2; color: #9B1C1C; border-color: #FBD5D5; }
.alert--info    { background: var(--green-050); color: var(--green-600); border-color: var(--green-100); }
.alert--warning { background: #FFFAF0; color: #96620C; border-color: #FAE3B4; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty__icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--green-050);
  color: var(--green-500);
}
.empty__icon .ico-svg { width: 22px; height: 22px; }

/* ---------- Swatches (branding preview) ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.swatch { border-radius: var(--r); padding: 16px 14px; font-size: 12px; line-height: 1.5; }
.swatch b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 0%, var(--green-600) 0%, var(--green-900) 100%);
  padding: 24px;
}
.auth__card {
  width: 100%; max-width: 396px; background: #fff;
  border-radius: var(--r-xl); box-shadow: var(--sh-3);
  padding: 34px 30px;
}
.auth__logo { text-align: center; margin-bottom: 24px; }
.auth__logo img { height: 34px; }

/* ---------- Footer ---------- */
.app-foot {
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint);
  background: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    box-shadow: var(--sh-3);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-toggle { display: grid; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .app-foot { padding: 14px 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .stat { padding: 14px 15px 15px; }
  .stat__value { font-size: 25px; }
  h1 { font-size: 21px; }

  .card__head, .card__body, .table th, .table td { padding-left: 16px; padding-right: 16px; }
  .card { padding: 16px; }

  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(12,36,25,.45);
    backdrop-filter: blur(2px);
    z-index: 35; display: none;
  }
  .sidebar-overlay.is-open { display: block; }
}

@media (max-width: 600px) {
  .page-head h1 { font-size: 19px; }
  .stat-grid { gap: 9px; }
  .stat { padding: 12px 13px 13px; }
  .stat__value { font-size: 22px; }
  .stat__key { font-size: 10.5px; letter-spacing: .06em; }

  .card { padding: 14px; border-radius: 14px; }
  .card__head { padding: 13px 14px; }
  .card__body { padding: 14px; }
  .table th, .table td { padding-left: 13px; padding-right: 13px; }
  .table td { font-size: 13px; }

  /* Buttons stack cleanly instead of squashing */
  .btn { padding: 9px 14px; }
  .page-head > div:last-child .btn,
  .bulk-bar .btn { width: auto; }

  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs a { white-space: nowrap; }

  .chip { padding: 5px 10px; font-size: 12px; }

  .preview-bar { font-size: 12px; padding: 9px 14px; }

  /* Forms side by side become stacked */
  .field label { font-size: 12.5px; }
  .input, .select, .textarea { font-size: 16px; }  /* stops iOS zooming in */
}

@media print {
  .sidebar, .topbar, .app-foot, .preview-bar,
  .btn, .chip, .help-btn, .bulk-bar { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  .card { border-color: #ddd !important; box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
