:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --panel: #fbfaf7;
  --surface: #ffffff;
  --text: #2d2926;
  --muted: #6f6a63;
  --line: #d8d2c6;
  --accent: #00d1d2;
  --accent-dark: #007377;
  --accent-soft: #e3f7f6;
  --purple: #5f4a86;
  --danger: #ad2f2f;
  --ok: #087357;
}

@font-face {
  font-family: "IQOS Sans";
  src: url("fonts/IQOSSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IQOS Sans";
  src: url("fonts/IQOSSans-Bold.otf") format("opentype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IQOS Sans", Arial, Helvetica, sans-serif;
  background:
    linear-gradient(135deg, rgba(0, 209, 210, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(95, 74, 134, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.logout-fixed {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 20;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(45, 41, 38, 0.14);
  border-radius: 999px;
  background: rgba(251, 250, 247, 0.86);
  color: var(--text);
  padding: 0 16px;
  backdrop-filter: blur(10px);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  padding: 0;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.panel {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid rgba(216, 210, 198, 0.86);
  border-radius: 8px;
  padding: 34px;
  box-shadow: 0 22px 70px rgba(45, 41, 38, 0.09);
}

.app-shell > .panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding-block: 58px;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
}

.admin-shell .panel { width: 100%; margin-top: 18px; }

.brand { text-align: center; margin-bottom: 28px; }
.brand img, .admin-header img {
  max-width: 138px;
  max-height: 64px;
  object-fit: contain;
}

h1, h2 { margin: 0 0 18px; line-height: 1.15; }
h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
}
h2 {
  font-size: 22px;
  font-weight: 800;
}

.form { display: grid; gap: 18px; }
.compact { gap: 12px; }

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 58px;
  border: 1px solid #cbc4b7;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  padding: 0 16px;
}

input:focus, select:focus {
  outline: 4px solid rgba(0, 209, 210, 0.18);
  border-color: var(--accent-dark);
}

button, .button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0 24px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

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

button.secondary, .button.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.check {
  grid-template-columns: 26px 1fr;
  align-items: start;
  font-weight: 500;
  line-height: 1.38;
  color: var(--text);
}

.check input {
  min-height: auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--accent-dark);
}

.alert {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 700;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.alert.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.success { background: #e4f7ef; color: var(--ok); }
.error { background: #ffe9e9; color: var(--danger); }
.warning { background: #fff4d5; color: #7a5600; }
.warning ul { margin: 8px 0 0; padding-left: 20px; }
.muted { color: var(--muted); margin: 0 0 16px; }

.topline, .section-title, .admin-header, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-header {
  background: var(--panel);
  border: 1px solid rgba(216, 210, 198, 0.86);
  border-radius: 8px;
  padding: 18px 22px;
  box-shadow: 0 14px 40px rgba(45, 41, 38, 0.07);
}

.admin-header nav { display: flex; gap: 16px; flex-wrap: wrap; }

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compact-grid { gap: 12px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.products-table { min-width: 560px; }
.inline-form { display: inline-flex; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  background: #eee;
}
.status.sent { background: #e4f7ef; color: var(--ok); }
.status.error { background: #ffe9e9; color: var(--danger); }
.status.queued { background: #fff4d5; color: #8a6100; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface);
  font-weight: 700;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: min(420px, calc(100% - 32px));
}

dialog::backdrop { background: rgba(0, 0, 0, 0.36); }

@media (max-width: 760px) {
  .app-shell { padding: 0; }
  .admin-shell { padding: 14px; }
  .panel { padding: 22px; }
  .app-shell > .panel { padding-top: 72px; }
  .logout-fixed { top: 14px; right: 14px; }
  .grid.two { grid-template-columns: 1fr; }
  .topline, .section-title, .admin-header { align-items: flex-start; flex-direction: column; }
  button, .button { width: 100%; }
  .admin-header nav, .actions { width: 100%; flex-direction: column; align-items: stretch; }
}
