:root {
  --navy: #10233f;
  --navy-deep: #0a1629;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --yellow: #d97706;
  --yellow-soft: #fef3c7;
  --cyan: #0891b2;
  --cyan-soft: #cffafe;
  --slate: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --page: #f5f7fb;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --sidebar-width: 286px;
  --sidebar-collapsed-width: 86px;
  --school-background: url("assets/img/school-background.png");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--slate);
  background:
    linear-gradient(135deg, rgba(5, 16, 35, 0.72), rgba(5, 16, 35, 0.55)),
    var(--school-background),
    var(--page);
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Inter', Arial, sans-serif;
}

body:not(.is-authenticated) .sidebar,
body:not(.is-authenticated) .main-content,
body:not(.is-authenticated) .mobile-backdrop {
  display: none;
}

body.is-authenticated .auth-screen {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 34px 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(5, 16, 35, 0.68), rgba(15, 23, 42, 0.46));
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: min(468px, 100%);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 58px rgba(2, 6, 23, 0.24);
}

.auth-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow));
  content: "";
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  text-align: center;
}

.system-logo {
  display: block;
  object-fit: contain;
}

.auth-logo {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  padding: 5px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.auth-brand h1 {
  margin: 7px 0 9px;
  color: var(--navy);
  font-size: 1.38rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.auth-brand p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.58;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  position: relative;
}

.auth-field::after {
  position: absolute;
  left: 14px;
  bottom: 13px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  content: attr(data-icon);
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
}

.auth-field input {
  min-height: 52px;
  padding-left: 50px;
  border-color: rgba(148, 163, 184, 0.52);
  background: rgba(255, 255, 255, 0.98);
}

.auth-field input:focus {
  border-color: rgba(37, 99, 235, 0.82);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--blue), #0891b2);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.24);
}

.auth-submit:hover {
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.3);
}

.link-button {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 18px;
  padding: 10px 12px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  transition: color 0.18s ease, background 0.18s ease;
}

.link-button:hover {
  color: var(--navy);
  background: rgba(37, 99, 235, 0.06);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px;
  overflow: visible;
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.26), rgba(8, 145, 178, 0.1)), var(--navy-deep);
  box-shadow: 12px 0 32px rgba(2, 6, 23, 0.16);
  transition:
    width 0.24s ease,
    padding 0.24s ease,
    transform 0.24s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.14);
}

.brand-copy,
.nav-text {
  transition:
    opacity 0.18s ease,
    width 0.2s ease,
    visibility 0.18s ease;
}

.nav-text {
  white-space: nowrap;
}

.brand-copy {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  font-weight: 800;
}

.brand-title,
.brand-subtitle,
.eyebrow,
.header-copy p,
.stat-card small,
.stat-label,
.admin-profile span,
.empty-state p {
  margin: 0;
}

.brand-title {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.brand-subtitle {
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #38bdf8;
}

.sidebar-logout {
  margin-top: auto;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(248, 113, 113, 0.18);
}

.sidebar-logout:hover {
  color: #ffffff;
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(248, 113, 113, 0.3);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 28px;
  transition:
    margin-left 0.24s ease,
    padding 0.24s ease;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.hamburger {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-copy {
  min-width: 0;
}

.header-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.sidebar-toggle {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.sidebar-toggle span {
  background: #ffffff;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 999px;
  background: var(--navy);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.hamburger.is-close span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.is-close span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-close span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.eyebrow {
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.header-copy h1 {
  margin: 5px 0 7px;
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.header-copy p:last-child {
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
}

.search-box span {
  color: var(--muted);
  font-size: 1.1rem;
}

.search-box input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--slate);
  background: transparent;
}

.search-box input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #94a3b8;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
}

.logout-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--red);
  background: #fff7f7;
  font-size: 0.76rem;
  font-weight: 800;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.logout-button:hover {
  background: var(--red-soft);
  transform: translateY(-1px);
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-profile strong {
  display: block;
  color: var(--navy);
  font-size: 0.88rem;
}

.admin-profile span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: '';
}

.stat-card::after {
  position: absolute;
  right: -26px;
  bottom: -30px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  content: '';
  opacity: 0.7;
}

.stat-total::before,
.stat-total::after {
  background: var(--blue);
}

.stat-good::before,
.stat-good::after {
  background: var(--green);
}

.stat-damaged::before,
.stat-damaged::after {
  background: var(--red);
}

.stat-repair::before,
.stat-repair::after {
  background: var(--yellow);
}

.stat-finished::before,
.stat-finished::after {
  background: var(--cyan);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.report-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.report-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.report-stat-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.report-stat-card::after {
  position: absolute;
  right: -26px;
  bottom: -28px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  content: "";
  opacity: 0.22;
}

.report-stat-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.15;
}

.report-stat-card small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.report-stat-total::before,
.report-stat-total::after {
  background: var(--blue);
}

.report-stat-today::before,
.report-stat-today::after {
  background: var(--cyan);
}

.report-stat-asset::before,
.report-stat-asset::after {
  background: var(--green);
}

.report-stat-admin::before,
.report-stat-admin::after {
  background: var(--yellow);
}

.report-stat-export::before,
.report-stat-export::after {
  background: var(--red);
}

.workspace-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.report-filter-card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.report-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.report-filter-header h3 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: 1.14rem;
}

.report-filter-header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.report-export-button {
  min-width: 148px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.report-export-button:hover {
  transform: translateY(-1px);
}

.report-excel-button {
  background: var(--green);
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2);
}

.report-excel-button:hover {
  box-shadow: 0 16px 28px rgba(22, 163, 74, 0.26);
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.settings-panel {
  margin-bottom: 18px;
}

.settings-grid {
  display: grid;
  gap: 18px;
}

.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.admin-list-card {
  display: grid;
  align-items: stretch;
}

.admin-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-total {
  min-width: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  text-align: center;
}

.admin-total span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.admin-total strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.8rem;
  line-height: 1;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.admin-account-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.94);
}

.admin-account-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-account-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-account-card h4 {
  margin: 0;
  color: var(--navy);
  font-size: 0.96rem;
}

.admin-account-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.admin-account-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-status-button,
.admin-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.76rem;
  font-weight: 800;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.admin-status-button:hover,
.admin-delete-button:hover {
  transform: translateY(-1px);
}

.admin-status-button.activate {
  color: #166534;
  background: var(--green-soft);
  border-color: rgba(22, 163, 74, 0.2);
}

.admin-status-button.deactivate {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.18);
}

.admin-delete-button {
  color: #b91c1c;
  background: #fff1f2;
  border-color: rgba(220, 38, 38, 0.16);
}

.settings-empty {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(248, 250, 252, 0.9);
  text-align: center;
}

.settings-card h3 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: 1.1rem;
}

.settings-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.registration-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.registration-control > span {
  min-width: 72px;
  color: var(--red);
  font-weight: 800;
  text-align: right;
}

.registration-control > span.is-active {
  color: var(--green);
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 32px;
  align-items: center;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.switch-thumb {
  position: absolute;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .switch-track {
  background: var(--green);
}

.toggle-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(26px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  margin: 5px 0 7px;
  color: var(--navy);
  font-size: 1.35rem;
}

.section-heading p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.action-button:hover {
  transform: translateY(-1px);
}

.warning-button {
  background: var(--yellow);
  box-shadow: 0 12px 24px rgba(217, 119, 6, 0.2);
}

.secondary-button {
  padding: 0 16px;
  color: var(--slate);
  background: #f8fafc;
  border-color: var(--line);
}

.danger-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--red);
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.field textarea {
  min-height: 106px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.field select:disabled {
  color: #475569;
  background: #f1f5f9;
  cursor: not-allowed;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

#tableCard[data-report-mode="true"] table {
  min-width: 920px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

thead {
  background: rgba(248, 250, 252, 0.98);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--slate);
  font-size: 0.9rem;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.9);
}

.name-cell strong {
  display: block;
  color: var(--navy);
}

.name-cell span,
.muted-cell {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.note-cell {
  max-width: 240px;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.good {
  color: #166534;
  background: var(--green-soft);
}

.badge.damaged {
  color: #991b1b;
  background: var(--red-soft);
}

.badge.repair {
  color: #92400e;
  background: var(--yellow-soft);
}

.badge.finished {
  color: #155e75;
  background: var(--cyan-soft);
}

.badge.neutral {
  color: #334155;
  background: #e2e8f0;
}

.badge.inactive {
  color: #991b1b;
  background: #fee2e2;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 196px;
}

.action-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.75rem;
}

.detail-action {
  color: #1d4ed8;
  background: var(--blue-soft);
}

.edit-action {
  color: #047857;
  background: var(--green-soft);
}

.delete-action {
  color: #b91c1c;
  background: var(--red-soft);
}

.empty-state {
  display: none;
  padding: 50px 20px;
  text-align: center;
}

.empty-state.visible {
  display: block;
}

.empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 1.4rem;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--navy);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.58);
}

.modal.active {
  display: flex;
}

.modal-card {
  width: min(920px, 100%);
  max-height: min(92vh, 850px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.28);
  animation: modalIn 0.2s ease;
}

.detail-card,
.confirm-card {
  width: min(620px, 100%);
}

.confirm-card p {
  color: var(--muted);
  line-height: 1.6;
}

.logout-card {
  width: min(460px, 100%);
  text-align: center;
}

.logout-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 999px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 1.7rem;
  font-weight: 800;
}

.logout-copy h2 {
  margin: 6px 0 10px;
  color: var(--navy);
}

.logout-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.logout-actions {
  justify-content: center;
  margin-top: 22px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 5px 0 0;
  color: var(--navy);
}

.close-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--slate);
  background: #f8fafc;
  font-size: 1.35rem;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  color: var(--navy);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 160;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  color: var(--slate);
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: toastIn 0.22s ease;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.warning {
  border-left-color: var(--yellow);
}

.toast strong {
  display: block;
  margin-bottom: 3px;
  color: var(--navy);
}

.toast p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(15, 23, 42, 0.44);
}

@media (min-width: 921px) {
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-right: 14px;
    padding-left: 14px;
  }

  body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .brand {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-right: 0;
    padding-left: 0;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
  }

  body.sidebar-collapsed .brand-copy {
    max-height: 0;
  }

  body.sidebar-collapsed .nav-item {
    gap: 0;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  body.sidebar-collapsed .nav-item:hover,
  body.sidebar-collapsed .nav-item.active {
    transform: translateX(0);
  }

  body.sidebar-collapsed .nav-item.active {
    box-shadow: inset 0 -3px 0 #38bdf8;
  }

  body.sidebar-collapsed .nav-item::after {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    z-index: 90;
    padding: 8px 10px;
    border-radius: 7px;
    color: #ffffff;
    background: var(--navy);
    box-shadow: var(--shadow-soft);
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition:
      opacity 0.15s ease,
      transform 0.15s ease;
    white-space: nowrap;
  }

  body.sidebar-collapsed .nav-item:hover::after,
  body.sidebar-collapsed .nav-item:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .report-stats-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .topbar {
    grid-template-columns: minmax(220px, 1fr);
  }

  .header-actions {
    grid-column: 1;
    align-items: stretch;
    justify-content: space-between;
  }

  .search-box {
    min-width: 220px;
    flex: 1;
  }

  .filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  body {
    background-position: center top;
  }

  .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-right: 12px;
    padding-left: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    width: min(82vw, var(--sidebar-width));
  }

  body.sidebar-open .mobile-backdrop {
    display: block;
  }

  body.sidebar-open .sidebar-toggle {
    background: rgba(255, 255, 255, 0.16);
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
    padding: 18px;
  }

  .brand {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-right: 0;
    padding-left: 0;
  }

  body.sidebar-open .brand {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding-right: 4px;
    padding-left: 4px;
  }

  body:not(.sidebar-open) .brand-copy,
  body:not(.sidebar-open) .nav-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
  }

  body:not(.sidebar-open) .brand-copy {
    max-height: 0;
  }

  body:not(.sidebar-open) .nav-item {
    gap: 0;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .header-actions {
    grid-column: 1 / -1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    flex-direction: column;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .settings-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-filter-header {
    flex-direction: column;
  }

  .report-export-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .registration-control {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 680px) {
  body {
    background-position: center top;
  }

  .auth-screen {
    min-height: 100dvh;
    align-items: start;
    padding: 18px 14px;
  }

  .auth-card {
    width: min(100%, 430px);
    padding: 22px 18px;
    border-radius: 18px;
  }

  .auth-brand {
    align-items: center;
    margin-bottom: 20px;
  }

  .auth-logo {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .auth-brand h1 {
    font-size: 1.12rem;
  }

  .auth-brand p:last-child {
    font-size: 0.86rem;
  }

  .auth-form {
    gap: 13px;
  }

  .auth-field input {
    min-height: 48px;
  }

  .main-content {
    padding: 14px;
  }

  .topbar {
    gap: 14px;
  }

  .header-copy h1 {
    font-size: 1.16rem;
  }

  .header-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-box,
  .admin-profile {
    width: 100%;
  }

  .admin-profile {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .logout-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .stats-grid,
  .report-stats-grid,
  .filters-bar,
  .report-filter-grid,
  .form-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    padding: 16px;
  }

  .settings-card {
    padding: 18px;
  }

  .admin-list-header,
  .admin-account-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-total {
    width: 100%;
  }

  .admin-account-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }

  .section-actions,
  .report-filter-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .modal {
    align-items: flex-start;
    padding: 14px;
  }

  .modal-card {
    max-height: calc(100vh - 28px);
    padding: 18px;
  }

  th,
  td {
    padding: 12px;
  }

  .toast-container {
    right: 16px;
    bottom: 16px;
  }
}
