@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}

:root {
  --brand: #f9cb0c;
  --brand-2: #eab300;
  --text: #0f172a;
  --muted: #475569;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --section-divider: #d1d5db;
  --shadow: none;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-shadow: none !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-main a:not(.icon-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--brand);
  color: #3f3f46;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(234, 179, 0, 0.35);
  text-decoration: none;
}

.app-main a:not(.icon-btn):hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.app-main a:not(.icon-btn):active {
  transform: translateY(1px);
}

.app-main table a:not(.icon-btn) {
  display: inline;
  align-items: initial;
  justify-content: initial;
  gap: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  box-shadow: none;
  text-decoration: none;
}

.app-main table a:not(.icon-btn):hover {
  text-decoration: underline;
  filter: none;
}

.app-main table a:not(.icon-btn):active {
  transform: none;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.icon-btn:hover {
  text-decoration: none;
  background: rgba(249, 203, 12, 0.16);
  border-color: rgba(249, 203, 12, 0.35);
}

.icon-btn[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 50;
}

.icon-btn[aria-label]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(15, 23, 42, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 50;
}

.icon-btn:hover::after,
.icon-btn:hover::before,
.icon-btn:focus-visible::after,
.icon-btn:focus-visible::before {
  opacity: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.app-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.1px;
}

.app-nav a:hover {
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none;
}

.app-nav a:focus-visible {
  outline: 3px solid rgba(249, 203, 12, 0.55);
  outline-offset: 2px;
}

.nav-logout {
  display: inline-flex;
  margin-left: auto;
}

.nav-logout button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.1px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.nav-logout button:hover {
  background: rgba(15, 23, 42, 0.04);
}

.nav-logout button:focus-visible {
  outline: 3px solid rgba(249, 203, 12, 0.55);
  outline-offset: 2px;
}

.app-main {
  max-width: 1100px;
  margin: 18px auto 42px;
  padding: 0 22px;
}

.app-main * + h2 {
  border-top: 1px solid var(--section-divider);
  padding-top: 16px;
  margin-top: 26px;
}

.app-main :is(table, form, .settings-grid, .operational-dashboard, .od-section) + :is(table, form, .settings-grid, .operational-dashboard, .od-section) {
  border-top: 1px solid var(--section-divider);
  margin-top: 26px;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 14px 0 12px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 18px;
  margin: 22px 0 10px;
  color: var(--text);
}

p {
  color: var(--muted);
  margin: 8px 0;
}

.app-messages {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 10px;
}

.app-message {
  background: rgba(249, 203, 12, 0.18);
  border: 1px solid rgba(249, 203, 12, 0.35);
  color: #6b4d00;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 12px 18px !important;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

thead th {
  position: static;
  background: rgba(249, 203, 12, 0.16);
  color: #5c4300;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: none;
  min-height: 44px;
  height: 44px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: rgba(15, 23, 42, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

table + table {
  margin-top: 14px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.table-compact th,
.table-compact td {
  padding: 12px 18px;
}

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

form p {
  margin: 10px 0;
  color: var(--text);
}

label {
  font-weight: 700;
  color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    100% 0;
  background-size:
    6px 6px,
    6px 6px,
    2.6em 100%;
  background-repeat: no-repeat;
}

select:disabled {
  background-color: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.55);
}

select option {
  font: inherit;
}

textarea {
  min-height: 96px;
  max-width: 720px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(249, 203, 12, 0.9);
  box-shadow: 0 0 0 4px rgba(249, 203, 12, 0.25);
}

button,
input[type="submit"] {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--brand);
  color: #3f3f46;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(234, 179, 0, 0.35);
}

button:hover,
input[type="submit"]:hover {
  filter: brightness(0.98);
}

button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

td.actions {
  display: table-cell;
}

.actions a {
  margin-right: 0;
}

.searchbar {
  margin: 12px 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.settings-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.settings-card:hover {
  text-decoration: none;
  border-color: rgba(249, 203, 12, 0.55);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

.settings-card:focus-visible {
  outline: 3px solid rgba(249, 203, 12, 0.55);
  outline-offset: 3px;
}

.settings-icon {
  font-size: 38px;
  color: #6b4d00;
}

.settings-label {
  font-weight: 800;
  color: var(--text);
}

.operational-dashboard {
  display: grid;
  gap: 24px;
}

.od-section {
  display: grid;
  gap: 12px;
}

.auth-shell {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.auth-error {
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.08);
  color: #7f1d1d;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0 14px;
  font-weight: 800;
}

.auth-card form p {
  margin: 10px 0;
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
  max-width: 100%;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.modal h3 {
  margin: 6px 0 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
