:root {
  color-scheme: light;
  
  /* Mockup-Accurate Light Palette */
  --bg-app: #f4f6f9;             /* Light cool-grey canvas */
  --bg-sidebar: #ffffff;         /* Pure white sidebar */
  --bg-surface: #ffffff;         /* Pure white cards */
  --bg-surface-hover: #f1f3f6;   /* Subtle grey hover */
  
  /* Status Accent Colors */
  --color-complete: #70bd46;     /* Safe Olive Green */
  --color-complete-bg: #e2f0d9;
  --color-complete-border: #c5e0b4;
  --color-complete-text: #385723;
  
  --color-ordered: #ed7d31;      /* Safety Orange */
  --color-ordered-bg: #fff2cc;
  --color-ordered-border: #f8cbad;
  --color-ordered-text: #c65911;
  
  --color-shipped: #4472c4;      /* Soft Royal Blue */
  --color-shipped-bg: #ddebf7;
  --color-shipped-border: #b4c6e7;
  --color-shipped-text: #1f4e78;
  
  --color-missing: #7f7f7f;      /* Steel Grey */
  --color-missing-bg: #f2f2f2;
  --color-missing-border: #d9d9d9;
  --color-missing-text: #7f7f7f;
  
  --color-alert-bg: #fce4ec;     /* Cyber Pink/Red for alerts */
  --color-alert-border: #f8bbd0;
  --color-alert-text: #c2185b;
  
  /* Neutral Palette */
  --ink: #333333;                /* Dark Ink Text */
  --muted: #595959;              /* Slate Muted Text */
  --line: #e2e5ec;               /* Muted border line */
  --line-light: #f0f2f5;
  
  /* Depth & Radii */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(31, 41, 55, 0.05);
  --shadow-pop: 0 12px 28px rgba(31, 41, 55, 0.10);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --motion-fast: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-smooth: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #ccd0d8;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a8b5;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-app);
  color: var(--ink);
  font: 14px/1.55 var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

.mobile-menu-button,
.sidebar-overlay {
  display: none;
}

.mobile-menu-button {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  transition: transform var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.mobile-menu-button:hover {
  border-color: #ccd0d8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
}

.mobile-menu-button span {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-full);
  background: #1f2937;
  transition: transform var(--motion-smooth), opacity var(--motion-fast);
}

.mobile-menu-button span:nth-child(1) {
  transform: translateY(-6px);
}

.mobile-menu-button span:nth-child(3) {
  transform: translateY(6px);
}

body.drawer-open {
  overflow: hidden;
}

.drawer-open .mobile-menu-button span:nth-child(1) {
  transform: rotate(45deg);
}

.drawer-open .mobile-menu-button span:nth-child(2) {
  opacity: 0;
}

.drawer-open .mobile-menu-button span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Shell Layout */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* Clean White Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
  z-index: 10;
}

/* Brand Area */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-md);
  background: #f0f4f9;
  color: var(--ink);
  font-size: 20px;
  border: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Vault Token Panel */
.token-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fafbfd;
}

.token-panel label,
.sidebar-section-title {
  display: block;
  margin-bottom: 6px;
  color: #333333;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 4px;
}

.sidebar-section-title {
  margin-top: 10px;
  margin-bottom: 12px;
  color: #555555;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

/* Styled Form Inputs */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: #1e88e5;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

/* Sidebar Nav links */
.series-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: #f1f4f9;
  transform: translateX(2px);
}

.nav-link.active {
  background: #e6f0fa;
  color: #1e88e5;
  border-left-color: #1e88e5;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.count-pill {
  min-width: 20px;
  height: 18px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #4a5568;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  transition: transform var(--motion-fast), background var(--motion-fast), color var(--motion-fast);
}

.nav-link:hover .count-pill,
.status-tab-btn:hover .tab-badge {
  transform: scale(1.06);
}

.nav-link.active .count-pill {
  background: #1e88e5;
  color: #ffffff;
}

/* Sidebar Status Summary Panel (Mockup Styled) */
.sidebar-status-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-summary-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}

.status-summary-list li.total-row {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.status-summary-list li .label {
  flex-grow: 1;
}

.status-summary-list li .val {
  color: var(--ink);
  font-weight: 700;
}

/* Simple Bullet Dots */
.status-bullet {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-bullet-complete { background: var(--color-complete); }
.status-bullet-ordered { background: var(--color-ordered); }
.status-bullet-shipped { background: var(--color-shipped); }
.status-bullet-missing { background: var(--color-missing); }

/* Main Workspace */
.workspace {
  min-width: 0;
  overflow-x: hidden;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header & Last Updated */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.toolbar h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Styled Action Buttons */
.toolbar-actions,
.dialog-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tool-button,
.primary-button,
.icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}

.tool-button:hover,
.icon-button:hover {
  background: #fafbfd;
  border-color: #ccd0d8;
  transform: translateY(-1px) scale(1.01);
}

.primary-button {
  border-color: #1e88e5;
  background: #1e88e5;
  color: #ffffff;
}

.primary-button:hover {
  background: #1565c0;
  border-color: #1565c0;
  transform: translateY(-1px) scale(1.01);
}

.primary-button:active,
.tool-button:active {
  transform: translateY(0);
}

/* Horizontal Capsule Tabs (Mockup-Styled Metrics Cards) */
.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.status-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform var(--motion-fast), filter var(--motion-fast), box-shadow var(--motion-fast);
}

.status-tab-btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.96);
  box-shadow: var(--shadow-md);
}

.status-tab-btn:active {
  transform: translateY(0);
}

.tab-badge {
  min-width: 20px;
  height: 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.4);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Beautiful color styles for tabs to match the mockup */
.btn-complete {
  background: var(--color-complete-bg);
  border-color: var(--color-complete-border);
  color: var(--color-complete-text);
}
.btn-ordered {
  background: var(--color-ordered-bg);
  border-color: var(--color-ordered-border);
  color: var(--color-ordered-text);
}
.btn-shipped {
  background: var(--color-shipped-bg);
  border-color: var(--color-shipped-border);
  color: var(--color-shipped-text);
}
.btn-missing {
  background: var(--color-missing-bg);
  border-color: var(--color-missing-border);
  color: var(--color-missing-text);
}

/* Status dots inside capsule buttons */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--color-complete); }
.dot-orange { background: var(--color-ordered); }
.dot-blue { background: var(--color-shipped); }
.dot-grey { background: var(--color-missing); }

/* Layout Grid Split */
/* Series Lists */
.series-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sleek Pure White Series Card */
.series-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow var(--motion-smooth), border-color var(--motion-smooth), transform var(--motion-smooth);
}

.series-card:hover {
  border-color: #ccd0d8;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Card Header with Avatar Icon */
.series-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 14px;
}

.series-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.series-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111;
  letter-spacing: 0;
}

.series-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Series Avatars */
.series-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.avatar-dark-blue { background: #1f4e78; }
.avatar-orange { background: #ed7d31; }
.avatar-green { background: #70ad47; }
.avatar-default { background: #7f7f7f; }

.series-avatar svg {
  color: #ffffff;
}

.series-count {
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: #eef2f7;
  color: #344054;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  transition: transform var(--motion-fast), background var(--motion-fast);
}

.series-card:hover .series-count {
  transform: translateY(-1px);
  background: #e2e8f0;
}

.issue-list,
.cover-list,
.order-list {
  display: flex;
  flex-direction: column;
}

.issue-list {
  gap: 8px;
}

.cover-list {
  gap: 7px;
  padding: 10px 0 2px 28px;
}

.order-list {
  gap: 10px;
  padding: 10px 0 2px 28px;
}

.issue-row,
.cover-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  transition: border-color var(--motion-smooth), box-shadow var(--motion-smooth), transform var(--motion-smooth), background var(--motion-smooth);
}

.issue-row[open],
.cover-row[open] {
  border-color: #c8d1dd;
  box-shadow: var(--shadow-sm);
}

.issue-row:hover,
.cover-row:hover {
  border-color: #c8d1dd;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.issue-row:active,
.cover-row:active {
  transform: translateY(0);
}

.cover-row {
  background: #fafbfd;
}

.issue-summary,
.cover-summary {
  display: grid;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background var(--motion-smooth);
}

.issue-summary::after,
.cover-summary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(30, 136, 229, 0.08), transparent);
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

.issue-summary:hover,
.cover-summary:hover {
  background: #fbfdff;
}

.issue-summary:hover::after,
.cover-summary:hover::after {
  animation: summaryShimmer 700ms ease-out;
}

.issue-summary {
  grid-template-columns: 18px minmax(180px, 1fr) auto auto minmax(180px, 0.55fr);
  min-height: 54px;
  padding: 10px 14px;
}

.cover-summary {
  grid-template-columns: 18px minmax(200px, 1fr) auto auto minmax(120px, 0.45fr);
  min-height: 46px;
  padding: 8px 12px;
}

.issue-summary::-webkit-details-marker,
.cover-summary::-webkit-details-marker {
  display: none;
}

.row-chevron {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  transition: transform var(--motion-smooth), color var(--motion-fast);
}

.issue-row[open] > .issue-summary .row-chevron,
.cover-row[open] > .cover-summary .row-chevron {
  transform: rotate(90deg);
  color: #1e88e5;
}

.issue-row[open] > .cover-list,
.cover-row[open] > .order-list {
  animation: rowReveal 240ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top;
}

.issue-title-block,
.cover-title {
  min-width: 0;
}

.issue-title-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.issue-title-block strong {
  flex-shrink: 0;
  color: #111;
  font-size: 15px;
  font-weight: 900;
}

.issue-title-block span,
.cover-title,
.row-order-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-title-block span {
  color: var(--muted);
  font-weight: 600;
}

.cover-title {
  color: #1f2937;
  font-size: 13px;
  font-weight: 750;
}

.row-count {
  min-width: 78px;
  border-radius: var(--radius-full);
  background: #eef2f7;
  color: #475467;
  padding: 2px 9px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.row-order-summary {
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}

.issue-summary:hover .status-tag,
.cover-summary:hover .status-tag,
.order-card:hover .status-tag {
  transform: scale(1.03);
}

.status-complete {
  background: var(--color-complete-bg);
  border-color: var(--color-complete-border);
  color: var(--color-complete-text);
}

.status-ordered {
  background: var(--color-ordered-bg);
  border-color: var(--color-ordered-border);
  color: var(--color-ordered-text);
}

.status-shipped {
  background: var(--color-shipped-bg);
  border-color: var(--color-shipped-border);
  color: var(--color-shipped-text);
}

.status-missing {
  background: var(--color-missing-bg);
  border-color: var(--color-missing-border);
  color: var(--color-missing-text);
}

.status-alert {
  background: var(--color-alert-bg);
  border-color: var(--color-alert-border);
  color: var(--color-alert-text);
}

.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 14px;
  transition: border-color var(--motion-smooth), box-shadow var(--motion-smooth), transform var(--motion-smooth);
}

.order-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.order-card-missing {
  background: #fafafa;
}

.order-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-card-title strong {
  min-width: 0;
  color: #111;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.order-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.order-fields div {
  min-width: 0;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  background: #fafbfd;
  padding: 8px 10px;
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.order-card:hover .order-fields div {
  background: #ffffff;
}

.order-fields span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-fields strong {
  display: block;
  color: #111;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.order-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.order-notes p,
.order-note {
  margin: 0;
  border-left: 3px solid #9bb7d4;
  background: #f2f7fc;
  color: #1f4e78;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 650;
}

.order-download-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.invoice-download {
  min-height: 32px;
  border: 1px solid #1e88e5;
  border-radius: var(--radius-sm);
  background: #1e88e5;
  color: #ffffff;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 850;
  min-width: 132px;
  transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}

.invoice-download:hover {
  background: #1565c0;
  border-color: #1565c0;
  box-shadow: 0 8px 18px rgba(30, 136, 229, 0.22);
  transform: translateY(-1px);
}

.invoice-download:active {
  transform: translateY(0) scale(0.98);
}

.invoice-download.is-downloading {
  background: #0f766e;
  border-color: #0f766e;
  cursor: wait;
  animation: downloadingPulse 900ms ease-in-out infinite;
}

.invoice-missing {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* Mockup-Accurate Beautiful Blue Note Alert Box */
.series-notice-box {
  background: #f2f7fc;
  border: 1px solid #dce6f1;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 10px;
  color: #1f4e78;
}

.series-notice-box h5 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.series-notice-box ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.series-notice-box ul li {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.detail-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.detail-item {
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: #fafbfd;
}

.detail-item strong {
  display: block;
  font-size: 12px;
  color: #111;
  margin-bottom: 2px;
}

/* Dialog Dialogs */
dialog {
  width: min(600px, calc(100vw - 32px));
  border: 1px solid #ccd0d8;
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--ink);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

/* Forms layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
  font-weight: 600;
}

.checkbox-field input {
  height: 18px;
  width: 18px;
}

.form-error {
  min-height: 20px;
  margin: 14px 0;
  color: #e53935;
  font-weight: 700;
  font-size: 12px;
}

/* Toast alert */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(400px, calc(100vw - 48px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: var(--radius-md);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 13px;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.motion-ready {
  animation: dashboardEnter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--entry-index, 0) * 24ms);
}

@keyframes dashboardEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rowReveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes summaryShimmer {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes downloadingPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.25);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(15, 118, 110, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .motion-ready {
    animation: none;
  }
}

/* Beautiful responsive views */
@media (max-width: 1120px) {
  .issue-summary,
  .cover-summary {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: start;
  }

  .issue-summary > .status-tag,
  .cover-summary > .status-tag {
    grid-column: 3;
    grid-row: 1;
  }

  .row-count {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .row-order-summary {
    grid-row: 3;
    grid-column: 2 / -1;
    text-align: left;
  }

  .order-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .mobile-menu-button {
    display: inline-flex;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(15, 23, 42, 0.34);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity var(--motion-smooth);
  }

  .sidebar-overlay[hidden] {
    display: none;
  }

  .sidebar-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 72px 18px 18px;
    transform: translateX(-100%);
    transition: transform var(--motion-smooth), box-shadow var(--motion-smooth);
    z-index: 80;
    overscroll-behavior: contain;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-pop);
  }

  .workspace {
    padding: 80px 16px 24px;
    gap: 20px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

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

  .series-card {
    padding: 16px;
  }

  .series-header {
    align-items: flex-start;
  }

  .series-header-main {
    align-items: flex-start;
  }

  .issue-title-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .issue-title-block span,
  .cover-title,
  .row-order-summary {
    white-space: normal;
  }

  .cover-list,
  .order-list {
    padding-left: 12px;
  }

  .order-fields {
    grid-template-columns: 1fr;
  }
}
