:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-soft: #f7faf8;
  --ink: #222426;
  --muted: #6f7276;
  --line: #dce3df;
  --brand: #176b5c;
  --brand-dark: #123f3b;
  --brand-2: #c55a2d;
  --blue: #2f65d8;
  --sky: #4d9bd7;
  --green: #2f8f5b;
  --yellow: #d49b24;
  --red: #c83737;
  --gray: #8a8f98;
  --shadow: 0 18px 42px rgba(25, 43, 40, 0.1);
  --shadow-soft: 0 8px 22px rgba(25, 43, 40, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(23, 107, 92, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    #173331;
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand h1 {
  font-size: 23px;
  margin: 0;
  letter-spacing: 0;
}

.brand span,
.user-box span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav button,
.ghost-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.13);
}

.nav button.active {
  box-shadow: inset 3px 0 0 #81d6c4;
}

.user-box {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logout-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  color: #fff;
  background: #b84232;
  font-weight: 700;
}

.logout-btn:hover {
  background: #a73527;
}

.content {
  padding: 30px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar h2,
.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p,
.auth-panel p,
.empty,
.hint {
  color: var(--muted);
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn.secondary {
  color: var(--ink);
  background: #e6e1d7;
}

.btn.warn {
  background: var(--brand-2);
}

.btn.danger {
  background: var(--red);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat,
.panel,
.auth-panel,
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  font-size: 34px;
  margin-top: 6px;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel,
.metric-card,
.quick-action,
.activity-item,
input,
select,
textarea {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 40px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6eb7a8;
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.12);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

tbody tr:hover {
  background: #f8faf8;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #f7faf8;
}

.detail-table th {
  width: 210px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 700;
}

.dashboard-hero {
  min-height: 176px;
  color: #fff;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(23, 107, 92, 0.95), rgba(18, 63, 59, 0.92)),
    radial-gradient(circle at 85% 15%, rgba(255, 204, 128, 0.42), transparent 28%);
  box-shadow: var(--shadow);
}

.dashboard-hero h2 {
  margin: 6px 0;
  font-size: 36px;
  letter-spacing: 0;
}

.dashboard-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  color: #b8efe2;
  font-size: 13px;
  font-weight: 700;
}

.hero-summary {
  min-width: 148px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-summary span {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.hero-summary strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-top span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
}

.metric-top small,
.metric-card p {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  margin: 18px 0 8px;
}

.metric-card p {
  margin: 0;
  font-size: 13px;
}

.tone-green {
  color: var(--green);
}

.tone-green .metric-top span {
  background: var(--green);
}

.tone-amber {
  color: var(--yellow);
}

.tone-amber .metric-top span {
  background: var(--yellow);
}

.tone-blue {
  color: var(--blue);
}

.tone-blue .metric-top span {
  background: var(--blue);
}

.tone-red {
  color: var(--red);
}

.tone-red .metric-top span {
  background: var(--red);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.status-board,
.quick-panel {
  min-height: 292px;
}

.status-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.status-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}

.status-row strong {
  color: var(--ink);
}

.progress {
  height: 9px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.fill-green {
  background: var(--green);
}

.fill-amber {
  background: var(--yellow);
}

.fill-blue {
  background: var(--blue);
}

.fill-gray {
  background: var(--gray);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 110px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quick-action:hover {
  background: #edf7f3;
  border-color: #b7d9cf;
  transform: translateY(-1px);
}

.quick-action span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
}

.quick-action strong {
  font-size: 15px;
}

.quick-action small {
  color: var(--muted);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.activity-item:hover {
  background: #eef7f3;
}

.activity-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--gray);
}

.activity-dot.Pending {
  background: var(--yellow);
}

.activity-dot.Approved {
  background: var(--sky);
}

.activity-dot.Borrowed {
  background: var(--blue);
}

.activity-dot.Overdue {
  background: var(--red);
}

.Available,
.Returned {
  background: var(--green);
}

.Borrowed {
  background: var(--blue);
}

.Pending {
  background: var(--yellow);
}

.Reserved {
  background: #b7791f;
}

.Approved {
  background: var(--sky);
}

.Overdue {
  background: var(--red);
}

.Maintenance,
.Rejected,
.Cancelled,
.Lost,
.Retired {
  background: var(--gray);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f6f4ef 0%, #edf5f2 100%);
}

.auth-panel {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-copy {
  background: #202b2b;
  color: #fff;
  padding: 38px;
}

.auth-copy p {
  color: rgba(255, 255, 255, 0.75);
}

.auth-form {
  padding: 34px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  border-radius: 8px;
  padding: 10px;
  background: #e6e1d7;
}

.auth-tabs button.active {
  background: var(--brand);
  color: #fff;
}

.message {
  margin-top: 12px;
  color: var(--brand-2);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.day-name,
.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 112px;
  padding: 8px;
}

.day-name {
  min-height: auto;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.day-cell:nth-child(7n),
.day-name:nth-child(7n) {
  border-right: 0;
}

.date-num {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.event-pill {
  display: block;
  width: 100%;
  border-radius: 6px;
  color: #fff;
  padding: 5px 7px;
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e6e1d7;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  flex-wrap: wrap;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  padding: 0 6px;
}

.pagination .btn {
  min-height: 34px;
  padding: 7px 10px;
}

@media (max-width: 1200px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .stats,
  .dashboard-metrics,
  .dashboard-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-hero,
  .panel-title {
    flex-direction: column;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .no-print,
  .modal-backdrop,
  .actions {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  table {
    font-size: 11px;
  }
}
