:root {
  --brand: #FF9900;
  --brand-600: #e68900;
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #ef4444;
  --ok: #16a34a;
  --border: #e5e7eb;
}

/* Reset & base */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand-600); text-decoration: none; } 

/* Container */
.container {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}

/* Buttons — unified style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  height: 36px;                         /* consistent button height */
  border-radius: 10px;                  /* same rounded shape */
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s;
  line-height: 1;
  white-space: nowrap;                  /* keep labels on one line */
  max-width: 100%;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

/* Primary button */
.btn-primary {
  background: var(--brand);
  border-color: var(--brand-600);
  color: #111827;
  font-weight: 600;
}

/* Make all toolbar buttons auto-align equal width inside a card */
.card .toolbar .btn,
.card > div .btn {
  flex: 1 1 0;             /* distribute equally across row */
  text-align: center;
}

/* On desktop, keep natural width if needed */
@media (min-width: 641px) {
  .card .toolbar .btn,
  .card > div .btn {
    flex: 0 0 auto;        /* revert to natural width */
  }
}


/* Delete button: same shape/size but red */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: #dc2626;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.04);
}

/* Tables */
.table-wrap {
  overflow-x: auto;                      /* allow horizontal scroll on small screens */
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Keep table text on a single line; rely on horizontal scroll */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;                      /* keeps columns readable */
  white-space: nowrap;                   /* <— no wrapping anywhere in table */
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;                /* better alignment for buttons & inputs */
}

th {
  background: #fff8ee;
  color: #111827;
  position: sticky;
  top: 0;
}

tr:hover td { background: #fffdfa; }

/* Badges */
.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3e6;
  color: #92400e;
  border: 1px solid #fed7aa;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Inputs (smaller, less tall) */
input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;                     /* smaller height than before */
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.35;
  display: block;
}

/* Mobile: keep compact fields but still comfortable to tap */
@media (max-width: 520px) {
  input, select, textarea {
    font-size: 14px;                     /* smaller than 16px to reduce height */
    padding: 7px 10px;                   /* compact touch target */
  }
}

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

/* Filter form buttons look consistent */
form .btn { height: 36px; }

/* Top toolbars (Export/Import/+New) are often inside flex containers with wrap.
   Make buttons behave nicely on phones without changing HTML. */
@media (max-width: 640px) {
  .card > div,
  .card > .toolbar,
  .card > .headerbar {
    row-gap: 8px;                         /* when they wrap, add breathing room */
  }
  .card > div .btn,
  .toolbar .btn,
  .headerbar .btn {
    height: 34px;
    padding: 7px 10px;
  }
}

/* Actions column — keep buttons on ONE row; table scrolls if needed */
.actions {
  display: flex;
  flex-wrap: nowrap;                      /* never wrap onto a second line */
  gap: 8px;
  align-items: center;
  min-width: 260px;                       /* reserve enough width for 3 buttons */
  white-space: nowrap;                    /* keep text in one line */
}
.actions .btn {
  flex: 0 0 auto;                         /* don't stretch, keep natural size */
  padding: 8px 12px;
  height: 36px;
  min-width: 82px;                        /* consistent width so three fit nicely */
}

/* Footer */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px 0 40px;
}

/* ==============================
   Header/sidebar styles are isolated
   in header.php (scoped to .app-shell)
   ============================== */

   