* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f6f8;
  --white: #fff;
  --dark: #151515;
  --primary: #8b0000;
  --primary-light: #d96969;
  --accent: #d4af37;
  --gray: #6f7a89;
  --border: #e1e6ef;
  --shadow: 0 20px 45px rgba(10, 15, 70, 0.08);
  --radius: 18px;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

.hidden {
  display: none;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1a1a1a, #000);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px 35px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form.hidden {
  display: none;
}

.auth-logo {
  text-align: center;
  margin-bottom: 10px;
}

.auth-logo h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  color: #fff;
}

.auth-logo span {
  color: var(--accent);
}

.auth-card input {
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
}

.auth-card button {
  margin-top: 10px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.auth-helper {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.auth-error {
  color: #ff8080;
  min-height: 18px;
  text-align: center;
}

.auth-error[data-state='success'] {
  color: #54e1c0;
}

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

.sidebar {
  background: var(--dark);
  color: #fff;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-header h2 {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 1px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  border: none;
  padding: 12px 15px;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-btn.logout {
  margin-top: auto;
  color: #ff9b9b;
}

.content {
  padding: 40px 50px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  background: #fff;
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.user-account-btn {
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card p {
  color: var(--gray);
  margin-bottom: 10px;
}

.stat-card h2 {
  font-size: 2rem;
}

.panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}

.btn.btn-danger {
  background: #a11a1a;
}

.btn.btn-danger:hover {
  background: #7e1313;
}

.text-btn {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
}

.table-wrapper {
  overflow-x: auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.settings-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-card h4 {
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.menu-doc-selector {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.menu-doc-selector select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'Open Sans', sans-serif;
}

.settings-card input,
.settings-card textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'Open Sans', sans-serif;
}

.settings-card textarea {
  resize: vertical;
}

.price-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.price-tags span {
  background: rgba(139, 0, 0, 0.08);
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.price-base {
  font-weight: 600;
}

.price-hint {
  font-size: 0.85rem;
  color: var(--gray);
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn.btn-compact {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.help-text,
.field-hint,
.text-muted {
  font-size: 0.85rem;
  color: var(--gray);
}

.job-row-title {
  font-weight: 600;
  color: var(--dark);
}

.job-row-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 2px;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.job-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 0, 0, 0.08);
  color: var(--primary);
}

.table-wrapper .empty-row {
  text-align: center;
  color: var(--gray);
  font-style: italic;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.category-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-label {
  font-weight: 600;
}

.category-key {
  font-size: 0.8rem;
  text-transform: lowercase;
  color: var(--gray);
}

.category-actions {
  display: flex;
  gap: 6px;
}

.stacked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.direction-row,
.opening-hour-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.direction-row p,
.opening-hour-value {
  margin: 4px 0 0;
  color: var(--gray);
  font-size: 0.9rem;
}

.direction-actions,
.opening-hour-actions {
  display: flex;
  gap: 8px;
}

.opening-hour-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.opening-hour-label span {
  font-size: 0.8rem;
  color: var(--gray);
}

.opening-hour-value {
  flex: 1;
  white-space: pre-line;
}

.order-actions-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.order-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.order-detail-section {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 16px 20px;
  color: #2b2b2b;
}

.order-detail-section h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #8b0000;
}

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

.order-items-list li {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 6px;
}

.order-items-list li div {
  display: flex;
  gap: 8px;
}

.order-detail-total {
  margin-top: 12px;
  font-weight: 700;
  text-align: right;
}

.order-detail-section .muted {
  color: #777;
  font-style: italic;
}

.category-section-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-section-menu {
  background: rgba(139, 0, 0, 0.1);
  color: var(--primary);
}

.category-section-cantine {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

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

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

th {
  color: var(--gray);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.menu-thumb,
.news-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
}

.image-preview {
  width: 100%;
  min-height: 140px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 10px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.status-received { background: #e8f4ff; color: #0070f3; }
.status-preparing { background: #fff5e0; color: #b67800; }
.status-ready { background: #e1f8f1; color: #008f67; }
.status-completed { background: #e4f9e3; color: #2f8a27; }
.status-cancelled { background: #fde8e8; color: #c62828; }

.status-pending { background: #fff3d6; color: #a46700; }
.status-confirmed { background: #e4f3ff; color: #0066c7; }

.action-btn {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  margin-right: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border);
}

#modalBody {
  padding: 25px;
  overflow-y: auto;
}

#modalCloseBtn {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'Open Sans', sans-serif;
}

.modal form.news-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 20px;
}

.news-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-form .form-field.full {
  grid-column: 1 / -1;
}

.news-form .image-preview {
  min-height: 180px;
}

.news-form .form-actions {
  display: flex;
  justify-content: flex-start;
}

.news-form .form-actions .btn {
  min-width: 160px;
}

.btn.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(139, 0, 0, 0.25);
}

.btn.btn-ghost:hover {
  background: rgba(139, 0, 0, 0.05);
}

.form-status {
  font-size: 0.9rem;
  color: var(--gray);
  min-height: 1.2em;
}

.form-status[data-state='error'] {
  color: #c62828;
}

.form-status[data-state='success'] {
  color: #2f8a27;
}

.translations-manager {
  display: grid;
  grid-template-columns: minmax(190px, 240px) 1fr;
  grid-template-areas:
    'tabs forms'
    'actions forms'
    'note forms';
  column-gap: 26px;
  row-gap: 16px;
  align-items: flex-start;
}

.translation-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-area: tabs;
  position: sticky;
  top: 0;
}

.translation-lang-tabs button {
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray);
}

.translation-lang-tabs button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#translationFormsContainer {
  grid-area: forms;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.translation-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.translation-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.translation-section h4 {
  margin: 0;
  font-size: 1rem;
}

.translation-section input,
.translation-section textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
}

.translation-section textarea {
  resize: vertical;
}

.translation-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.translation-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.translation-row span {
  flex: 0 0 160px;
  font-weight: 600;
  color: var(--gray);
}

.translation-row input {
  flex: 1;
}

.translation-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 60px;
  background: var(--modal-bg, #fff);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.translation-actions .btn {
  width: 100%;
}

.translation-source {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.translation-source select {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: 'Open Sans', sans-serif;
}

.translation-source small {
  font-size: 0.8rem;
  color: var(--gray);
}

.translation-note {
  grid-area: note;
  font-size: 0.85rem;
  color: var(--gray);
}

.translation-direction-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.translation-direction-list .translation-row {
  flex-direction: column;
  align-items: stretch;
}

.translation-direction-list .translation-row span {
  flex: initial;
}

.translation-direction-list textarea {
  min-height: 90px;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

.file-pill--pdf {
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.4);
  color: #8b0000;
}

.file-pill--pdf i {
  color: inherit;
}

@media (max-width: 1024px) {
  .translations-manager {
    grid-template-columns: 1fr;
    grid-template-areas:
      'tabs'
      'actions'
      'forms'
      'note';
  }

  .translation-lang-tabs,
  .translation-actions {
    position: static;
  }

  .translation-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .translation-actions .btn {
    width: auto;
  }
}

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

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
  }

  nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .content {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  th, td {
    font-size: 0.85rem;
  }
}
