@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f0f5f2;
  --surface: #ffffff;
  --surface-2: #e8f0ec;
  --surface-3: #f7faf8;
  --text: #0f1f1a;
  --muted: #56706a;
  --line: #d4e2db;
  --accent: #0a7a5e;
  --accent-hover: #08604a;
  --accent-2: #c0422a;
  --accent-2-hover: #a13420;
  --sidebar-bg: #0c1c17;
  --sidebar-surface: rgba(255,255,255,0.06);
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text: #c8dbd5;
  --sidebar-active-bg: #ffffff;
  --sidebar-active-text: #0c1c17;
  --sidebar-badge: #f0b830;
  --shadow-sm: 0 2px 8px rgba(10, 28, 22, 0.06);
  --shadow: 0 8px 28px rgba(10, 28, 22, 0.08);
  --shadow-lg: 0 20px 60px rgba(10, 28, 22, 0.10);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-width: 268px;
  --topbar-h: 68px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(272px, 82vw);
  padding: 16px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 100;
  /* Hidden by default on mobile */
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 280ms ease;
}

.sidebar.is-open {
  transform: translateX(0);
  box-shadow: 4px 0 48px rgba(10, 22, 18, 0.32);
}

.sidebar::-webkit-scrollbar { display: none; }

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--sidebar-surface);
  margin-bottom: 6px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5d55c 0%, #d99c30 100%);
  color: #0c1c17;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(213, 162, 48, 0.30);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #e8f4ef;
  line-height: 1.2;
}

.brand small {
  font-size: 11px;
  color: #7a9e94;
  margin-top: 2px;
}

/* sidebar section label */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4d6b63;
  padding: 10px 8px 4px;
}

/* nav links */
.sidebar-nav {
  display: grid;
  gap: 2px;
}

.sidebar-nav a,
.logout button {
  border: 0;
  border-radius: var(--radius);
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  color: var(--sidebar-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-nav a:hover,
.logout button:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.sidebar-nav a.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.sidebar-nav a.is-active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px -4px;
  width: 3px;
  border-radius: 999px;
  background: var(--sidebar-badge);
}

.nav-icon {
  width: 17px !important;
  height: 17px !important;
  max-width: 17px;
  max-height: 17px;
  flex: 0 0 17px;
  fill: currentColor;
  display: block;
  opacity: 0.75;
}

.sidebar .nav-icon {
  inline-size: 17px !important;
  block-size: 17px !important;
}

.sidebar-nav a.is-active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  opacity: 1;
}

.sidebar-nav a span,
.logout button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* logout */
.logout {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--sidebar-border);
}

.logout button {
  width: 100%;
  color: #f4b8ad;
  background: rgba(192, 66, 42, 0.12);
  border-radius: var(--radius);
}

.logout button:hover {
  background: rgba(192, 66, 42, 0.22) !important;
  color: #ffcfc7 !important;
}

/* ─── MAIN CONTENT ────────────────────────────────────── */
.main {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: auto;
  min-height: var(--topbar-h);
  background: rgba(240, 245, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.topbar-left > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
}

p { margin: 0; }

.topbar p {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* page content wrapper */
.page-content {
  padding: 16px 16px 36px;
  flex: 1;
}

/* ─── FILTERS ─────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-end;
}

.filters label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── TOOLBAR ─────────────────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 18px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  transition: background 140ms;
}

.button-link:hover { background: var(--accent-hover); }

.edit-details {
  margin-bottom: 8px;
}

.edit-details summary {
  min-height: 34px;
  border-radius: 10px;
  padding: 7px 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.edit-transaction-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
  min-width: min(520px, 80vw);
}

.edit-transaction-form input,
.edit-transaction-form select {
  min-height: 36px;
}

.edit-transaction-form button {
  min-height: 36px;
}

/* ─── FORM INPUTS ─────────────────────────────────────── */
.login-form label,
.entry-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select,
input,
textarea {
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 140ms, box-shadow 140ms;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 122, 94, 0.12);
}

textarea {
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

/* ─── STATS ───────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats article {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 160ms, transform 160ms;
}

.stats article:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stats article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--accent), var(--sidebar-badge));
}

.stats span {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ─── PANELS / CARDS ──────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

/* ─── ENTRY FORMS ─────────────────────────────────────── */
.entry-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
}

.entry-form .wide {
  grid-column: span 1; /* mobile: always 1 col */
}

.entry-form button,
.inline-form button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms;
  white-space: nowrap;
}

.entry-form button:hover,
.inline-form button:hover {
  background: var(--accent-hover);
}

.inline-form { margin: 0; }

/* ─── ACTION ROWS ─────────────────────────────────────── */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-row button { min-height: 32px; }

.reset-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.reset-form input {
  width: 180px;
  min-height: 34px;
}

.reset-form button { min-height: 34px; }

.danger-button {
  background: var(--accent-2) !important;
}

.danger-button:hover {
  background: var(--accent-2-hover) !important;
}

/* ─── MISC ────────────────────────────────────────────── */
.muted {
  color: var(--muted);
  font-size: 13px;
}

/* ─── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.badge--green  { background: #dcfce7; color: #166534; }
.badge--red    { background: #fee2e2; color: #991b1b; }
.badge--blue   { background: #dbeafe; color: #1e40af; }
.badge--amber  { background: #fef3c7; color: #92400e; }
.badge--gray   { background: #f1f5f9; color: #475569; }
.badge--purple { background: #ede9fe; color: #5b21b6; }

.thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ─── FAVICON PREVIEW ─────────────────────────────────── */
.favicon-preview {
  min-height: 68px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  gap: 12px;
}

.favicon-preview img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  border: 1.5px solid var(--line);
}

.favicon-preview span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

/* ─── TABLE ───────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13.5px;
}

th {
  background: var(--surface-3);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

tr:hover td { background: var(--surface-3); }
tr:last-child td { border-bottom: 0; }

/* ─── LOGIN PAGE ──────────────────────────────────────── */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(10,122,94,0.14) 0, transparent 38%),
    radial-gradient(circle at 88% 80%, rgba(192,66,42,0.10) 0, transparent 36%),
    #e8f2ed;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.login-brand {
  margin-bottom: 28px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms, transform 120ms;
}

.login-form button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.login-form button:active { transform: none; }

/* ─── SWEET ALERT ─────────────────────────────────────── */
.sweet-alert {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  animation: alert-fade-in 160ms ease-out;
}

.sweet-alert.is-closing {
  animation: alert-fade-out 180ms ease-in forwards;
}

.sweet-alert__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 15, 0.44);
  backdrop-filter: blur(6px);
}

.sweet-alert__dialog {
  position: relative;
  width: min(420px, 100%);
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-xl);
  background: #ffffff;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
  animation: alert-pop-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sweet-alert__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border: 2.5px solid currentColor;
  color: var(--accent);
}

.sweet-alert__icon::before {
  content: "";
  width: 13px;
  height: 26px;
  border: solid currentColor;
  border-width: 0 3.5px 3.5px 0;
  transform: rotate(45deg);
  margin-top: -5px;
}

.sweet-alert.is-danger .sweet-alert__icon { color: var(--accent-2); }

.sweet-alert.is-danger .sweet-alert__icon::before {
  width: 26px;
  height: 26px;
  border: 0;
  margin: 0;
  background:
    linear-gradient(currentColor, currentColor) center/3.5px 32px no-repeat,
    linear-gradient(currentColor, currentColor) center/32px 3.5px no-repeat;
  transform: rotate(45deg);
}

.sweet-alert.is-warning .sweet-alert__icon,
.sweet-alert.is-info .sweet-alert__icon { color: #d7972a; }

.sweet-alert.is-warning .sweet-alert__icon::before,
.sweet-alert.is-info .sweet-alert__icon::before {
  content: "!";
  width: auto; height: auto; border: 0; margin: 0;
  transform: none; font-size: 32px; font-weight: 900;
}

.sweet-alert h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.sweet-alert p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.sweet-alert button {
  min-width: 110px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  margin-top: 22px;
  padding: 0 20px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms;
}

.sweet-alert button:hover { background: var(--accent-hover); }

.sweet-alert__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.sweet-alert__actions button { margin-top: 0; }

.sweet-alert button.sweet-alert__cancel {
  background: var(--surface-2);
  color: var(--text);
}

.sweet-alert button.sweet-alert__cancel:hover { background: var(--line); }

.sweet-alert button.sweet-alert__confirm { background: var(--accent-2); }
.sweet-alert button.sweet-alert__confirm:hover { background: var(--accent-2-hover); }

.sweet-alert.is-danger button { background: var(--accent-2); }
.sweet-alert.is-danger button:hover { background: var(--accent-2-hover); }

.sweet-alert.is-danger button.sweet-alert__cancel {
  background: var(--surface-2);
  color: var(--text);
}

.sweet-alert__timer {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: linear-gradient(90deg, var(--accent), var(--sidebar-badge));
  transform-origin: left;
  animation: alert-timer 5s linear forwards;
}

.sweet-alert.is-danger .sweet-alert__timer {
  background: linear-gradient(90deg, var(--accent-2), var(--sidebar-badge));
}

/* ─── KEYFRAMES ───────────────────────────────────────── */
@keyframes alert-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes alert-fade-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes alert-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes alert-timer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ─── TABLE SEARCH ────────────────────────────────────── */
.table-search {
  margin-bottom: 10px;
}

.table-search__input {
  width: 100%;
  max-width: 340px;
  min-height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 12px 0 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%2356706a' d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 11px center;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  transition: border-color 140ms, box-shadow 140ms;
  outline: none;
}

.table-search__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 122, 94, 0.12);
}

/* ─── TABLE PAGINATION ────────────────────────────────── */
.table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0 2px;
  min-height: 44px;
}

.table-pager__count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.table-pager__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table-pager__btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-pager__btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: rgba(10, 122, 94, 0.16);
  color: var(--accent);
}

.table-pager__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(10, 122, 94, 0.18);
}

.table-pager__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.table-pager__btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.table-pager__btn--nav {
  min-width: 98px;
  font-size: 12px;
  font-weight: 700;
}

.table-pager__sep {
  font-size: 13px;
  color: var(--muted);
  padding: 0 2px;
}

/* ─── TOPBAR EXTRAS ───────────────────────────────────── */
.topbar-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.topbar-left > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}



/* ─── SIDEBAR OVERLAY ─────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(10, 20, 16, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.is-open { display: block; }

/* ─── HAMBURGER ───────────────────────────────────────── */
.menu-toggle {
  display: flex;  /* Visible by default (mobile-first) */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 220ms ease, opacity 200ms ease;
}

.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── BRAND LOGO IMAGE ────────────────────────────────── */
.brand-logo {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ─── RESPONSIVE: mobile baseline ────────────────────── */
/* Default (mobile): sidebar hidden as drawer, no left margin */
/* ─── RESPONSIVE: tablet (≥640px) ────────────────────── */
@media (min-width: 640px) {
  .topbar { padding: 0 20px; height: var(--topbar-h); }
  .page-content { padding: 20px 20px 36px; }

  .entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .entry-form .wide { grid-column: span 2; }
}

/* ─── RESPONSIVE: desktop (≥1100px) ──────────────────── */
@media (min-width: 1100px) {
  /* Sidebar permanently visible */
  .sidebar {
    width: var(--sidebar-width);
    transform: none !important;
    box-shadow: none !important;
    transition: none;
  }

  .sidebar-overlay { display: none !important; }
  .menu-toggle { display: none !important; }

  .main { margin-left: var(--sidebar-width); }

  .topbar {
    height: var(--topbar-h);
    padding: 0 28px;
  }

  .page-content { padding: 24px 28px 40px; }

  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* Restore multi-column form variants on desktop */
  .entry-form { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
  .entry-form .wide { grid-column: span 2; }
  .entry-form button { grid-column: auto; }

  .profile-form  { grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; }
  .product-form  { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
  .content-form  { grid-template-columns: minmax(130px, 0.7fr) repeat(2, minmax(160px, 1fr)) auto; }
  .compact-form  { grid-template-columns: minmax(130px, 0.5fr) minmax(200px, 1fr) auto; }
  .contact-form  { grid-template-columns: minmax(130px, 0.7fr) repeat(3, minmax(140px, 1fr)) auto; }
  .settings-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .user-form     { grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; }
}

/* ─── RESPONSIVE: small mobile (≤480px) ──────────────── */
@media (max-width: 480px) {
  .brand small { display: none; }

  .stats { grid-template-columns: 1fr 1fr; }

  .profile-form,
  .product-form,
  .content-form,
  .compact-form,
  .contact-form,
  .settings-form,
  .user-form {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 18px; }
  .panel { padding: 14px; }
  .table-search__input { max-width: 100%; }

  /* Pagination: stack vertically */
  .table-pager {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .table-pager__count {
    text-align: center;
    justify-content: center;
  }

  .table-pager__controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .table-pager__btn--nav {
    min-width: 0;
    flex: 1 1 auto;
  }

  /* Hide page number buttons, keep only prev/next */
  .table-pager__btn:not(.table-pager__btn--nav):not(.is-active),
  .table-pager__sep {
    display: none;
  }
}
