/* ZantaSoft — shared polish layer.
   Intent: comfortable, consistent styling WITHOUT rewriting every view's
   Tailwind classes. Tailwind utility classes in the views still win where
   they set a property (class selectors beat the element selectors below),
   so this file only fills gaps: focus rings, form feel, table readability,
   badges, alerts, pagination, empty states, and the mobile drawer.
   Palette: warm off-white page, dark slate text, white cards.
   Colour is used as small accents only — never as full-page blocks.
   Gradients live only in: brand strips, stat icon chips, primary buttons. */

:root {
  --zs-page: #f7f6f3;
  --zs-card: #ffffff;
  --zs-text: #1e293b;
  --zs-muted: #64748b;
  --zs-border: #e2e8f0;
  --zs-teal: #0f766e;
  --zs-teal-soft: #ccfbf1;
  --zs-focus: #0d9488;
  --zs-radius: 1rem;
  --zs-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--zs-page);
  color: var(--zs-text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Forms: comfortable inputs, visible focus, no surprises ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  color: var(--zs-text);
  width: 100%;
}

/* Only add padding where a view did not already set it via Tailwind. */
input:not([class*="px-"]):not([class*="p-"]),
select:not([class*="px-"]):not([class*="p-"]),
textarea:not([class*="px-"]):not([class*="p-"]) { padding: 0.625rem 0.875rem; }
input:not([class*="py-"]):not([class*="p-"]),
select:not([class*="py-"]):not([class*="p-"]),
textarea:not([class*="py-"]):not([class*="p-"]) { padding-top: 0.625rem; padding-bottom: 0.625rem; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--zs-focus);
  outline: 2px solid rgba(13, 148, 136, 0.35);
  outline-offset: 1px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--zs-teal);
  flex-shrink: 0;
}

label { color: var(--zs-text); }
::placeholder { color: #94a3b8; }

/* ---------- Buttons: primary is obvious, secondary/danger are muted ---------- */
/* Views keep their own Tailwind button classes; these helpers are for any
   button that needs an explicit role, and they never hide which button
   submits: primary = solid gradient, secondary = white/bordered,
   danger = muted red outline, never a solid red block. */
.zs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.625rem 1.125rem;
  font-weight: 600;
  font-size: 0.925rem;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.zs-btn:active { transform: translateY(1px); }
.zs-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}
.zs-btn-primary:hover { background: linear-gradient(135deg, #115e59, #0f766e); }
.zs-btn-secondary {
  color: var(--zs-text);
  background: #fff;
  border-color: var(--zs-border);
}
.zs-btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.zs-btn-danger {
  color: #be123c;
  background: #fff;
  border-color: #fecdd3;
}
.zs-btn-danger:hover { background: #fff1f2; }

/* A submit button that a view already styles with Tailwind keeps its look;
   this only guarantees a visible keyboard focus ring on every button. */
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.55);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* ---------- Cards, tables, badges, alerts ---------- */
.zs-card {
  background: var(--zs-card);
  border: 1px solid #eef2f7;
  border-radius: var(--zs-radius);
  box-shadow: var(--zs-shadow);
}

table { border-collapse: collapse; }
thead th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zs-muted);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr { transition: background-color 0.12s ease; }
tbody tr:hover { background-color: #f8fafc; }
/* Numbers already right-aligned by views (text-right) stay right-aligned. */

.zs-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}
.zs-badge-teal { background: #ccfbf1; color: #115e59; }
.zs-badge-indigo { background: #e0e7ff; color: #3730a3; }
.zs-badge-amber { background: #fef3c7; color: #92400e; }
.zs-badge-rose { background: #ffe4e6; color: #9f1239; }
.zs-badge-emerald { background: #d1fae5; color: #065f46; }
.zs-badge-slate { background: #f1f5f9; color: #475569; }

/* Alert helpers (views using Tailwind alert classes keep their own look). */
.zs-alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 0.75rem; padding: 0.75rem 1rem; }
.zs-alert-error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: 0.75rem; padding: 0.75rem 1rem; }

/* Empty states: centred, muted, helpful — never a bare blank table. */
.zs-empty {
  text-align: center;
  color: var(--zs-muted);
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
}

/* ---------- Pagination (Laravel links) ---------- */
nav[role="navigation"] a,
nav[role="navigation"] span {
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
}
nav[role="navigation"] a:hover { background: #f1f5f9; }

/* ---------- Mobile drawer (slide-over) ---------- */
/* Pure-CSS toggle: a hidden checkbox drives the drawer + backdrop.
   The tiny script in layouts/app.blade.php unchecks it when a link is
   tapped or Escape is pressed, so the menu always closes after tapping.
   On md+ screens the drawer is never shown; the desktop sidebar is used. */
.zs-nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.zs-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(19rem, 86vw);
  z-index: 50;
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  visibility: hidden;
  background-color: #ffffff; /* light drawer, never dark */
  color: #1e293b;
  border-right: 1px solid #e2e8f0;
}
.zs-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.zs-nav-toggle:checked ~ .zs-drawer {
  transform: translateX(0);
  visibility: visible;
}
.zs-nav-toggle:checked ~ .zs-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .zs-drawer,
  .zs-drawer-backdrop { display: none !important; }
}

/* ---------- Light sidebar + icon chips (design v2: no dark sidebar) ---------- */
/* Sidebar and drawer are light (white / very light warm) with dark slate
   text. Links get a soft-tinted icon chip and a tinted hover background
   with a coloured left accent — never a dark block. */
.zs-sidebar {
  background-color: #faf9f7;
  color: #1e293b;
  border-right: 1px solid #e2e8f0;
}
.zs-sidebar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.zs-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}
.zs-icon-chip svg { width: 1.25rem; height: 1.25rem; }
.zs-menu-link {
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  border-left: 4px solid transparent;
}
.zs-menu-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-left-color: #0d9488;
}
.zs-menu-link:focus-visible {
  background-color: #f1f5f9;
  border-left-color: #0d9488;
}
/* Brand logo: white-background logo sits on light surfaces only. */
.zs-brand-logo { background: #fff; border-radius: 0.5rem; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
