/* UrbanCity — admin panel */

:root {
  --primary: #1E4636;
  --accent: #C9A24E;
  --bg: #F5F2EA;
  --text: #1B2722;
  --primary-deep: color-mix(in srgb, var(--primary) 70%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 8%, #fff);
  --accent-light: color-mix(in srgb, var(--accent) 50%, #fff);
  --accent-deep: color-mix(in srgb, var(--accent) 76%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, #fff);
  --page: color-mix(in srgb, var(--bg) 70%, #fff);
  --card: #fff;
  --muted: color-mix(in srgb, var(--text) 58%, #fff);
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 18%, transparent);
  --field: color-mix(in srgb, var(--text) 3.5%, #fff);
  --danger: #C4321F;
  --ok: #1F7A4D;
  --radius: 18px;
  --side: 268px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 8px 24px -14px rgba(16, 40, 30, .18);
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23727a76' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.lang-ar { --font-head: 'El Messiri', 'Tajawal', serif; --font-body: 'Tajawal', system-ui, sans-serif; }
.lang-hi { --font-head: 'Noto Serif Devanagari', serif; --font-body: 'Hind', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.admin {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; vertical-align: -3px; }
.ic-up { transform: rotate(180deg); }
.a-muted { color: var(--muted); }
.a-spacer { flex: 1; }

/* ---------------- layout ---------------- */
.a-side {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 50;
  width: var(--side);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: rgba(255, 255, 255, .86);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 40%),
    linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  overflow-y: auto;
}
.a-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; text-decoration: none; color: #fff; }
.a-brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--accent-light); background: #fff; }
.a-brand strong { display: block; font-family: var(--font-head); font-size: 20px; line-height: 1.1; }
.a-brand small { display: block; font-size: 12px; color: var(--accent-light); letter-spacing: .04em; }
.a-nav { display: grid; gap: 2px; }
.a-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.a-nav a .ic { color: color-mix(in srgb, var(--accent-light) 80%, #fff); opacity: .85; }
.a-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-nav a.is-active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .a-nav a.is-active { box-shadow: inset -3px 0 0 var(--accent); }
.a-nav a.is-active .ic { opacity: 1; color: var(--accent-light); }
.a-nav a span { flex: 1; }
.a-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #231A06; font-size: 12px; display: grid; place-items: center; }
.a-nav-title { margin: 20px 14px 6px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.a-side-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 12px; }
.a-lang { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .16); }
.a-lang a { flex: 1; text-align: center; padding: 6px 4px; border-radius: 9px; font-size: 13px; text-decoration: none; color: rgba(255, 255, 255, .75); }
.a-lang a:hover { color: #fff; }
.a-lang a.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.a-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.a-me form { margin: 0; }
.a-me .a-icon-btn { color: rgba(255, 255, 255, .8); }
.a-me .a-icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.a-me-text { flex: 1; min-width: 0; }
.a-me-text strong { display: block; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-me-text small { color: var(--accent-light); font-size: 12px; }
.a-avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--accent-light), var(--accent)); color: #231A06; font-weight: 700; }
.a-avatar--lg { width: 46px; height: 46px; font-size: 18px; }

.a-topbar { display: none; }
.a-scrim { display: none; }
.a-main { margin-inline-start: var(--side); padding: 30px 36px 120px; max-width: calc(1240px + var(--side)); }

@media (max-width: 1023px) {
  .a-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 62px;
    padding: 0 12px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .a-brand--top { flex: 1; padding: 0; color: var(--text); justify-content: center; }
  .a-brand--top img { width: 34px; height: 34px; }
  .a-brand--top span { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
  .a-side { transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
  [dir="rtl"] .a-side { transform: translateX(105%); }
  body.nav-open .a-side { transform: none; }
  body.nav-open .a-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 20, 15, .4); }
  .a-main { margin-inline-start: 0; padding: 20px 16px 120px; }
}

/* ---------------- common ---------------- */
.a-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.a-page-head h1 { margin: 0; font-family: var(--font-head); font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--primary-deep); }
.lang-ar .a-page-head h1, .lang-hi .a-page-head h1 { font-size: 29px; }
.a-sub { margin: 6px 0 0; color: var(--muted); }
.a-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.a-card + .a-card { margin-top: 16px; }
.a-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.a-cols .a-card + .a-card { margin-top: 0; }
.a-cols + .a-card, .a-card + .a-cols { margin-top: 16px; }
.a-h2 { display: flex; align-items: center; gap: 8px; margin: 26px 0 12px; font-size: 16px; font-weight: 600; color: var(--primary-deep); }
.a-h2--first { margin-top: 0; }
.a-h2 .ic { color: var(--accent-deep); }
.a-h3 { margin: 22px 0 10px; font-size: 14px; font-weight: 600; }
.a-count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-size: 12.5px; }
.a-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.a-intro { margin: 0 0 14px; }
.a-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--primary); font-weight: 500; cursor: pointer; text-decoration: none; }
.a-link:hover { text-decoration: underline; }
.a-link--danger { color: var(--danger); }
.a-stack { display: grid; gap: 10px; margin: 16px 0 6px; }
.a-tag { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 600; }

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.a-btn:active { transform: translateY(1px); }
.a-btn--primary { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; box-shadow: 0 10px 22px -14px var(--primary-deep); }
.a-btn--primary:hover { box-shadow: 0 14px 26px -14px var(--primary-deep); }
.a-btn--primary .ic { color: var(--accent-light); }
.a-btn--ghost { background: #fff; color: var(--primary-deep); box-shadow: inset 0 0 0 1px var(--line-strong); }
.a-btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.a-btn--wa { background: #25D366; color: #fff; }
.a-btn--danger { background: var(--danger); color: #fff; }
.a-btn--block { width: 100%; height: 48px; }
.a-icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary-deep);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.a-icon-btn:hover { background: var(--primary-soft); }
.a-icon-btn--wa { color: #1DA851; }
.a-icon-btn--wa:hover { background: #E8F8EE; }
.a-icon-btn--danger { color: var(--danger); }
.a-icon-btn--danger:hover { background: #FDECEA; }

.a-flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; font-weight: 500; animation: a-rise .3s both; }
.a-flash--success { background: #E9F6EE; color: var(--ok); border: 1px solid #C8E9D5; }
.a-flash--error { background: #FDF0EE; color: var(--danger); border: 1px solid #F6CFC8; }

/* ---------------- dropdown ---------------- */
.a-dropdown { position: relative; }
.a-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 30;
  min-width: 260px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .35), 0 0 0 1px var(--line);
  animation: a-rise .18s both;
}
.a-dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.a-dropdown-menu a:hover { background: var(--primary-soft); }
.a-dropdown-menu .ic { color: var(--primary); }
.a-dropdown-note { margin: 4px 12px 8px; font-size: 12.5px; color: var(--muted); }

/* ---------------- stats ---------------- */
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.a-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s;
}
a.a-stat:hover { transform: translateY(-2px); }
.a-stat-ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.a-stat b { display: block; font-size: 26px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.a-stat small { color: var(--muted); font-size: 13px; }
.a-stat--gold { background: linear-gradient(135deg, #fff, var(--accent-soft)); }
.a-stat--gold .a-stat-ic { background: linear-gradient(135deg, var(--accent-light), var(--accent)); color: #2A1F08; }

/* ---------------- filters ---------------- */
.a-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.a-seg { display: inline-flex; padding: 4px; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.a-seg a { padding: 7px 14px; border-radius: 9px; text-decoration: none; font-weight: 500; color: var(--muted); }
.a-seg a.is-active { background: var(--primary); color: #fff; }
.a-search { position: relative; flex: 1 1 220px; display: flex; align-items: center; }
.a-search .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.a-search input { width: 100%; height: 44px; padding: 0 14px; padding-inline-start: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; outline: none; }
.a-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.a-select, .a-form select {
  height: 44px;
  padding: 0 38px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff var(--chevron) no-repeat right 12px center / 14px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
[dir="rtl"] .a-select, [dir="rtl"] .a-form select { padding: 0 14px 0 38px; background-position: left 12px center; }
.a-date { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; color: var(--muted); }
.a-date input { border: 0; outline: none; background: transparent; color: var(--text); max-width: 140px; }

/* ---------------- submissions list ---------------- */
.a-list { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.a-list-head, .a-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(200px, 1.6fr) minmax(120px, .9fr) minmax(120px, .8fr) 88px; gap: 16px; align-items: center; padding: 14px 20px; }
.a-list-head { padding-block: 12px; background: var(--field); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.a-row { position: relative; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.a-row:last-child { border-bottom: 0; }
.a-row:hover { background: color-mix(in srgb, var(--primary) 3%, #fff); }
.a-row.is-unread { background: color-mix(in srgb, var(--accent) 6%, #fff); }
.a-row.is-unread::before { content: ''; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--accent); }
.a-row.is-unread .a-row-name { font-weight: 700; }
.a-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.a-ref { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.a-row-name { display: block; font-weight: 600; font-size: 15.5px; text-decoration: none; color: var(--text); }
.a-row-phone { font-size: 13px; color: var(--muted); }
.a-row-prop strong { display: block; font-weight: 500; }
.a-row-prop span { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 10px; font-size: 13px; color: var(--muted); }
.a-row-price small { display: block; font-size: 12px; color: var(--muted); }
.a-row-price b { font-variant-numeric: tabular-nums; }
.a-row-price b span { font-size: 12px; color: var(--muted); font-weight: 500; }
.a-row-status small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.a-row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.a-list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

.a-type { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.a-type .ic { width: 14px; height: 14px; }
.a-type--request { background: var(--primary-soft); color: var(--primary); }
.a-type--offer { background: var(--accent-soft); color: var(--accent-deep); }
.a-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.a-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.a-status--new { background: #FFF5DD; color: #A56B00; }
.a-status--contacted { background: #E7F0FD; color: #2556B8; }
.a-status--in_progress { background: #F1EAFB; color: #6B3FB0; }
.a-status--closed { background: #E5F5EC; color: var(--ok); }
.a-status--rejected { background: #F2F2F0; color: #6E6E68; }

@media (max-width: 900px) {
  .a-list { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 10px; }
  .a-list-head { display: none; }
  .a-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "client status" "prop prop" "price actions";
    gap: 8px 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .a-row:last-child { border-bottom: 1px solid var(--line); }
  .a-row-client { grid-area: client; }
  .a-row-status { grid-area: status; text-align: end; }
  .a-row-prop { grid-area: prop; padding-top: 8px; border-top: 1px dashed var(--line); }
  .a-row-price { grid-area: price; align-self: center; }
  .a-row-actions { grid-area: actions; }
  .a-row.is-unread::before { inset-block: 18px; }
}

.a-pager { display: inline-flex; align-items: center; gap: 6px; }
.a-pager a, .a-pager span.is-disabled { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.a-pager span.is-disabled { opacity: .4; }
.a-pager-info { padding: 0 8px; color: var(--muted); font-size: 13.5px; }

.a-empty { padding: 60px 20px; text-align: center; background: #fff; border-radius: var(--radius); border: 1px dashed var(--line-strong); }
.a-empty-ic { width: 72px; height: 72px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); }
.a-empty-ic .ic { width: 32px; height: 32px; }
.a-empty h2 { margin: 0 0 6px; font-family: var(--font-head); font-size: 24px; color: var(--primary-deep); }
.a-empty p { margin: 0 auto; max-width: 46ch; color: var(--muted); }
.a-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------------- view ---------------- */
.a-page-head--view { align-items: center; }
.a-back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; color: var(--muted); }
.a-back:hover { color: var(--primary); }
.a-view-nav { display: flex; gap: 6px; }
.a-view-nav .a-icon-btn { background: #fff; border: 1px solid var(--line); }
.a-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.a-view-side { display: grid; gap: 16px; position: sticky; top: 20px; }
.a-view-side .a-card + .a-card { margin-top: 0; }
@media (max-width: 1100px) { .a-view { grid-template-columns: 1fr; } .a-view-side { position: static; } }
.a-view-head h1 { margin: 6px 0 4px; font-family: var(--font-head); font-size: 32px; line-height: 1.15; color: var(--primary-deep); }
.a-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.a-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 4px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
}
.a-price small { color: var(--accent-light); font-size: 13px; }
.a-price b { font-size: 24px; font-variant-numeric: tabular-nums; }
.a-price b span { font-size: 14px; color: var(--accent-light); }
.a-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0 0; }
.a-details div { padding: 12px 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.a-details dt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.a-details dt .ic { color: var(--accent-deep); }
.a-details dd { margin: 4px 0 0; font-weight: 600; }
.a-desc { padding: 14px 16px; border-radius: 12px; background: var(--field); line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.a-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.a-gallery a { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--field); }
.a-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.a-gallery a:hover img { transform: scale(1.05); }
.a-meta dl { margin: 0; display: grid; gap: 10px; }
.a-meta dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.a-meta dt { color: var(--muted); }
.a-meta dd { margin: 0; font-weight: 500; }
.a-meta-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.a-meta-actions form { margin: 0; }

.a-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(8, 14, 11, .92); }
.a-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.a-lightbox button { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.a-lightbox button:hover { background: rgba(255, 255, 255, .22); }
.a-lightbox-close { top: 18px; right: 18px; }
.a-lightbox-nav.prev { left: 18px; top: 50%; }
.a-lightbox-nav.next { right: 18px; top: 50%; }

/* ---------------- forms ---------------- */
.a-form { display: grid; gap: 14px; }
.a-form > .a-h2 { margin-bottom: 0; }
.a-field { display: grid; gap: 6px; min-width: 0; }
.a-field > span:first-child, .a-label { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--text) 80%, #fff); }
.a-form input[type="text"], .a-form input[type="email"], .a-form input[type="password"], .a-form input[type="number"], .a-form input[type="date"], .a-form textarea, .a-settings input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.a-form textarea { resize: vertical; line-height: 1.6; }
.a-form input:focus, .a-form textarea:focus, .a-form select:focus, .a-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.a-form input:disabled { background: var(--field); color: var(--muted); }
.a-form select { width: 100%; }
.a-code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace !important; font-size: 13.5px !important; line-height: 1.65 !important; }
.a-err { color: var(--danger); font-size: 13px; }
.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .a-grid-2 { grid-template-columns: 1fr; } }
.a-form-sec { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 15px; color: var(--primary-deep); }
.a-form-sec .ic { color: var(--accent-deep); }
.a-form-sec small { color: var(--muted); font-weight: 400; }
.a-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.a-field--inline { grid-template-columns: auto auto; align-items: center; }

.a-pass { position: relative; display: block; }
.a-pass input { padding-inline-end: 46px !important; }
.a-pass-toggle { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }

/* switch */
.a-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.a-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a-switch { position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.a-switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.a-check input:checked + .a-switch { background: var(--primary); }
.a-check input:checked + .a-switch::after { transform: translateX(18px); }
[dir="rtl"] .a-check input:checked + .a-switch::after { transform: translateX(-18px); }
.a-check input:focus-visible + .a-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.a-check input:disabled + .a-switch { opacity: .5; }
.a-check-text { display: grid; font-weight: 500; }
.a-check-text small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.a-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.a-radios { display: flex; flex-wrap: wrap; gap: 10px; }
.a-radio { position: relative; cursor: pointer; }
.a-radio input { position: absolute; opacity: 0; }
.a-radio span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 500; font-size: 13.5px; }
.a-radio input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

.a-mini-check { display: inline-grid; cursor: pointer; }
.a-mini-check input { position: absolute; opacity: 0; }
.a-mini-check span { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background .15s; }
.a-mini-check input:checked + span { background: var(--primary); border-color: var(--primary); }
.a-mini-check input:checked + span::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.a-mini-check input:disabled + span { opacity: .45; }

/* file inputs */
.a-file { position: relative; display: inline-flex; cursor: pointer; }
.a-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.a-file > span { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: var(--field); font-weight: 500; width: 100%; }
.a-file:hover > span { border-color: var(--primary); }
.a-file--sm > span { padding: 8px 14px; font-size: 13.5px; }

/* multilingual inputs */
.a-lang-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .a-lang-inputs { grid-template-columns: 1fr; } }
.a-lang-input { position: relative; display: block; }
.a-lang-tag { position: absolute; top: -8px; inset-inline-start: 10px; z-index: 1; padding: 0 6px; background: #fff; font-size: 11px; font-weight: 600; color: var(--accent-deep); border-radius: 4px; }
.a-lang-input input, .a-lang-input textarea { width: 100%; padding-top: 14px !important; }
.a-lang-input.is-custom input, .a-lang-input.is-custom textarea { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 5%, #fff); }

/* ---------------- settings ---------------- */
.a-tabs { display: flex; gap: 6px; margin: 0 0 18px; padding: 6px; overflow-x: auto; border-radius: 16px; background: #fff; border: 1px solid var(--line); scrollbar-width: thin; }
.a-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 11px; text-decoration: none; font-weight: 500; white-space: nowrap; color: var(--muted); }
.a-tabs a .ic { width: 18px; height: 18px; }
.a-tabs a:hover { color: var(--primary); background: var(--primary-soft); }
.a-tabs a.is-active { background: var(--primary); color: #fff; }
.a-tabs a.is-active .ic { color: var(--accent-light); }
.a-settings { display: block; }
.a-settings > .a-card, .a-settings > section { margin-bottom: 16px; }
.a-settings .a-card + .a-card { margin-top: 0; }
.a-settings .a-card { display: grid; gap: 14px; }
.a-settings .a-card > .a-h2 { margin-bottom: 0; }
.a-savebar {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .3);
}
.a-savebar-note { font-size: 13px; color: var(--accent-deep); font-weight: 500; }

.a-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.a-image-field { display: grid; gap: 10px; align-content: start; }
.a-image-preview { display: grid; place-items: center; height: 150px; border-radius: 14px; background: repeating-conic-gradient(#f2f0ea 0% 25%, #fff 0% 50%) 50% / 18px 18px; border: 1px solid var(--line); overflow: hidden; }
.a-image-preview img { max-height: 100%; object-fit: contain; }
.a-image-field--logo .a-image-preview img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--accent-light); }
.a-image-field--cover .a-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.a-image-field--favicon .a-image-preview img { width: 64px; height: 64px; border-radius: 12px; }

.a-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.a-color { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; }
.a-color input { width: 46px; height: 46px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.a-color input::-webkit-color-swatch-wrapper { padding: 0; }
.a-color input::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 12px; }
.a-color strong { display: block; font-size: 13.5px; }
.a-color code { font-size: 12.5px; color: var(--muted); }
.a-lang-table { display: grid; gap: 10px; }
.a-lang-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--field); }

.a-link-rows { display: grid; gap: 8px; }
.a-link-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.a-link-row.is-empty { background: var(--field); }
.a-link-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-bg); color: var(--brand-fg); }
.a-link-main { display: grid; gap: 6px; min-width: 0; }
.a-link-main label { display: flex; gap: 8px; align-items: baseline; }
.a-link-main small { font-size: 12px; color: var(--muted); }
.a-link-side { display: flex; align-items: center; gap: 10px; }
.a-order { width: 64px !important; min-height: 36px !important; padding: 6px 8px !important; text-align: center; }
.a-move { display: inline-flex; flex-direction: column; }
.a-move button { width: 28px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.a-move button:hover { color: var(--primary); }
.a-move .ic { width: 16px; height: 16px; }
@media (max-width: 700px) {
  .a-link-row { grid-template-columns: 40px minmax(0, 1fr); }
  .a-link-side { grid-column: 1 / -1; justify-content: space-between; }
  .a-link-ic { width: 40px; height: 40px; }
}

.a-stack-rows { display: grid; gap: 14px; margin-bottom: 14px; }
.a-stack-rows .a-card + .a-card { margin-top: 0; }
.a-btn-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.a-btn-preview { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; font-weight: 600; }
[dir="rtl"] .a-btn-preview { padding: 6px 6px 6px 18px; }
.a-btn-preview-ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--accent-light); color: var(--accent-light); }
.a-btn-preview-ic .ic { width: 16px; height: 16px; }
.a-badge-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.a-image-preview--badge { height: 110px; }
.a-image-preview--badge img { max-width: 80%; max-height: 80%; }
.a-badge-fields { display: grid; gap: 12px; }
@media (max-width: 640px) { .a-badge-row { grid-template-columns: 1fr; } }

.a-field-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-field-table th { padding: 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: start; border-bottom: 1px solid var(--line); }
.a-field-table th:not(:first-child), .a-field-table td:not(:first-child) { text-align: center; width: 80px; }
.a-field-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }

.a-format { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding: 16px 18px; border-radius: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.a-format > .ic { color: var(--accent-deep); margin-top: 2px; }
.a-format p { margin: 4px 0 8px; color: color-mix(in srgb, var(--text) 75%, #fff); }
.a-format code { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #fff; font-size: 13px; }

.a-texts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 16px; }
.a-texts-bar .a-search { max-width: 360px; }
.a-texts-bar p { margin: 0; flex: 1 1 260px; }
.a-text-item { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.a-text-item:first-of-type { border-top: 0; padding-top: 4px; }
.a-text-key { margin: 0 0 12px; }
.a-text-key code { font-size: 12px; color: var(--muted); }
.a-text-item .a-lang-inputs input, .a-text-item .a-lang-inputs textarea { font-size: 14px; }

.a-sysinfo dl { margin: 0; display: grid; gap: 8px; }
.a-sysinfo dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.a-sysinfo dt { color: var(--muted); }
.a-sysinfo dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* users */
.a-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.a-users .a-card + .a-card { margin-top: 0; }
.a-user-head { display: flex; align-items: center; gap: 12px; }
.a-user-head > div { flex: 1; min-width: 0; }
.a-user-head strong { display: block; font-size: 16px; }
.a-user-head small { color: var(--muted); }
.a-role { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.a-role--superadmin { background: var(--accent-soft); color: var(--accent-deep); }
.a-role--owner { background: var(--primary-soft); color: var(--primary); }
.a-user-meta { font-size: 13px; margin: 12px 0 0; }
.a-details-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.a-details-box summary { cursor: pointer; font-weight: 500; color: var(--primary); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.a-details-box summary::-webkit-details-marker { display: none; }
.a-details-box[open] summary { margin-bottom: 14px; }
.a-details-box .a-form + .a-form, .a-details-box .a-form + form { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.a-user-new { border: 1.5px dashed var(--line-strong); box-shadow: none; }
.a-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #FFF6E5; color: #8A5A00; font-size: 13.5px; }

/* ---------------- auth ---------------- */
body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--primary-deep) var(--cover) center / cover no-repeat;
}
body.auth::before { content: ''; position: fixed; inset: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--primary-deep) 70%, transparent), color-mix(in srgb, var(--primary-deep) 92%, transparent)); backdrop-filter: blur(3px); }
.auth-wrap { position: relative; width: 100%; max-width: 460px; animation: a-rise .5s both; }
.auth-card { padding: 30px 28px; border-radius: 26px; background: #fff; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.auth-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--accent-light), 0 10px 24px -10px rgba(0, 0, 0, .4); }
.a-lang--auth { background: var(--field); }
.a-lang--auth a { color: var(--muted); padding: 6px 10px; }
.a-lang--auth a.is-active { background: var(--primary); color: #fff; }
.auth-title { margin: 0; font-family: var(--font-head); font-size: 30px; color: var(--primary-deep); }
.auth-sub { margin: 6px 0 20px; color: var(--muted); }
.auth-back { margin: 18px 0 0; text-align: center; }
.auth-back a { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 500; }
.auth-back a:hover { color: #fff; }

@keyframes a-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
