:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1d2430;
  --muted: #667085;
  --line: #d7dde5;
  --accent: #176b87;
  --accent-strong: #0f4f66;
  --danger: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #e8edf2;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

.login-card h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.password-field.compact {
  min-width: 220px;
}

.toggle-password {
  background: #e8edf2;
  color: var(--text);
  padding: 10px 12px;
  white-space: nowrap;
}

.toggle-password:hover {
  background: #d7dde5;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.form-message {
  align-self: end;
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f2c94c;
  border-radius: 10px;
  background: #fff8db;
  color: #7a4b00;
}

.storage-status {
  margin: 0 0 16px;
  color: #475569;
  font-size: 14px;
}

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px;
  background: #111827;
  color: #fff;
}

.sidebar-bottom {
  display: grid;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  font-weight: 800;
}

.brand small,
.topbar p,
.setting-row small {
  display: block;
  color: var(--muted);
}

.sidebar .brand small {
  color: #b7c0cd;
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.language-switcher {
  display: flex;
  gap: 6px;
}

.login-card .language-switcher {
  justify-content: center;
}

.lang-btn {
  min-width: 44px;
  background: #e8edf2;
  color: var(--text);
  padding: 7px 9px;
}

.sidebar .lang-btn {
  background: #263244;
  color: #d7dde5;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

.rtl .nav-btn,
.rtl th,
.rtl td {
  text-align: right;
}

.rtl .brand {
  flex-direction: row-reverse;
}

.nav-btn {
  width: 100%;
  background: transparent;
  color: #d7dde5;
  text-align: left;
}

.nav-btn.active,
.nav-btn:hover {
  background: #263244;
  color: #fff;
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar p {
  margin: 4px 0 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

.metrics small {
  color: var(--muted);
}

.panel {
  padding: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.switch input {
  display: none;
}

.switch span {
  display: block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #c8d0da;
  position: relative;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.form-grid {
  display: grid;
  grid-template-columns: 150px 1fr 120px 120px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-form {
  grid-template-columns: 220px 220px 220px 120px auto;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}

.inline-check input,
.table-check input {
  width: auto;
}

.table-check {
  display: inline-flex;
}

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

td.actions {
  white-space: nowrap;
}

td.actions button {
  margin-right: 6px;
  padding: 7px 9px;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef4ff;
  color: #175cd3;
  font-size: 12px;
}

.status.failed {
  background: #fef3f2;
  color: var(--danger);
}

.status.verified,
.status.uploaded {
  background: #ecfdf3;
  color: var(--ok);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  background: #e8edf2;
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
