:root {
  --admin-ink: #12233f;
  --admin-blue: #114f91;
  --admin-blue-strong: #0b3c71;
  --admin-cyan: #0087b3;
  --admin-amber: #ffb000;
  --admin-orange: #f37b12;
  --admin-bg: #f3f6f9;
  --admin-surface: #ffffff;
  --admin-line: #d8e0e8;
  --admin-muted: #64748b;
  --admin-danger: #b42318;
}

* { box-sizing: border-box; }

body {
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

h1, h2, h3 { color: var(--admin-ink); letter-spacing: 0; }
h2 { font-size: 1.65rem; line-height: 1.2; margin-bottom: 1.25rem; }
h3 { font-size: 1.05rem; }

.side-menu {
  width: 232px;
  padding: 0 14px 18px;
  overflow-y: auto;
  background: var(--admin-ink);
  border-right: 0;
  box-shadow: none;
  color: #fff;
}

.brand-area {
  min-height: 82px;
  width: 100%;
  margin: 0 0 18px;
  padding: 14px 6px;
  border-bottom: 1px solid #30415b;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: cover;
}

.brand-title {
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.sidebar-header { margin: 0 6px 12px; }
.sidebar-title {
  color: #8fa3bb;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-link,
.side-menu nav a {
  width: 100%;
  min-height: 42px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 4px;
  color: #d6e0eb;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-link:hover {
  background: #1c3453;
  color: #fff;
  text-decoration: none;
}

.nav-link.active {
  background: var(--admin-amber);
  color: var(--admin-ink);
}

.locale-switcher { padding-inline: 0; }
.locale-switcher button {
  border-color: #496079;
  background: transparent;
  color: #c7d3df;
}
.locale-switcher button.active {
  border-color: var(--admin-amber);
  background: var(--admin-amber);
  color: var(--admin-ink);
}

.top-right-menu {
  top: 18px;
  right: 28px;
  min-height: 44px;
  padding: 5px 7px 5px 14px;
  border: 1px solid var(--admin-line);
  background: rgba(255,255,255,.96);
  box-shadow: 0 2px 8px rgba(18,35,63,.06);
}

#username-display { color: var(--admin-ink); font-size: .86rem; font-weight: 700; }
.profile-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--admin-line);
  background: #edf2f7;
}
.profile-icon:hover { border-color: var(--admin-amber); box-shadow: none; }

main {
  width: auto;
  max-width: 1680px;
  margin-left: 232px;
  padding: 86px 32px 40px;
}

main > h2,
main > section > h2 { margin-bottom: 20px; }

section {
  padding: 0;
  margin-bottom: 28px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card,
.sync-card,
.report-kpi,
.table-scroll-container {
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: var(--admin-surface);
  box-shadow: 0 1px 2px rgba(18,35,63,.04);
}

.card { padding: 20px; margin-bottom: 18px; }
.card:hover { box-shadow: 0 3px 12px rgba(18,35,63,.08); }
.table-scroll-container { padding: 0; overflow: auto; }

button,
input[type="submit"],
.search-button,
.pagination-button {
  min-height: 40px;
  margin-right: 6px;
  padding: 8px 14px;
  border: 1px solid var(--admin-blue);
  border-radius: 4px;
  background: var(--admin-blue);
  box-shadow: none;
  color: #fff;
  font: inherit;
  font-size: .86rem;
  font-weight: 750;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

button:hover,
input[type="submit"]:hover,
.search-button:hover,
.pagination-button:hover:not(:disabled) {
  transform: none;
  border-color: var(--admin-blue-strong);
  background: var(--admin-blue-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255,176,0,.45);
  outline-offset: 2px;
}

button:disabled,
button:disabled:hover {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
select,
textarea,
.search-input,
.sync-card input,
.sync-card textarea,
.sync-card select {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #b9c5d2;
  border-radius: 4px;
  background: #fff;
  color: var(--admin-ink);
  font: inherit;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus,
.sync-card input:focus,
.sync-card textarea:focus,
.sync-card select:focus {
  border-color: var(--admin-cyan);
  box-shadow: 0 0 0 3px rgba(0,135,179,.12);
  outline: none;
}

input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed #aebdcb;
  border-radius: 4px;
  background: #f8fafc;
}

form { width: min(100%, 520px); margin: 0; }
form label, form input, form button { margin-bottom: 0; }

table { background: #fff; border-collapse: collapse; }
thead th {
  padding: 11px 13px;
  border-bottom: 1px solid #bfcbd7;
  background: #edf2f7;
  color: #334155;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
tbody td { padding: 10px 13px; border-bottom-color: #e3e9ef; font-size: .86rem; }
tbody tr:nth-child(even) td { background: #f8fafc; }
tbody tr:hover td { background: #eef6fa; }
tbody td:first-child { border-left-color: var(--admin-amber); background: #fff8e6; color: var(--admin-blue); }

.report-toolbar { padding: 14px; border: 1px solid var(--admin-line); background: #fff; }
.report-kpis { gap: 12px; }
.report-kpi { padding: 14px 16px; border-top: 3px solid var(--admin-amber); }
.report-kpi strong { color: var(--admin-ink); font-size: 1.5rem; }
.report-kpi-label { color: var(--admin-muted); text-transform: uppercase; letter-spacing: .04em; }
.report-grid { gap: 14px; }
.report-card { min-height: 270px; }

.management-submenu,
.image-tabs { border-bottom: 1px solid var(--admin-line); }
.submenu-button,
.image-tab-button,
.diff-bucket-button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #526277;
}
.submenu-button:hover,
.image-tab-button:hover,
.diff-bucket-button:hover { background: #eaf0f5; color: var(--admin-ink); }
.submenu-button.active,
.image-tab-button.active,
.diff-bucket-button.active {
  border-color: var(--admin-amber);
  background: transparent;
  color: var(--admin-ink);
}

.sync-card { border-radius: 6px; background: #fff; }
.sync-output { border-radius: 4px; background: #0d1d33; }
.danger-option { color: var(--admin-danger); }

.product-card,
.user-card {
  border-color: var(--admin-line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(18,35,63,.04);
}
.product-card:hover,
.user-card:hover { transform: none; border-color: #aebdcb; box-shadow: 0 4px 12px rgba(18,35,63,.08); }
.product-price,
.user-name .full-name { color: var(--admin-blue); }
.product-image { border-radius: 4px; }

.stock-badge,
.user-badge { border-radius: 3px; }

.progress-container { border-radius: 6px; }
.progress-fill { background: var(--admin-amber); }
#progress-title, #progress-text { color: var(--admin-blue); }

body:has(.login-container) {
  padding: 28px;
  background: var(--admin-ink);
  background-image: linear-gradient(115deg, #12233f 0%, #114f91 72%, #0087b3 100%);
}

.login-container {
  max-width: 400px;
  padding: 36px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.login-logo { display: block; width: 80px; height: 80px; margin: 0 auto 16px; object-fit: cover; }
.login-title { color: var(--admin-ink); letter-spacing: 0; }
.login-subtitle { color: var(--admin-muted); }
.login-button { border-radius: 4px; background: var(--admin-amber); border-color: var(--admin-amber); color: var(--admin-ink); box-shadow: none; }
.login-button:hover { transform: none; background: #ffc02e; border-color: #ffc02e; box-shadow: none; }
.form-input { border-width: 1px; border-radius: 4px; background: #fff; }

@media (max-width: 900px) {
  .side-menu { width: 184px; padding-inline: 10px; }
  .brand-area { padding-inline: 2px; }
  .brand-title { font-size: .72rem; }
  .sidebar-title { display: none; }
  .nav-link { padding-inline: 10px; font-size: .78rem; }
  main { margin-left: 184px; padding: 82px 16px 30px; }
  .top-right-menu { right: 16px; }
  .report-card-wide { grid-column: span 1; }
}

@media (max-width: 560px) {
  body:has(.login-container) { padding: 16px; }
  .login-container { padding: 28px 22px; }
  .side-menu {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 8px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .brand-area { min-height: 48px; margin: 0 6px 0 0; padding: 4px 8px; border: 0; }
  .brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .brand-title, .sidebar-header { display: none; }
  .nav-link { width: auto; min-width: max-content; min-height: 38px; margin: 0 3px; padding: 9px 10px; }
  .locale-switcher { margin: 0 0 0 auto; padding: 0; }
  .top-right-menu { position: static; margin: 10px 10px 0 auto; width: max-content; }
  main { margin-left: 0; padding: 24px 10px 30px; }
  .card { padding: 15px; }
  .products-container, .users-container { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
