:root {
  --ink: #0b0c0e;
  --ink-2: #17191d;
  --yellow: #ebed04;
  --paper: #f4f4ef;
  --white: #ffffff;
  --muted: #71737a;
  --line: #e2e3dc;
  --danger: #c92d2d;
  --success: #18794e;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.auth-body {
  align-items: center;
  background: radial-gradient(circle at 15% 15%, rgba(235,237,4,.22), transparent 30%), var(--ink);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  max-width: 470px;
  padding: 42px;
  width: 100%;
}

.auth-card > img { height: 100px; margin: 0 auto 26px; object-fit: contain; width: 130px; }
.auth-badge, .eyebrow-admin, .card-label { color: #756f00; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.auth-card h1 { font-size: 38px; letter-spacing: -.05em; line-height: 1; margin: 12px 0 14px; }
.auth-card > p { color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label, .settings-form label, .manager-fields label, .form-grid label, .security-form label { color: #51535a; display: grid; font-size: 12px; font-weight: 800; gap: 8px; }
input, textarea, select { background: white; border: 1px solid #d9dad3; border-radius: 10px; color: var(--ink); min-height: 46px; outline: none; padding: 11px 13px; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: #9d9e00; box-shadow: 0 0 0 3px rgba(235,237,4,.25); }
textarea { min-height: 95px; resize: vertical; }
.auth-form button, .save-button, .primary-action { align-items: center; background: var(--ink); border: 0; border-radius: 999px; color: white; display: inline-flex; font-weight: 900; justify-content: center; min-height: 50px; padding: 0 24px; }
.auth-form button { background: var(--yellow); color: var(--ink); margin-top: 3px; width: 100%; }
.back-link { color: var(--muted); display: block; font-size: 12px; font-weight: 800; margin-top: 24px; text-align: center; }

.install-card { max-width: 720px; }
.install-card > img { height: 82px; margin-bottom: 18px; }
.install-form h2 { font-size: 20px; letter-spacing: -.025em; margin: 0; }
.install-grid { display: grid; gap: 15px; grid-template-columns: 1fr 130px; }
.install-grid label:nth-child(3), .install-grid label:nth-child(4) { grid-column: span 1; }
.install-grid .install-full { grid-column: 1 / -1; }
.install-separator { border-top: 1px solid var(--line); margin: 5px 0; }

.alert { border-radius: 11px; font-size: 13px; font-weight: 800; margin-bottom: 20px; padding: 14px 17px; }
.alert.error { background: #fff0f0; border: 1px solid #f4cccc; color: #9f2222; }
.alert.success { background: #eaf8f1; border: 1px solid #bce3ce; color: var(--success); }

.admin-body { min-height: 100vh; }
.sidebar { background: var(--ink); bottom: 0; color: white; display: flex; flex-direction: column; left: 0; padding: 24px 16px; position: fixed; top: 0; width: 260px; z-index: 20; }
.admin-brand { align-items: center; display: flex; gap: 12px; margin: 0 8px 34px; }
.admin-brand img { height: 64px; object-fit: contain; width: 70px; }
.admin-brand div { display: flex; flex-direction: column; gap: 4px; }
.admin-brand strong { font-size: 14px; }
.admin-brand span { color: rgba(255,255,255,.42); font-size: 10px; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { align-items: center; border-radius: 10px; color: rgba(255,255,255,.62); display: flex; font-size: 13px; font-weight: 800; gap: 13px; padding: 13px 14px; transition: .18s ease; }
.sidebar nav a span { align-items: center; display: flex; font-size: 15px; justify-content: center; width: 18px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: white; }
.sidebar nav a.active { background: var(--yellow); color: var(--ink); }
.sidebar-bottom { border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 9px; margin-top: auto; padding: 20px 9px 0; }
.sidebar-bottom a, .sidebar-bottom button { background: transparent; border: 0; color: rgba(255,255,255,.6); font-size: 12px; font-weight: 800; padding: 6px 0; text-align: left; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--yellow); }

.admin-main { margin-left: 260px; min-height: 100vh; }
.admin-topbar { align-items: center; background: rgba(255,255,255,.91); border-bottom: 1px solid var(--line); display: flex; height: 74px; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; backdrop-filter: blur(12px); z-index: 15; }
.admin-topbar > div { display: flex; flex-direction: column; gap: 2px; }
.admin-topbar span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.admin-topbar strong { font-size: 14px; }
.admin-topbar > a { background: var(--yellow); border-radius: 999px; font-size: 12px; font-weight: 900; padding: 11px 17px; }
.menu-toggle { background: transparent; border: 0; display: none; font-size: 23px; }
.admin-content { margin: 0 auto; max-width: 1460px; padding: 48px 42px 80px; }

.page-heading { align-items: end; display: flex; gap: 28px; justify-content: space-between; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(38px, 5vw, 64px); letter-spacing: -.055em; line-height: 1; margin: 9px 0 11px; }
.page-heading p { color: var(--muted); margin: 0; }
.primary-action { font-size: 12px; min-height: 46px; white-space: nowrap; }

.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.stats-grid article { background: white; border: 1px solid var(--line); border-radius: 17px; display: flex; flex-direction: column; min-height: 170px; padding: 22px; }
.stats-grid article > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.stats-grid strong { font-size: 48px; letter-spacing: -.05em; margin: 14px 0 auto; }
.stats-grid a { font-size: 11px; font-weight: 900; }
.dashboard-grid { display: grid; gap: 20px; grid-template-columns: 1.3fr .7fr; }
.panel-card { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 40px rgba(11,12,14,.04); padding: 28px; }
.panel-card h2 { font-size: 25px; letter-spacing: -.035em; margin: 9px 0 22px; }
.quick-links { border-top: 1px solid var(--line); display: grid; }
.quick-links a { align-items: center; border-bottom: 1px solid var(--line); display: flex; font-size: 13px; font-weight: 800; justify-content: space-between; padding: 17px 0; }
.quick-links a:hover { color: #777800; }
.status-card { position: relative; }
.status-dot { background: #32bc74; border: 5px solid #dff5e9; border-radius: 50%; display: block; height: 18px; width: 18px; }
.status-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.status-card > div { border-top: 1px solid var(--line); display: flex; font-size: 12px; justify-content: space-between; padding: 15px 0; }
.status-card > div strong { color: var(--success); }

.settings-form { display: grid; gap: 32px; }
.form-section { border-bottom: 1px solid var(--line); padding-bottom: 31px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2, .add-form h2, .security-form h2 { font-size: 20px; letter-spacing: -.025em; margin: 0 0 20px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.save-button { justify-self: start; }

.manager-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.manager-card { background: white; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.manager-image { aspect-ratio: 16 / 10; background: #ebebe7; overflow: hidden; }
.manager-image.wide { aspect-ratio: 16 / 8; }
.manager-image.logo { aspect-ratio: 1.3 / 1; }
.manager-image img { height: 100%; object-fit: cover; width: 100%; }
.manager-image.logo img { object-fit: contain; padding: 18px; }
.manager-fields { display: grid; gap: 15px; padding: 21px; }
.manager-fields input[type="file"] { font-size: 11px; padding: 8px; }
.switch { align-items: center; display: flex !important; flex-direction: row; gap: 9px !important; }
.switch input[type="checkbox"] { accent-color: #c6c800; min-height: 19px; width: 19px; }
.item-actions { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 7px; padding: 13px 18px; }
.item-actions button { background: #f1f1ed; border: 0; border-radius: 8px; font-size: 11px; font-weight: 900; min-height: 35px; padding: 0 11px; }
.item-actions .save-small { background: var(--ink); color: white; margin-left: auto; }
.item-actions .danger { background: #fff0f0; color: var(--danger); }
.add-form { margin-top: 25px; }
.add-form .save-button { margin-top: 22px; }

.list-manager { display: grid; gap: 12px; }
.list-row { align-items: end; background: white; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 18px; grid-template-columns: 1fr auto auto; padding: 18px; }
.list-row .form-grid { min-width: 0; }
.list-row .item-actions { border: 0; padding: 0; }
.security-form { display: grid; gap: 17px; max-width: 600px; }
.security-form .save-button { margin-top: 6px; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .manager-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-row { grid-template-columns: 1fr; }
  .list-row .switch { justify-self: start; }
  .list-row .item-actions { justify-self: stretch; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: block; }
  .admin-topbar { padding: 0 18px; }
  .admin-topbar > div { margin-right: auto; margin-left: 10px; }
  .admin-content { padding: 35px 18px 70px; }
  .dashboard-grid, .manager-grid { grid-template-columns: 1fr; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .auth-card { padding: 30px 22px; }
  .auth-card h1 { font-size: 34px; }
  .install-grid { grid-template-columns: 1fr; }
  .install-grid .install-full { grid-column: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid article { min-height: 145px; padding: 17px; }
  .stats-grid strong { font-size: 38px; }
  .admin-topbar > a { font-size: 0; padding: 11px; }
  .admin-topbar > a::after { content: '↗'; font-size: 16px; }
  .item-actions { flex-wrap: wrap; }
}
