:root {
  --forest-950: #0b2317;
  --forest-900: #102f1f;
  --forest-800: #17442d;
  --forest-700: #235b3c;
  --leaf: #829c48;
  --lime: #dce9a0;
  --cream: #f4f1e8;
  --paper: #faf9f5;
  --white: #fff;
  --ink: #1a241d;
  --muted: #727a73;
  --line: rgba(21, 62, 40, 0.13);
  --danger: #b85c46;
  --warning: #c98b3e;
  --blue: #5b82a8;
  --shadow: 0 24px 70px rgba(12, 40, 25, 0.12);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.dialog-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-screen {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100dvh;
  padding: 54px clamp(42px, 7vw, 110px);
  overflow: hidden;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% 10%, rgba(220, 233, 160, 0.14), transparent 25%),
    radial-gradient(circle at 85% 72%, rgba(130, 156, 72, 0.12), transparent 30%),
    var(--forest-900);
  color: var(--white);
}

.login-visual::after {
  position: absolute;
  top: -180px;
  right: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(220, 233, 160, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 75px rgba(220, 233, 160, 0.018), 0 0 0 150px rgba(220, 233, 160, 0.012);
  content: "";
}

.login-brand,
.sidebar-brand,
.mobile-login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(220, 233, 160, 0.48);
  border-radius: 50%;
}

.admin-brand-mark::before,
.admin-brand-mark::after {
  position: absolute;
  width: 12px;
  height: 24px;
  border: 1.5px solid var(--lime);
  border-radius: 100% 0 100% 0;
  content: "";
}

.admin-brand-mark::before { left: 9px; top: 8px; transform: rotate(-25deg); }
.admin-brand-mark::after { right: 8px; top: 9px; transform: rotate(60deg); }

.login-brand div,
.sidebar-brand div,
.mobile-login-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.login-brand small,
.sidebar-brand small,
.mobile-login-brand small {
  color: var(--lime);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.24em;
}

.login-brand strong,
.sidebar-brand strong,
.mobile-login-brand strong {
  font-size: 14px;
  letter-spacing: 0.11em;
}

.login-message {
  position: relative;
  z-index: 2;
  margin: auto 0;
}

.login-message > p,
.login-kicker {
  margin: 0 0 18px;
  color: var(--lime);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.login-message h1 {
  margin: 0 0 25px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 6.2vw, 88px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.93;
}

.login-message h1 em { color: var(--lime); font-weight: 400; }
.login-message > span { color: rgba(255, 255, 255, 0.5); font-size: 11px; }

.field-decoration {
  position: absolute;
  right: -12%;
  bottom: -25px;
  left: -12%;
  height: 185px;
  overflow: hidden;
  opacity: 0.18;
}

.field-decoration i {
  position: absolute;
  right: 0;
  left: 0;
  height: 120px;
  border: 1px solid var(--lime);
  border-radius: 50%;
}

.field-decoration i:nth-child(1) { bottom: -96px; }
.field-decoration i:nth-child(2) { bottom: -69px; }
.field-decoration i:nth-child(3) { bottom: -42px; }
.field-decoration i:nth-child(4) { bottom: -15px; }
.field-decoration i:nth-child(5) { bottom: 12px; }

.login-panel {
  display: grid;
  min-height: 100dvh;
  padding: 45px;
  place-items: center;
  background:
    radial-gradient(circle at 90% 8%, rgba(130, 156, 72, 0.08), transparent 25%),
    var(--paper);
}

.login-form { width: min(420px, 100%); }
.mobile-login-brand { display: none; margin-bottom: 50px; color: var(--forest-900); }
.mobile-login-brand .admin-brand-mark { border-color: rgba(23, 68, 45, 0.3); }

.login-kicker { margin-bottom: 12px; color: var(--leaf); }

.login-form h2 {
  margin: 0;
  color: var(--forest-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 49px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.login-description { margin: 16px 0 33px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.admin-field { display: flex; flex-direction: column; gap: 7px; }
.login-form .admin-field + .admin-field { margin-top: 17px; }
.admin-field > span { color: var(--forest-900); font-size: 9px; font-weight: 800; }

.input-shell { position: relative; display: flex; align-items: center; }
.input-shell > i { position: absolute; left: 15px; color: var(--leaf); font-size: 8px; font-style: normal; }
.input-shell input { padding-left: 38px; padding-right: 44px; }
.input-shell button { position: absolute; right: 8px; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.admin-field input,
.admin-field select,
.admin-field textarea,
.search-control input,
.toolbar-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-field input,
.admin-field select { height: 48px; padding: 0 14px; }
.admin-field textarea { min-height: 115px; padding: 13px; resize: vertical; }
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus,
.search-control input:focus,
.toolbar-controls select:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(130, 156, 72, 0.1); }

.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 9px; }

.login-button,
.primary-action {
  display: inline-flex;
  min-height: 49px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: var(--forest-800);
  color: var(--white);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.login-button { width: 100%; }
.login-button:hover, .primary-action:hover { background: var(--forest-700); transform: translateY(-1px); }
.login-button:disabled, .primary-action:disabled { opacity: 0.58; cursor: wait; transform: none; }

.back-site-link { display: block; margin-top: 22px; color: var(--muted); font-size: 9px; text-align: center; }
.back-site-link:hover { color: var(--forest-700); }

.admin-app { min-height: 100dvh; background: #f2f0e9; }

.admin-sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: 260px;
  padding: 29px 22px 22px;
  flex-direction: column;
  background: var(--forest-900);
  color: var(--white);
}

.sidebar-brand { padding: 0 8px 28px; border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
.sidebar-brand .admin-brand-mark { width: 39px; height: 39px; }
.sidebar-brand .admin-brand-mark::before { width: 10px; height: 20px; }
.sidebar-brand .admin-brand-mark::after { width: 10px; height: 20px; }

.admin-nav { margin-top: 30px; }
.admin-nav > p { margin: 0 12px 11px; color: rgba(255, 255, 255, 0.3); font-size: 7px; font-weight: 850; letter-spacing: 0.18em; }

.admin-nav button {
  display: grid;
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  align-items: center;
  grid-template-columns: 27px 1fr auto;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.admin-nav button + button { margin-top: 5px; }
.admin-nav button > span { color: var(--lime); font-size: 17px; }
.admin-nav button > b { font-size: 10px; font-weight: 700; }
.admin-nav button > i { display: grid; min-width: 21px; height: 21px; padding: 0 5px; place-items: center; border-radius: 999px; background: rgba(220, 233, 160, 0.12); color: var(--lime); font-size: 7px; font-style: normal; font-weight: 850; }
.admin-nav button.active, .admin-nav button:hover { background: rgba(220, 233, 160, 0.1); color: var(--white); }
.admin-nav button.active::before { position: absolute; left: 0; width: 3px; height: 25px; border-radius: 0 4px 4px 0; background: var(--lime); content: ""; }

.sidebar-bottom { display: flex; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.09); flex-direction: column; }
.sidebar-bottom a, .sidebar-bottom button { display: flex; min-height: 39px; padding: 0 10px; border: 0; align-items: center; gap: 10px; background: transparent; color: rgba(255, 255, 255, 0.44); font-size: 9px; text-align: left; cursor: pointer; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--white); }
.sidebar-bottom span { color: var(--lime); font-size: 14px; }

.admin-content-shell { min-height: 100dvh; margin-left: 260px; }

.admin-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 90px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 249, 245, 0.9);
  backdrop-filter: blur(16px);
}

.admin-header > div:first-of-type { display: flex; flex-direction: column; }
.admin-header p { margin: 0 0 2px; color: var(--leaf); font-size: 7px; font-weight: 900; letter-spacing: 0.18em; }
.admin-header h1 { margin: 0; color: var(--forest-950); font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.refresh-button { display: grid; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; place-items: center; background: transparent; color: var(--forest-700); cursor: pointer; }
.refresh-button.loading { animation: spin 0.8s linear infinite; }

.admin-user { display: flex; padding-left: 18px; border-left: 1px solid var(--line); align-items: center; gap: 9px; }
.admin-user > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--forest-800); color: var(--lime); font-family: Georgia, serif; }
.admin-user > div { display: flex; flex-direction: column; }
.admin-user strong { color: var(--forest-900); font-size: 9px; }
.admin-user small { color: var(--muted); font-size: 7px; }
.sidebar-toggle { display: none; }

.admin-main { padding: 32px 38px 50px; }
.admin-view { animation: view-in 0.28s ease both; }

.welcome-card {
  position: relative;
  display: flex;
  min-height: 210px;
  padding: 34px 39px;
  overflow: hidden;
  border-radius: 22px;
  align-items: center;
  justify-content: space-between;
  background:
    radial-gradient(circle at 78% 35%, rgba(220, 233, 160, 0.12), transparent 25%),
    var(--forest-800);
  color: var(--white);
}

.welcome-card::after { position: absolute; right: -100px; bottom: -210px; width: 490px; height: 490px; border: 1px solid rgba(220, 233, 160, 0.11); border-radius: 50%; box-shadow: 0 0 0 58px rgba(220, 233, 160, 0.02), 0 0 0 116px rgba(220, 233, 160, 0.012); content: ""; }
.welcome-card > div:first-child { position: relative; z-index: 2; }
.welcome-card p { margin: 0 0 11px; color: var(--lime); font-size: 7px; font-weight: 900; letter-spacing: 0.2em; }
.welcome-card h2 { margin: 0 0 17px; font-family: Georgia, "Times New Roman", serif; font-size: 37px; font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
.welcome-card h2 em { color: var(--lime); font-weight: 400; }
.welcome-card > div:first-child > span { color: rgba(255, 255, 255, 0.45); font-size: 8px; }

.welcome-symbol { position: relative; z-index: 2; display: grid; width: 130px; height: 130px; place-items: center; }
.welcome-symbol > span { display: grid; width: 83px; height: 83px; place-items: center; border: 1px solid rgba(220, 233, 160, 0.28); border-radius: 50%; background: rgba(220, 233, 160, 0.08); color: var(--lime); font-size: 40px; transform: rotate(180deg); }
.welcome-symbol i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.welcome-symbol i:nth-child(2) { top: 8px; left: 34px; }
.welcome-symbol i:nth-child(3) { right: 7px; bottom: 38px; }

.stats-grid { display: grid; margin-top: 17px; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stat-card { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.stat-card > div { display: flex; align-items: center; gap: 8px; }
.stat-card > div span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: rgba(23, 68, 45, 0.07); color: var(--forest-700); font-size: 11px; }
.stat-card small { color: var(--muted); font-size: 6.5px; font-weight: 850; letter-spacing: 0.08em; }
.stat-card > strong { display: block; margin: 13px 0 3px; color: var(--forest-950); font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-weight: 400; line-height: 1; }
.stat-card p { margin: 0; color: var(--muted); font-size: 7px; }
.stat-card.stat-main { border-color: transparent; background: var(--lime); }
.stat-card.stat-main > div span { background: var(--forest-800); color: var(--lime); }
.stat-card.stat-main small, .stat-card.stat-main p { color: rgba(16, 47, 31, 0.62); }

.overview-grid { display: grid; margin-top: 17px; grid-template-columns: 1.25fr 0.75fr; gap: 17px; }
.panel-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.panel-heading { display: flex; margin-bottom: 18px; align-items: flex-start; justify-content: space-between; }
.panel-heading p, .view-toolbar > div:first-child > p { margin: 0 0 3px; color: var(--leaf); font-size: 6.5px; font-weight: 900; letter-spacing: 0.17em; }
.panel-heading h2, .view-toolbar h2 { margin: 0; color: var(--forest-950); font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 400; }
.panel-heading button { padding: 4px 0; border: 0; border-bottom: 1px solid var(--forest-700); background: transparent; color: var(--forest-700); font-size: 8px; font-weight: 800; cursor: pointer; }

.recent-list { display: flex; flex-direction: column; }
.recent-item { display: grid; min-width: 0; padding: 12px 0; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 11px; cursor: pointer; }
.recent-item + .recent-item { border-top: 1px solid var(--line); }
.recent-avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: rgba(23, 68, 45, 0.08); color: var(--forest-700); font-family: Georgia, serif; font-size: 14px; }
.recent-copy { min-width: 0; display: flex; flex-direction: column; }
.recent-copy strong { overflow: hidden; color: var(--forest-900); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy span { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item time { color: var(--muted); font-size: 7px; }
.recent-item > b { color: var(--leaf); font-size: 13px; }

.status-chip { display: inline-flex; min-height: 23px; padding: 0 9px; border-radius: 999px; align-items: center; background: rgba(201, 139, 62, 0.11); color: #a46a28; font-size: 6.5px; font-style: normal; font-weight: 850; white-space: nowrap; }
.status-chip.progress { background: rgba(91, 130, 168, 0.11); color: var(--blue); }
.status-chip.done { background: rgba(93, 139, 77, 0.11); color: #558046; }

.service-ranking { display: flex; flex-direction: column; gap: 14px; }
.ranking-item { display: grid; align-items: center; grid-template-columns: 1fr 32px; gap: 8px; }
.ranking-item > div { min-width: 0; }
.ranking-item p { display: flex; margin: 0 0 5px; justify-content: space-between; gap: 10px; }
.ranking-item p span { overflow: hidden; color: var(--forest-900); font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ranking-item p b { color: var(--muted); font-size: 7px; }
.ranking-bar { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(23, 68, 45, 0.08); }
.ranking-bar i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); }
.ranking-item > strong { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(23, 68, 45, 0.07); color: var(--forest-700); font-size: 9px; }
.manage-services-link { display: flex; width: 100%; margin-top: 21px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; background: transparent; color: var(--forest-700); font-size: 8px; font-weight: 800; cursor: pointer; }

.view-toolbar { display: flex; margin-bottom: 25px; align-items: flex-end; justify-content: space-between; gap: 25px; }
.view-toolbar h2 { font-size: 31px; }
.view-toolbar > div:first-child > span { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.toolbar-controls { display: flex; align-items: center; gap: 9px; }
.search-control { position: relative; display: flex; width: 265px; align-items: center; }
.search-control > span { position: absolute; left: 12px; color: var(--muted); font-size: 16px; }
.search-control input { height: 42px; padding: 0 12px 0 37px; }
.toolbar-controls select { width: 155px; height: 42px; padding: 0 10px; }

.request-table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.request-table { width: 100%; border-collapse: collapse; }
.request-table th { padding: 14px 17px; border-bottom: 1px solid var(--line); background: rgba(23, 68, 45, 0.025); color: var(--muted); font-size: 6.5px; font-weight: 850; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; }
.request-table td { padding: 15px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.request-table tbody tr:last-child td { border-bottom: 0; }
.request-table tbody tr { cursor: pointer; transition: background 0.18s ease; }
.request-table tbody tr:hover { background: rgba(220, 233, 160, 0.1); }
.table-producer { display: flex; min-width: 170px; align-items: center; gap: 10px; }
.table-producer > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: rgba(23, 68, 45, 0.07); color: var(--forest-700); font-family: Georgia, serif; font-size: 13px; }
.table-producer div { display: flex; flex-direction: column; }
.table-producer strong { color: var(--forest-900); font-size: 8.5px; }
.table-producer small { color: var(--muted); font-size: 6.5px; }
.table-service { max-width: 230px; overflow: hidden; color: var(--forest-800); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.row-action { display: grid; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; place-items: center; background: transparent; color: var(--forest-700); cursor: pointer; }

.empty-state { padding: 65px 20px; text-align: center; }
.empty-state > span { display: grid; width: 56px; height: 56px; margin: 0 auto 15px; place-items: center; border-radius: 18px; background: rgba(23, 68, 45, 0.07); color: var(--leaf); font-size: 24px; }
.empty-state h3 { margin: 0; color: var(--forest-900); font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 8px; }

.services-toolbar { align-items: center; }
.primary-action { min-height: 43px; font-size: 8px; }
.primary-action > span { font-size: 15px; }

.admin-service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.admin-service-card { position: relative; display: flex; min-height: 250px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; flex-direction: column; background: var(--paper); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.admin-service-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.admin-service-card.inactive { opacity: 0.66; }
.admin-service-card::after { position: absolute; right: -70px; bottom: -90px; width: 170px; height: 170px; border: 1px solid rgba(23, 68, 45, 0.07); border-radius: 50%; content: ""; }
.admin-service-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.admin-service-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: rgba(23, 68, 45, 0.08); color: var(--forest-700); font-size: 19px; }
.active-label { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: rgba(93, 139, 77, 0.1); color: #558046; font-size: 6px; font-weight: 850; }
.active-label.inactive { background: rgba(114, 122, 115, 0.1); color: var(--muted); }
.admin-service-card h3 { position: relative; z-index: 2; margin: 23px 0 8px; color: var(--forest-950); font-family: Georgia, serif; font-size: 20px; font-weight: 400; line-height: 1.1; }
.admin-service-card p { position: relative; z-index: 2; margin: 0 0 18px; color: var(--muted); font-size: 8px; line-height: 1.55; }
.admin-service-footer { position: relative; z-index: 2; display: flex; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; }
.admin-service-footer > span { color: var(--muted); font-size: 6.5px; }
.admin-service-footer button { padding: 4px 0; border: 0; border-bottom: 1px solid var(--forest-700); background: transparent; color: var(--forest-700); font-size: 7px; font-weight: 850; cursor: pointer; }

.sidebar-overlay { display: none; }

.admin-dialog,
.confirm-dialog {
  width: min(670px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 35px 120px rgba(5, 28, 16, 0.35);
  color: var(--ink);
  animation: dialog-in 0.28s ease both;
}

.admin-dialog::backdrop,
.confirm-dialog::backdrop { background: rgba(5, 27, 16, 0.72); backdrop-filter: blur(6px); }
.request-dialog { width: min(940px, calc(100% - 28px)); }
.service-dialog { width: min(650px, calc(100% - 28px)); }

.dialog-head { display: flex; min-height: 82px; padding: 18px 24px; border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; background: rgba(23, 68, 45, 0.025); }
.dialog-head p { margin: 0 0 3px; color: var(--leaf); font-size: 6px; font-weight: 900; letter-spacing: 0.18em; }
.dialog-head h2 { margin: 0; color: var(--forest-950); font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.dialog-head > button { display: grid; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; place-items: center; background: transparent; color: var(--forest-700); font-size: 19px; cursor: pointer; }
.dialog-body { max-height: calc(100dvh - 210px); padding: 24px; overflow-y: auto; }
.dialog-actions { display: flex; min-height: 72px; padding: 14px 24px; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 15px; background: var(--white); }
.dialog-actions > div { display: flex; gap: 8px; }
.secondary-action, .danger-button, .danger-action { display: inline-flex; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; align-items: center; justify-content: center; background: transparent; color: var(--muted); font-size: 8px; font-weight: 800; cursor: pointer; }
.danger-button { border-color: rgba(184, 92, 70, 0.2); color: var(--danger); }
.danger-action { border-color: transparent; background: var(--danger); color: var(--white); }

.producer-profile { display: flex; padding-bottom: 19px; border-bottom: 1px solid var(--line); align-items: center; gap: 12px; }
.producer-profile > span { display: grid; width: 47px; height: 47px; place-items: center; border-radius: 14px; background: var(--forest-800); color: var(--lime); font-family: Georgia, serif; font-size: 19px; }
.producer-profile > div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.producer-profile h3 { margin: 0; color: var(--forest-950); font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.producer-profile p { margin: 1px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.detail-grid { display: grid; padding: 20px 0; grid-template-columns: 1fr 1fr; gap: 17px 25px; }
.detail-grid > div { display: flex; min-width: 0; flex-direction: column; }
.detail-grid small, .message-box small, .success-protocol small { color: var(--muted); font-size: 6px; font-weight: 850; letter-spacing: 0.12em; }
.detail-grid strong, .detail-grid a { margin-top: 3px; overflow-wrap: anywhere; color: var(--forest-900); font-size: 9px; }
.detail-grid a { text-decoration: underline; text-decoration-color: rgba(23, 68, 45, 0.25); }
.detail-full { grid-column: 1 / 3; }
.message-box { padding: 15px; border-radius: 12px; background: rgba(220, 233, 160, 0.18); }
.message-box p { margin: 7px 0 0; color: var(--forest-900); font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.request-management { display: grid; margin-top: 20px; grid-template-columns: 0.4fr 0.6fr; gap: 13px; }
.request-management textarea { min-height: 86px; }

.admin-communication-grid { display: grid; margin-top: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(270px, 0.8fr); gap: 14px; }
.communication-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.communication-head { display: flex; padding-bottom: 13px; border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 12px; }
.communication-head > div { min-width: 0; }
.communication-head small { color: var(--leaf); font-size: 6px; font-weight: 900; letter-spacing: 0.13em; }
.communication-head h3 { margin: 3px 0 0; color: var(--forest-950); font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.communication-head > span { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: rgba(23, 68, 45, 0.07); color: var(--forest-700); font-size: 13px; }
.admin-thread { display: flex; height: 245px; margin: 13px 0; padding: 4px 4px 4px 0; overflow-y: auto; flex-direction: column; gap: 9px; scroll-behavior: smooth; }
.chat-sync-status { display: inline-flex; margin-top: 10px; align-items: center; gap: 7px; color: var(--muted); font-size: 6px; font-weight: 750; }
.chat-sync-status i { width: 7px; height: 7px; border-radius: 50%; background: #63a650; box-shadow: 0 0 0 4px rgba(99, 166, 80, 0.12); animation: live-sync-pulse 1.8s ease-in-out infinite; }
.thread-message { width: min(88%, 390px); padding: 10px 12px; border-radius: 12px 12px 12px 3px; align-self: flex-start; background: rgba(23, 68, 45, 0.055); }
.thread-message.sent { border-radius: 12px 12px 3px; align-self: flex-end; background: var(--forest-800); color: var(--white); }
.thread-message > div { display: flex; margin-bottom: 5px; align-items: center; justify-content: space-between; gap: 10px; }
.thread-message strong { color: var(--forest-900); font-size: 7px; }
.thread-message.sent strong { color: var(--lime); }
.thread-message time { color: var(--muted); font-size: 5.5px; white-space: nowrap; }
.thread-message.sent time { color: rgba(255, 255, 255, 0.62); }
.thread-message p { margin: 0; color: var(--forest-900); font-size: 8px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-message.sent p { color: var(--white); }
.thread-loading, .thread-error { margin: auto; color: var(--muted); font-size: 8px; text-align: center; }
.thread-error { color: var(--danger); }
.reply-field textarea { min-height: 78px; }
.reply-actions { display: flex; margin-top: 9px; align-items: center; justify-content: space-between; gap: 12px; }
.reply-actions > small { color: var(--muted); font-size: 6px; }
.document-help { margin: 13px 0; color: var(--muted); font-size: 7px; line-height: 1.55; }
.admin-document-list { display: flex; max-height: 210px; margin-bottom: 12px; overflow-y: auto; flex-direction: column; gap: 7px; }
.admin-document-item { display: grid; padding: 9px; border: 1px solid var(--line); border-radius: 10px; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.admin-document-item > span { display: grid; width: 32px; height: 34px; place-items: center; border-radius: 7px; background: rgba(184, 92, 70, 0.1); color: var(--danger); font-size: 6px; font-weight: 900; }
.admin-document-item > div { display: flex; min-width: 0; flex-direction: column; }
.admin-document-item strong { overflow: hidden; color: var(--forest-900); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.admin-document-item small { margin-top: 2px; color: var(--muted); font-size: 5.5px; }
.admin-document-item a { color: var(--forest-700); font-size: 6.5px; font-weight: 850; }
.admin-document-item button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; background: rgba(184, 92, 70, 0.08); color: var(--danger); cursor: pointer; }
.pdf-upload-button { display: grid; width: 100%; min-height: 64px; padding: 10px; border: 1px dashed rgba(23, 68, 45, 0.27); border-radius: 11px; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 9px; background: rgba(220, 233, 160, 0.13); color: var(--forest-800); text-align: left; cursor: pointer; }
.pdf-upload-button > span { display: grid; width: 32px; height: 32px; grid-row: 1 / 3; place-items: center; border-radius: 9px; background: var(--forest-800); color: var(--lime); font-size: 15px; }
.pdf-upload-button strong { align-self: end; font-size: 7.5px; }
.pdf-upload-button small { align-self: start; color: var(--muted); font-size: 6px; }
.pdf-upload-button:disabled { opacity: 0.62; cursor: wait; }

.service-form-preview { display: flex; margin-bottom: 20px; padding: 15px; border-radius: 13px; align-items: center; gap: 12px; background: var(--forest-800); color: var(--white); }
.service-form-preview > span { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 11px; background: rgba(220, 233, 160, 0.12); color: var(--lime); font-size: 18px; }
.service-form-preview div { display: flex; flex-direction: column; }
.service-form-preview small { color: var(--lime); font-size: 6px; font-weight: 850; letter-spacing: 0.13em; }
.service-form-preview strong { font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.service-form-grid { display: grid; grid-template-columns: 0.2fr 0.2fr 0.6fr; gap: 13px; }
.field-description { grid-column: 1 / 4; }
.field-description textarea { min-height: 105px; }
.active-switch { display: flex; margin-top: 19px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; align-items: center; gap: 11px; cursor: pointer; }
.active-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.active-switch > span { position: relative; width: 36px; height: 21px; flex: 0 0 auto; border-radius: 999px; background: #c6cac6; transition: background 0.2s ease; }
.active-switch > span i { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18); transition: transform 0.2s ease; }
.active-switch > input:checked + span { background: var(--leaf); }
.active-switch > input:checked + span i { transform: translateX(15px); }
.active-switch > div { display: flex; flex-direction: column; }
.active-switch strong { color: var(--forest-900); font-size: 8px; }
.active-switch small { color: var(--muted); font-size: 7px; }

.confirm-dialog { width: min(390px, calc(100% - 28px)); padding: 30px; text-align: center; }
.confirm-icon { display: grid; width: 55px; height: 55px; margin: 0 auto 17px; place-items: center; border-radius: 50%; background: rgba(184, 92, 70, 0.1); color: var(--danger); font-family: Georgia, serif; font-size: 24px; }
.confirm-dialog h2 { margin: 0; color: var(--forest-950); font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.confirm-dialog p { margin: 8px 0 23px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.confirm-dialog > div:last-child { display: flex; justify-content: center; gap: 8px; }

.admin-toast { position: fixed; z-index: 200; right: 23px; bottom: 23px; max-width: 350px; padding: 13px 17px; border-radius: 11px; background: var(--forest-950); box-shadow: var(--shadow); color: var(--white); font-size: 9px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 0.2s ease, transform 0.2s ease; }
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.error { background: #7c3628; }

@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live-sync-pulse { 50% { box-shadow: 0 0 0 7px rgba(99, 166, 80, 0.03); opacity: 0.72; } }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .admin-service-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 34px; }
  .mobile-login-brand { display: flex; }

  .admin-sidebar { width: 260px; transform: translateX(-100%); transition: transform 0.25s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 40; inset: 0; display: block; background: rgba(5, 27, 16, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .admin-content-shell { margin-left: 0; }
  .admin-header { padding: 0 24px; }
  .sidebar-toggle { display: block; width: 40px; height: 40px; padding: 9px; border: 0; background: transparent; cursor: pointer; }
  .sidebar-toggle span { display: block; width: 21px; height: 1.5px; margin: 5px auto; background: var(--forest-800); }
  .admin-header > div:first-of-type { margin-right: auto; margin-left: 7px; }
  .admin-user > div { display: none; }
  .admin-user { padding-left: 12px; }
  .admin-main { padding: 25px 24px 40px; }
}

@media (max-width: 650px) {
  .login-panel { padding: 26px 20px; }
  .login-form h2 { font-size: 42px; }
  .mobile-login-brand { margin-bottom: 38px; }

  .admin-header { min-height: 75px; }
  .admin-header p { display: none; }
  .admin-header h1 { font-size: 21px; }
  .header-actions { gap: 7px; }
  .refresh-button { width: 34px; height: 34px; }
  .admin-user { padding-left: 7px; border-left: 0; }
  .admin-user > span { width: 33px; height: 33px; }
  .admin-header { padding-inline: 18px; }
  .admin-main { padding: 18px 18px 35px; }

  .welcome-card { min-height: 205px; padding: 26px; }
  .welcome-card h2 { font-size: 31px; }
  .welcome-symbol { position: absolute; right: -25px; bottom: -20px; opacity: 0.45; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-card small { font-size: 5.7px; }
  .stat-card > strong { font-size: 31px; }
  .panel-card { padding: 18px; }
  .recent-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .recent-item time { display: none; }

  .view-toolbar { align-items: stretch; flex-direction: column; gap: 17px; }
  .view-toolbar h2 { font-size: 27px; }
  .toolbar-controls { align-items: stretch; flex-direction: column; }
  .search-control, .toolbar-controls select { width: 100%; }
  .services-toolbar .primary-action { width: 100%; }

  .request-table thead { display: none; }
  .request-table, .request-table tbody, .request-table tr, .request-table td { display: block; width: 100%; }
  .request-table tr { position: relative; padding: 15px; border-bottom: 1px solid var(--line); }
  .request-table tr:last-child { border-bottom: 0; }
  .request-table td { padding: 5px 0; border: 0; }
  .request-table td:nth-child(2) { padding-left: 44px; }
  .request-table td:nth-child(3) { display: none; }
  .request-table td:nth-child(4) { padding-left: 44px; }
  .request-table td:last-child { position: absolute; top: 18px; right: 14px; width: auto; }

  .admin-service-grid { grid-template-columns: 1fr; }
  .admin-service-card { min-height: 225px; }

  .admin-dialog { width: calc(100% - 28px); max-height: calc(100dvh - 20px); border-radius: 17px; }
  .dialog-head { min-height: 72px; padding: 14px 17px; }
  .dialog-body { max-height: calc(100dvh - 190px); padding: 18px 17px; }
  .dialog-actions { padding: 12px 17px; align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions > .danger-button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-full { grid-column: auto; }
  .request-management { grid-template-columns: 1fr; }
  .admin-communication-grid { grid-template-columns: 1fr; }
  .admin-thread { height: 220px; }
  .service-form-grid { grid-template-columns: 0.35fr 0.65fr; }
  .field-title, .field-description { grid-column: 1 / 3; }
  .confirm-dialog { width: calc(100% - 24px); }
  .admin-toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Tipografia acessível para as áreas administrativas e de atendimento. */
.login-kicker,
.admin-nav > p,
.admin-header p,
.welcome-card p,
.panel-heading p,
.view-toolbar > div:first-child > p,
.dialog-head p,
.communication-head small,
.service-form-preview small {
  font-size: 10px;
}

.login-description,
.back-site-link,
.sidebar-bottom a,
.sidebar-bottom button,
.admin-user small,
.welcome-card > div:first-child > span,
.stat-card small,
.stat-card p,
.panel-heading button,
.recent-copy span,
.recent-item time,
.ranking-item p b,
.view-toolbar > div:first-child > span,
.table-producer small,
.empty-state p,
.active-label,
.admin-service-footer > span,
.producer-profile p,
.detail-grid small,
.message-box small,
.success-protocol small,
.chat-sync-status,
.thread-message time,
.reply-actions > small,
.admin-document-item small,
.pdf-upload-button small,
.active-switch small {
  font-size: 11px;
}

.admin-field > span,
.form-error,
.admin-user strong,
.recent-copy strong,
.ranking-item p span,
.manage-services-link,
.search-control input,
.toolbar-controls select,
.request-table th,
.request-table td,
.table-producer strong,
.status-chip,
.admin-service-card p,
.admin-service-footer button,
.detail-grid strong,
.detail-grid a,
.message-box p,
.thread-message strong,
.thread-message p,
.thread-loading,
.thread-error,
.document-help,
.admin-document-item strong,
.admin-document-item a,
.pdf-upload-button strong,
.active-switch strong,
.confirm-dialog p,
.admin-toast {
  font-size: 13px;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
  font-size: 14px;
}

.admin-field input,
.admin-field select {
  height: 52px;
}

.admin-nav button > b,
.login-button,
.primary-action,
.secondary-action,
.danger-button,
.danger-action {
  font-size: 13px;
}

.status-chip {
  min-height: 30px;
  padding-inline: 11px;
}

.request-table th {
  padding-block: 16px;
}

.request-table td {
  padding-block: 18px;
}

.thread-message {
  width: min(92%, 520px);
  padding: 15px 17px;
  border: 1px solid rgba(23, 68, 45, 0.12);
  background: #e7ebe6;
}

.communication-head h3 {
  font-size: 23px;
  line-height: 1.2;
}

.communication-head small,
.chat-sync-status {
  color: #47604f;
  font-size: 13px;
}

.thread-message > div {
  margin-bottom: 8px;
}

.thread-message strong {
  color: #103b25;
  font-size: 13px;
  font-weight: 850;
}

.thread-message time {
  color: #506158;
  font-size: 11px;
  font-weight: 650;
}

.thread-message p {
  color: #112d1e;
  font-size: 16px;
  line-height: 1.6;
}

.thread-message.sent {
  border-color: #17442d;
  background: #17442d;
}

.thread-message.sent strong {
  color: #e4f0a8;
}

.thread-message.sent time {
  color: rgba(255, 255, 255, 0.86);
}

.thread-message.sent p {
  color: #fff;
}

.admin-document-item {
  padding: 11px;
}

.pdf-upload-button {
  min-height: 76px;
}

@media (max-width: 650px) {
  .admin-header h1 { font-size: 23px; }
  .request-table td { font-size: 13px; }
  .dialog-body { padding-bottom: 24px; }
  .thread-message {
    width: min(96%, 430px);
    padding: 14px 15px;
  }

  .communication-head h3 { font-size: 21px; }
  .thread-message p { font-size: 16px; }
}
