:root {
  --ink: #18201f;
  --muted: #61716d;
  --line: #d9e3df;
  --panel: #ffffff;
  --page: #f4f7f4;
  --accent: #0b7a75;
  --accent-dark: #075c58;
  --signal: #f2b705;
  --danger: #b43b3b;
  --shadow: 0 18px 45px rgba(24, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(11, 122, 117, 0.08), transparent 34%),
    linear-gradient(320deg, rgba(242, 183, 5, 0.12), transparent 30%),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select {
  font-family: "Noto Kufi Arabic", Inter, ui-sans-serif, system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  min-height: 44px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #102a2a;
  color: #eef8f6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-panel {
  display: contents;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: var(--signal);
  color: #102a2a;
  font-weight: 900;
}

.brand h1,
.brand p,
.hero h2,
.hero p,
h3,
h4 {
  margin: 0;
}

.brand h1 {
  font-size: 1.28rem;
}

.brand p {
  color: #b8cbc7;
  font-size: 0.92rem;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.language-field {
  display: grid;
  gap: 8px;
  color: #d9e9e5;
  font-size: 0.92rem;
  font-weight: 800;
}

.language-field select {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #eef8f6;
}

.language-field option {
  color: var(--ink);
}

.nav-tab {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #eef8f6;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.35;
  text-align: start;
}

.nav-tab span {
  display: grid;
  place-items: center;
  min-width: 0;
}

.nav-tab span[aria-hidden="true"] {
  width: 28px;
  height: 28px;
  font-weight: 900;
}

.nav-tab [data-i18n] {
  justify-content: start;
  overflow-wrap: break-word;
  text-align: start;
}

html[dir="rtl"] .nav-tab {
  grid-template-columns: minmax(0, 1fr) 28px;
}

html[dir="rtl"] .nav-tab span[aria-hidden="true"] {
  grid-column: 2;
  grid-row: 1;
}

html[dir="rtl"] .nav-tab [data-i18n] {
  grid-column: 1;
  grid-row: 1;
  justify-content: end;
  text-align: end;
}

.nav-tab.active,
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

.qr-panel {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.qr-panel p {
  margin: 4px 0 0;
  color: #c5d7d3;
  font-size: 0.88rem;
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 74px;
  height: 74px;
  padding: 7px;
  border-radius: 6px;
  background: #eef8f6;
}

.qr-code span {
  background: #102a2a;
}

.qr-code span:nth-child(3n) {
  opacity: 0.2;
}

main {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 32px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 210px;
  padding: 28px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(9, 44, 42, 0.58), rgba(9, 44, 42, 0.58)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520' viewBox='0 0 1200 520'%3E%3Crect width='1200' height='520' fill='%23879c98'/%3E%3Cg fill='none' stroke='%23f7faf8' stroke-width='8' opacity='.72'%3E%3Cpath d='M60 420H1140M120 330H1080M180 240H1020'/%3E%3Cpath d='M260 150l-90 300M500 150l-70 300M740 150l70 300M980 150l90 300'/%3E%3C/g%3E%3Cg%3E%3Crect x='180' y='300' width='210' height='70' rx='14' fill='%230b7a75'/%3E%3Ccircle cx='225' cy='372' r='18' fill='%2318201f'/%3E%3Ccircle cx='345' cy='372' r='18' fill='%2318201f'/%3E%3Crect x='470' y='228' width='230' height='78' rx='14' fill='%23f2b705'/%3E%3Ccircle cx='520' cy='308' r='18' fill='%2318201f'/%3E%3Ccircle cx='650' cy='308' r='18' fill='%2318201f'/%3E%3Crect x='790' y='318' width='240' height='76' rx='14' fill='%23eef8f6'/%3E%3Ccircle cx='842' cy='396' r='18' fill='%2318201f'/%3E%3Ccircle cx='976' cy='396' r='18' fill='%2318201f'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
}

.eyebrow {
  color: #fff2b7;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  max-width: 760px;
  font-size: clamp(1.85rem, 3.35vw, 3.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

html[lang="he"] .hero h2,
html[lang="ar"] .hero h2 {
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.18;
}

.hero-actions,
.section-header,
.tool-grid {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view {
  display: none;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(24, 32, 31, 0.06);
}

.view.active {
  display: block;
}

.section-header {
  justify-content: space-between;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

h3 {
  font-size: 1.36rem;
}

h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.tool-grid {
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #344440;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd7d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(11, 122, 117, 0.15);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 20px;
  min-height: 20px;
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  border-color: #b9c8c4;
  background: #fff;
  color: var(--ink);
}

.hero .ghost-button {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.danger-button {
  border-color: rgba(180, 59, 59, 0.22);
  background: #fff4f4;
  color: var(--danger);
}

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

.result {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.settings-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.owner-card {
  display: grid;
  gap: 12px;
}

.owner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: #344440;
  font-size: 0.86rem;
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

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

.list-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-title strong {
  word-break: break-word;
}

.list-item p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #102a2a;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 42, 42, 0.58);
  z-index: 20;
}

.modal-backdrop.active {
  display: grid;
}

.modal {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal p {
  margin: 0;
  color: var(--muted);
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 18px;
    gap: 16px;
  }

  .mobile-menu-panel {
    display: grid;
    gap: 16px;
  }

  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .nav-tabs .view {
    margin: 0 0 8px;
    padding: 16px;
    color: var(--ink);
  }

  .nav-tabs .section-header {
    margin-bottom: 16px;
  }

  .qr-panel {
    margin-top: 0;
  }

  main {
    padding: 18px;
  }

  .hero {
    align-items: start;
    flex-direction: column;
    min-height: 210px;
    padding: 22px;
  }

  .hero h2 {
    max-width: 100%;
    font-size: clamp(1.8rem, 7vw, 3rem);
  }

  html[lang="he"] .hero h2,
  html[lang="ar"] .hero h2 {
    font-size: clamp(1.45rem, 6vw, 2.45rem);
    line-height: 1.24;
  }

  .hero-actions,
  .tool-grid,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: stretch;
  }

  .form-grid,
  .settings-panel,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 1.78rem;
  }

  html[lang="he"] .hero h2,
  html[lang="ar"] .hero h2 {
    font-size: 1.45rem;
  }

  .hero {
    min-height: 180px;
    padding: 18px;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .nav-tab {
    min-height: 54px;
    font-size: 0.95rem;
  }

  .view {
    padding: 18px;
  }
}
