:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #edf2f8;
  --line: #d7e0ea;
  --text: #18222f;
  --muted: #617082;
  --brand: #0f6cbd;
  --brand-deep: #11345f;
  --accent: #d96c1f;
  --success-bg: #e6f8ed;
  --success-text: #1a7f45;
  --pending-bg: #fff2dd;
  --pending-text: #a05f00;
  --danger: #b42318;
  --shadow: 0 22px 44px rgba(17, 42, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(15, 108, 189, 0.16), transparent 24%),
    radial-gradient(circle at bottom left, rgba(217, 108, 31, 0.12), transparent 22%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 32px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-panel h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px 24px;
  background: linear-gradient(180deg, #102238 0%, #17385b 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar h2 {
  margin: 6px 0 0;
  font-size: 30px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  border: 0;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.session-label {
  color: rgba(255, 255, 255, 0.76);
}

.main {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.view-section {
  display: grid;
  gap: 22px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.page-header h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 4vw, 42px);
}

.page-header p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: var(--panel-soft);
}

.filter-tab {
  border: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--brand-deep);
  font-weight: 700;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--brand);
  color: #fff;
}

.card {
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.82);
}

.table-card {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.empty-cell,
.empty-panel {
  text-align: center;
  color: var(--muted);
}

.empty-panel {
  padding: 36px 18px;
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.editor-card {
  padding: 22px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.editor-header h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 180px;
}

.checkbox-line {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
}

.checkbox-line input {
  width: auto;
  margin: 0;
}

.checkbox-card-line {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.button-row,
.table-actions,
.flyer-links,
.flyer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  padding: 11px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.button:hover {
  filter: brightness(1.06);
}

.button-secondary {
  background: #dfe8f3;
  color: var(--brand-deep);
}

.button-ghost {
  background: var(--panel-soft);
  color: var(--brand-deep);
}

.button-danger {
  background: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  filter: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-active,
.badge-approved {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-inactive,
.badge-pending {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.badge-expired {
  background: #fbe8e8;
  color: #a23030;
}

.badge-rejected {
  background: #fde7e7;
  color: #b42318;
}

.muted {
  color: var(--muted);
}

.wrap {
  word-break: break-word;
}

.flyers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.flyer-card {
  overflow: hidden;
}

.flyer-banner {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  background: linear-gradient(180deg, #d8e5f2, #edf3f8);
}

.flyer-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.flyer-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.status-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.flyer-title {
  margin: 0;
  font-size: 22px;
}

.flyer-store {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-deep);
}

.flyer-store span {
  color: var(--muted);
  font-weight: 600;
}

.flyer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  font-size: 14px;
}

.flyer-meta strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #16324f;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

.toast.error {
  background: #8f1d1d;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .page-header,
  .toolbar,
  .editor-header,
  .flyer-top {
    gap: 14px;
  }

  .page-header,
  .toolbar,
  .editor-header {
    flex-direction: column;
    align-items: stretch;
  }
}
