:root {
  --white: #ffffff;
  --bg-dark: #1a1a2e;
  --text-light: #ffffff;
  --text-dark: #1a1a1a;
  --gray: #4a5568;
  --red-vibrant: #d84848;
  --red-hot: #c63636;
  --red-light: #f5e5e5;
  --accent-gold: #e8b923;
  --shadow-glow: 0 6px 20px rgba(216, 72, 72, 0.25);
  --shadow-hard: 0 8px 30px rgba(0, 0, 0, 0.3);
  --gradient-red: linear-gradient(135deg, #d84848 0%, #c63636 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-light);
  text-transform: uppercase;
  background: linear-gradient(135deg, #242d42 0%, #2d3a52 50%, #1f3a4f 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(216, 72, 72, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.background-grid {
  display: none;
}

.dashboard {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 32px;
}

.hero-content,
.hero-metrics,
.panel {
  border: 2px solid #d84848;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 240, 242, 0.96) 100%);
  backdrop-filter: blur(8px);
}

.hero-content {
  padding: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.brand-name {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #d84848;
  font-size: 0.88rem;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  color: #d84848;
  font-size: 0.78rem;
  font-weight: 600;
}

h1,
h2 {
  margin: 0;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(1.8rem, 4.2vw, 3.1rem);
  line-height: 1.15;
  max-width: 18ch;
}

.hero-copy,
.panel-heading p,
.status-message {
  color: var(--gray);
}

.hero-copy {
  margin: 12px 0 0;
  font-size: 0.88rem;
  line-height: 1.65;
  letter-spacing: 0.04em;
  max-width: 58ch;
  color: #333;
}

.hero-metrics {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.hero-metrics article {
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #d84848 0%, #c63636 100%);
  border: none;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(216, 72, 72, 0.25);
  transform: translateY(0);
  transition: all 250ms ease;
}

.hero-metrics article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(216, 72, 72, 0.3);
}

.hero-metrics span {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.hero-metrics strong {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--white);
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(300px, 370px) 1fr;
  gap: 22px;
}

.panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: 1.18rem;
}

.panel-heading p {
  margin: 8px 0 0;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: #666;
}

.auth-box {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid #d84848;
  background: linear-gradient(135deg, rgba(216, 72, 72, 0.08) 0%, rgba(198, 54, 54, 0.06) 100%);
}

.auth-box summary {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #d84848;
  transition: all 200ms ease;
}

.auth-box summary:hover {
  text-shadow: none;
}

.auth-fields {
  display: grid;
  gap: 12px;
  margin-top: 13px;
}

.panel-heading-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

form,
.two-columns,
.form-actions {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #333;
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 0.83rem;
  color: #333;
  text-transform: uppercase;
  transition: all 200ms ease;
}

input::placeholder {
  color: #bbb;
}

input:focus {
  outline: none;
  border-color: #d84848;
  box-shadow: 0 0 8px rgba(216, 72, 72, 0.2);
  background: var(--white);
}

select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #d84848;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  font: inherit;
  font-size: 0.83rem;
  color: #333;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d84848' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 36px;
}

select:hover {
  border-color: #c63636;
  box-shadow: 0 4px 12px rgba(216, 72, 72, 0.15);
}

select:focus {
  outline: none;
  border-color: #d84848;
  box-shadow: 0 0 12px rgba(216, 72, 72, 0.25);
  background-color: var(--white);
}

select option {
  background: var(--white);
  color: #333;
  padding: 10px;
  font-weight: 500;
}

select option:hover {
  background: linear-gradient(#d84848, #d84848);
  background-color: #d84848 !important;
  color: var(--white) !important;
}

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

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 250ms ease;
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.button-primary {
  background: linear-gradient(135deg, #d84848 0%, #c63636 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(216, 72, 72, 0.25);
}

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

.button-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: #d84848;
  border: 2px solid #d84848;
  box-shadow: 0 2px 8px rgba(216, 72, 72, 0.15);
}

.hidden {
  display: none;
}

.status-message {
  min-height: 24px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(74, 85, 104, 0.25);
  color: #2d3748;
  font-size: 0.77rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.status-message.error {
  color: #d84848;
}

.status-message.success {
  color: #5cb85c;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 2px solid #d84848;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

td {
  color: #1a1a1a;
  font-weight: 500;
}

th {
  color: var(--white);
  background: linear-gradient(135deg, #d84848 0%, #c63636 100%);
  font-weight: 700;
}

tbody tr {
  animation: slideIn 400ms ease;
  transition: all 150ms ease;
}

tbody tr:hover {
  background: #fef8f9;
  box-shadow: inset 0 0 8px rgba(216, 72, 72, 0.08);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.pill-ok {
  color: var(--white);
  background: linear-gradient(135deg, #5cb85c 0%, #449d44 100%);
}

.pill-low {
  color: var(--white);
  background: linear-gradient(135deg, #d84848 0%, #c63636 100%);
}

.stock-value.low {
  color: #d84848;
  font-weight: 700;
  animation: softPulse 2.5s ease-in-out infinite;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.actions button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: rgba(255, 255, 255, 0.9);
  color: #d84848;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 150ms ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 72, 72, 0.15);
  border-color: #d84848;
}

.actions .danger {
  color: var(--white);
  border: none;
  background: linear-gradient(135deg, #e57373 0%, #d84848 100%);
}

@keyframes softPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero,
  .grid-layout {
    grid-template-columns: 1fr;
  }

  .panel-heading-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  }
}

@media (max-width: 768px) {
  .dashboard {
    width: min(100% - 24px, 100%);
    padding: 24px 0 40px;
  }

  .hero-content,
  .hero-metrics,
  .panel {
    border-radius: 12px;
    padding: 18px;
  }

  .hero-metrics {
    padding: 10px;
  }

  .hero-metrics article {
    padding: 12px 14px;
  }

  .brand-lockup {
    gap: 12px;
    margin-bottom: 12px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .brand-name {
    font-size: 0.8rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .hero-copy {
    font-size: 0.8rem;
  }

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

  table {
    font-size: 0.7rem;
  }

  .actions button {
    padding: 6px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 640px) {
  .dashboard {
    width: min(100% - 16px, 100%);
    padding: 16px 0 32px;
  }

  .hero {
    gap: 16px;
    margin-bottom: 20px;
  }

  .grid-layout {
    gap: 16px;
  }

  .panel,
  .hero-content,
  .hero-metrics {
    padding: 14px;
  }

  .hero-metrics {
    padding: 8px;
  }

  .hero-metrics article {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .hero-metrics span {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .hero-metrics strong {
    font-size: 1.6rem;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-name {
    font-size: 0.82rem;
  }

  .eyebrow {
    font-size: 0.85rem;
  }

  h1 {
    font-size: 1.6rem;
    max-width: 12ch;
  }

  h2 {
    font-size: 1.2rem;
  }

  .hero-copy {
    font-size: 0.9rem;
    max-width: 50ch;
  }

  label {
    font-size: 0.85rem;
  }

  input,
  select {
    padding: 10px;
    font-size: 0.9rem;
  }

  .button {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .two-columns,
  .auth-fields,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .auth-box {
    padding: 10px;
    margin-bottom: 14px;
  }

  .panel-heading {
    margin-bottom: 12px;
  }

  .status-message {
    font-size: 0.85rem;
  }

  .table-wrapper {
    border-radius: 12px;
  }

  table {
    min-width: 100%;
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 8px;
  }

  .pill {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .actions {
    gap: 4px;
  }

  .actions button {
    padding: 5px 6px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .dashboard {
    width: 100%;
    padding: 12px 0 24px;
  }

  .hero,
  .grid-layout {
    gap: 12px;
  }

  .panel,
  .hero-content,
  .hero-metrics {
    padding: 12px;
    border-radius: 10px;
  }

  .hero-metrics article {
    padding: 8px 10px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-name {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
  }

  .eyebrow {
    font-size: 0.8rem;
  }

  h1 {
    font-size: 1.4rem;
    max-width: 10ch;
  }

  h2 {
    font-size: 1.1rem;
  }

  .hero-copy {
    font-size: 0.85rem;
    max-width: 45ch;
  }

  form {
    gap: 10px;
  }

  label {
    font-size: 0.8rem;
    gap: 4px;
  }

  input,
  select {
    padding: 8px;
    font-size: 0.85rem;
    border-radius: 8px;
  }

  .button {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .auth-box {
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .auth-box summary {
    font-size: 0.8rem;
  }

  .hero-metrics strong {
    font-size: 1.5rem;
  }

  .hero-metrics span {
    font-size: 0.76rem;
  }

  table {
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 6px;
  }

  .pill {
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  .actions {
    gap: 2px;
    flex-wrap: wrap;
  }

  .actions button {
    padding: 4px 5px;
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .dashboard {
    padding: 8px 0 16px;
  }

  .hero {
    gap: 8px;
    margin-bottom: 12px;
  }

  .panel,
  .hero-content {
    padding: 10px;
  }

  .hero-metrics article {
    padding: 6px 8px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.2rem;
  }

  .hero-copy {
    font-size: 0.75rem;
  }

  input,
  select {
    padding: 6px;
    font-size: 0.8rem;
  }

  .button {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  table {
    font-size: 0.7rem;
  }

  th,
  td {
    padding: 4px;
  }

  .actions button {
    padding: 3px 4px;
    font-size: 0.65rem;
  }
}

@media (min-width: 1200px) {
  .dashboard {
    width: 1200px;
  }

  .hero {
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
  }

  .grid-layout {
    grid-template-columns: minmax(350px, 380px) 1fr;
  }
}

/* Landscape mode mobile */
@media (max-width: 640px) and (orientation: landscape) {
  h1 {
    font-size: 1.1rem;
  }

  .hero-copy {
    font-size: 0.7rem;
  }

  .dashboard {
    padding: 12px 0 20px;
  }

  .grid-layout {
    gap: 12px;
  }
}