﻿:root {
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: #d5dee8;
  --text-main: #172737;
  --text-muted: #637282;
  --accent: #0d61b3;
  --accent-2: #0a528f;
  --danger: #ff6f6f;
  --shadow: 0 16px 34px rgba(8, 30, 55, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background: #edf1f4;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

h1,
h2,
strong,
button {
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.login-page {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 1rem;
  color: #1b2833;
  background: #edf1f4;
}

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #111a24;
  transition: opacity 500ms ease, visibility 500ms ease;
}

.loader-screen.is-finished {
  opacity: 0;
  visibility: hidden;
}

.loader-panel {
  width: min(90vw, 430px);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(16, 25, 35, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  color: #e9eef5;
}

.loader-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.loader-title {
  margin: 0.7rem 0 0.2rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.loader-subtitle {
  margin: 0;
  color: #b8c4d3;
  font-size: 0.92rem;
}

.loader-track {
  margin-top: 1.4rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.loader-bar {
  display: block;
  width: 35%;
  height: 100%;
  background: #6ec1ff;
  border-radius: 999px;
  animation: slide 1.2s infinite ease-in-out;
}

@keyframes slide {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(390%); }
}

.login-shell {
  width: min(460px, 92vw);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms ease, transform 500ms ease;
}

.login-shell.is-hidden {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.login-card,
.login-side,
.activity-card,
.stat-card,
.home-header {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

.login-card {
  padding: 2rem;
}

.login-page .login-card {
  border: 1px solid #d6dee6;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(8, 30, 55, 0.12);
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0.8rem 0 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.login-card p {
  margin: 0 0 1.4rem;
  color: #5f6f7e;
}

.login-form {
  display: grid;
  gap: 0.7rem;
}

.login-form label {
  font-size: 0.9rem;
  color: #2b3b49;
}

.login-form input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid #c3cfdb;
  border-radius: 11px;
  background: #ffffff;
  color: #152230;
  font: inherit;
}

.login-form input:focus {
  outline: none;
  border-color: #0d61b3;
  box-shadow: 0 0 0 3px rgba(13, 97, 179, 0.18);
}

.login-form button {
  margin-top: 0.5rem;
  border: none;
  border-radius: 11px;
  padding: 0.88rem 1rem;
  color: #ffffff;
  background: #0d61b3;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.login-form button:hover {
  background: #0a528f;
}

.login-form button:active {
  background: #084778;
}

.login-status {
  margin: 0.35rem 0 0;
  color: #9c2f3c;
  font-size: 0.86rem;
  font-weight: 600;
}

.home-page {
  padding: 0;
  color: #172737;
  background: #edf1f4;
}

.dashboard-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 0;
  transition: grid-template-columns 220ms ease;
}

.dashboard-shell.is-collapsed {
  grid-template-columns: 84px 1fr;
}

.sidebar-card {
  border: none;
  border-right: 1px solid #d5dee8;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 0.9rem 0.75rem 1.25rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.8rem;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0d61b3;
  color: #ffffff;
  display: grid;
  place-items: center;
}

.brand-chip svg {
  width: 18px;
  height: 18px;
}

.brand-text h1 {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
  transition: opacity 160ms ease, transform 160ms ease, max-width 220ms ease;
  max-width: 180px;
}

.alpha-badge {
  display: inline-block;
  padding: 0.14rem 0.44rem;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: #cf2436;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #d5dee8;
  background: #f8fbff;
  color: #375577;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 220ms ease;
}

.dashboard-shell.is-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.user-panel {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f7fafc;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #0d4f93;
  background: linear-gradient(160deg, #dbeaf9, #f0f6fd);
  border: 1px solid #bfd3e9;
}

.user-copy strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.2;
}

.user-copy span {
  color: #607386;
  font-size: 0.76rem;
}

.nav-item {
  border: 1px solid transparent;
  border-radius: 11px;
  color: inherit;
  padding: 0.55rem;
  text-decoration: none;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 0.55rem;
  transition: border-color 140ms ease, background-color 140ms ease;
  cursor: pointer;
}

.nav-item:hover {
  border-color: #d9e3ee;
  background: #f5f9fd;
}

.nav-item.is-active {
  border-color: #b8cde2;
  background: #edf5fd;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #405e81;
  display: grid;
  place-items: center;
}

.nav-item.is-active .nav-icon {
  background: #dceaf8;
  color: #0d61b3;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-copy {
  min-width: 0;
}

.nav-kicker {
  display: block;
  color: #607386;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-item strong {
  font-size: 0.92rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.signout {
  border: 1px solid transparent;
  border-radius: 11px;
  color: #315273;
  text-decoration: none;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
}

.signout:hover {
  border-color: #d9e3ee;
  background: #f5f9fd;
}

.signout-text {
  font-size: 0.88rem;
}

.version-pill {
  margin: 0.25rem 0 0;
  justify-self: start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d3deea;
  background: #f4f8fc;
  color: #607386;
  font-size: 0.72rem;
  font-weight: 600;
}

.dashboard-shell.is-collapsed .brand-text {
  opacity: 0;
  transform: translateX(-4px);
  max-width: 0;
  pointer-events: none;
}

.dashboard-shell.is-collapsed .user-copy,
.dashboard-shell.is-collapsed .nav-copy,
.dashboard-shell.is-collapsed .signout-text,
.dashboard-shell.is-collapsed .version-pill {
  display: none;
}

.dashboard-shell.is-collapsed .sidebar-top {
  grid-template-columns: 1fr;
  justify-items: center;
}

.dashboard-shell.is-collapsed .sidebar-nav,
.dashboard-shell.is-collapsed .user-panel,
.dashboard-shell.is-collapsed .signout {
  justify-items: center;
}

.dashboard-shell.is-collapsed .nav-item,
.dashboard-shell.is-collapsed .signout {
  grid-template-columns: 1fr;
  width: 100%;
  justify-items: center;
}

.dashboard-shell.is-collapsed .user-panel {
  grid-template-columns: 1fr;
  width: 100%;
}

.workspace {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
}

.home-brand {
  display: flex;
  align-items: center;
}

.home-header {
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-color: #d5dee8;
  background: #ffffff;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #5f6f7e;
}

.home-header h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.live-pill {
  border: 1px solid #a8c6e4;
  background: #edf5ff;
  color: #184a7a;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.live-pill.is-online {
  border-color: #9bd3b9;
  background: #eefbf3;
  color: #1f6a42;
}

.live-pill.is-offline {
  border-color: #e2a7ad;
  background: #fff2f4;
  color: #952c37;
}

.quick-actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.quick-actions-row button {
  border: 1px solid #ccd9e6;
  border-radius: 10px;
  background: #f7fafc;
  color: #1b334b;
  padding: 0.62rem 0.85rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.quick-actions-row button:hover {
  border-color: #a9bfd6;
  background: #eff5fb;
}

.content-canvas {
  min-height: calc(100vh - 230px);
  border: 1px solid #d5e0ec;
  border-radius: 14px;
  background: #f8fbff;
  padding: 1rem;
}

.content-head h3 {
  margin: 0;
  font-size: 1.12rem;
}

.content-head p {
  margin: 0.35rem 0 0;
  color: #607386;
  font-size: 0.9rem;
}

.content-body {
  margin-top: 1rem;
}

.content-skeleton {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.8rem;
}

.skeleton-card {
  min-height: 130px;
  border-radius: 12px;
  border: 1px dashed #bfd0e2;
  background: linear-gradient(120deg, #f6faff 0%, #f0f6fd 45%, #f6faff 100%);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 0.8rem;
}

.module-grid-single {
  grid-template-columns: 1fr;
}

.module-card {
  border: 1px solid #d5e0ec;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.9rem;
}

.module-card h4 {
  margin: 0;
  font-size: 1rem;
}

.module-card p {
  margin: 0.45rem 0 0;
  color: #607386;
}

.content-error {
  margin: 0;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid #e1b4ba;
  background: #fff3f4;
  color: #9c2f3c;
  font-weight: 600;
}

.admin-card p {
  margin-bottom: 0.8rem;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 0.7rem;
}

.admin-action-card {
  width: 100%;
  display: grid;
  gap: 0.18rem;
  text-align: left;
  border: 1px solid #c8d6e5;
  border-radius: 12px;
  padding: 0.9rem;
  background: #f4f9ff;
  color: #1e3f5f;
  cursor: pointer;
  transition: border-color 130ms ease, background-color 130ms ease, transform 130ms ease;
}

.admin-action-card strong {
  font-size: 0.96rem;
}

.admin-action-card span {
  font-size: 0.82rem;
  color: #4f6a82;
}

.admin-action-card:hover {
  border-color: #9eb8d2;
  background: #ecf4fd;
  transform: translateY(-1px);
}

.admin-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(9, 22, 37, 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-modal {
  width: min(520px, 94vw);
  border: 1px solid #d2dce8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(6, 21, 38, 0.25);
  padding: 1rem;
}

.admin-modal-wide {
  width: min(900px, 96vw);
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e3ebf4;
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.admin-modal-head h4 {
  margin: 0;
  font-size: 1rem;
}

.admin-modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid #d1dcea;
  border-radius: 8px;
  background: #f4f8fc;
  color: #395676;
  cursor: pointer;
}

.admin-modal-close:hover {
  background: #eaf2fb;
}

.admin-user-form {
  display: grid;
  gap: 0.55rem;
  max-width: 100%;
}

.admin-user-form label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334a60;
}

.admin-user-form input,
.admin-user-form select,
.admin-user-form textarea {
  border: 1px solid #c3cfdb;
  border-radius: 10px;
  padding: 0.64rem 0.72rem;
  font: inherit;
  background: #fbfdff;
  resize: vertical;
}

.admin-user-form input:focus,
.admin-user-form select:focus,
.admin-user-form textarea:focus {
  outline: none;
  border-color: #0d61b3;
  box-shadow: 0 0 0 3px rgba(13, 97, 179, 0.14);
}

.admin-user-form button {
  margin-top: 0.35rem;
  width: fit-content;
  border: none;
  border-radius: 10px;
  padding: 0.66rem 0.9rem;
  background: #0d61b3;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.admin-user-form button:hover {
  background: #0a528f;
}

.admin-form-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.admin-cancel-btn {
  border: 1px solid #c6d2df;
  border-radius: 10px;
  background: #f5f9fc;
  color: #2a4a66;
}

.admin-cancel-btn:hover {
  background: #ebf2f9;
}

.admin-user-status {
  margin: 0.2rem 0 0;
  min-height: 1.1rem;
  color: #25623e;
  font-weight: 600;
}

.admin-user-status.is-error {
  color: #9c2f3c;
}

.admin-users-card p {
  margin-bottom: 0.7rem;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  background: #ffffff;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.admin-users-table th,
.admin-users-table td {
  text-align: left;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid #e8eef5;
  font-size: 0.86rem;
}

.admin-users-table th {
  background: #f4f8fc;
  color: #2e4a66;
  font-weight: 700;
}

.admin-users-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-users-empty {
  text-align: center;
  color: #66798d;
  font-style: italic;
}

.daily-log-table-wrap {
  overflow-x: auto;
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  background: #ffffff;
}

.daily-log-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
  padding: 0.55rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.daily-log-view-toggle {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 1px solid #ced9e6;
  border-radius: 9px;
  background: #eaf0f7;
}

.daily-log-view-toggle .dlog-btn {
  margin-top: 0;
  min-width: 92px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #42566d;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.42rem 0.75rem;
  transition: background-color 130ms ease, color 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.daily-log-view-toggle .dlog-btn:hover {
  background: #dfe9f4;
  border-color: #c8d6e6;
  color: #2f455d;
}

.daily-log-search {
  width: min(320px, 100%);
  border: 1px solid #c8d4e2;
  border-radius: 9px;
  background: #ffffff;
  padding: 0.52rem 0.72rem;
  color: #24374a;
  font-size: 0.85rem;
  font-weight: 600;
}

.daily-log-search:focus {
  outline: none;
  border-color: #7ea4cc;
  box-shadow: 0 0 0 3px rgba(63, 114, 170, 0.14);
}

.daily-log-view-toggle .dlog-btn.is-active {
  border-color: #2c61b7;
  background: linear-gradient(180deg, #3a73cf 0%, #2f66c5 100%);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 7px rgba(47, 102, 197, 0.28);
}

@media (max-width: 760px) {
  .daily-log-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .daily-log-search {
    width: 100%;
  }
}

.daily-log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.daily-log-table th,
.daily-log-table td {
  text-align: left;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid #e8eef5;
  font-size: 0.84rem;
  vertical-align: top;
}

.daily-log-table th {
  background: #f4f8fc;
  color: #2e4a66;
  font-weight: 700;
}

.daily-log-table tbody tr:last-child td {
  border-bottom: none;
}

.daily-log-table tbody tr + tr td {
  box-shadow: inset 0 1px 0 #edf1f5;
}

.daily-log-table tbody tr.daily-log-row {
  cursor: pointer;
}

.daily-log-table tbody tr.daily-log-row:hover td {
  background: #f7fbff;
}

.daily-log-empty {
  text-align: center;
  color: #66798d;
  font-style: italic;
}

.daily-log-status-pill {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.daily-log-status-pill.is-open {
  color: #1f6a42;
  background: #eefbf3;
  border-color: #9bd3b9;
}

.daily-log-status-pill.is-closed {
  color: #8f2a34;
  background: #fff2f4;
  border-color: #e2a7ad;
}

.admin-lookup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(230px, 1fr));
  gap: 0.7rem;
}

.admin-lookup-form {
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 0.65rem;
  background: #f9fbfe;
  display: grid;
  gap: 0.45rem;
}

.admin-lookup-form h5 {
  margin: 0;
  font-size: 0.86rem;
  color: #2c4762;
}

.admin-lookup-form input {
  border: 1px solid #c4d0dc;
  border-radius: 8px;
  padding: 0.55rem 0.62rem;
  font: inherit;
}

.admin-lookup-form button {
  width: fit-content;
  border: none;
  border-radius: 8px;
  padding: 0.46rem 0.72rem;
  background: #0d61b3;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.admin-lookup-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-lookup-items {
  margin: 0.15rem 0 0;
  padding-left: 1rem;
  max-height: 120px;
  overflow-y: auto;
  border-top: 1px dashed #d6e0ea;
  padding-top: 0.45rem;
}

.admin-lookup-items li {
  color: #3d556d;
  font-size: 0.82rem;
  line-height: 1.35;
}

.admin-lookup-empty {
  list-style: none;
  margin-left: -1rem;
  color: #73869a;
  font-style: italic;
}

.changelog-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.changelog-entry {
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.75rem;
}

.changelog-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}

.changelog-version-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #b8cde2;
  background: #edf5fd;
  color: #0d4f93;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.changelog-entry-head span {
  font-size: 0.78rem;
  color: #607386;
}

.changelog-entry h5 {
  margin: 0;
  font-size: 0.95rem;
}

.changelog-entry p {
  margin: 0.45rem 0 0;
  color: #3c5268;
  line-height: 1.45;
  white-space: pre-wrap;
}

.changelog-empty {
  margin-top: 0.8rem;
  color: #6a7d92;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 20, 34, 0.46);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: min(580px, 94vw);
  border: 1px solid #cfdae7;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 58px rgba(6, 22, 40, 0.28);
  padding: 1.1rem;
}

.modal-layer:not(.is-hidden) .modal-card {
  animation: modal-in 180ms ease-out;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid #e5edf5;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.06rem;
  color: #162737;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #d5e0ec;
  background: #f5f9fd;
  color: #365272;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.modal-close:hover {
  background: #ebf3fb;
  border-color: #bfd1e5;
}

.modal-form {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.62rem;
}

.modal-form label {
  color: #2f4255;
  font-size: 0.83rem;
  font-weight: 600;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  border: 1px solid #c3cfdb;
  border-radius: 11px;
  padding: 0.74rem 0.82rem;
  font: inherit;
  color: #172737;
  background: #fbfdff;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: #0d61b3;
  box-shadow: 0 0 0 3px rgba(13, 97, 179, 0.14);
  background: #ffffff;
}

.modal-form textarea {
  resize: vertical;
}

.modal-form button {
  margin-top: 0.42rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, #1570c7, #0d61b3);
  color: #ffffff;
  padding: 0.76rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.modal-form button:hover {
  filter: brightness(1.03);
}

.modal-card[data-modal-type="daily-log"] {
  width: min(760px, 90vw);
  border-radius: 8px;
  border: 1px solid #d7dde5;
  background: #f4f6f8;
  box-shadow: 0 16px 34px rgba(9, 20, 33, 0.2);
  max-height: none;
  overflow: visible;
  padding: 0.85rem 0.9rem 0.9rem;
}

.modal-card[data-modal-type="daily-log"] .modal-head {
  border-bottom: 1px solid #dfe5ec;
  padding-bottom: 0.7rem;
}

.modal-card[data-modal-type="daily-log"] .modal-head h3 {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #2c3643;
}

.modal-card[data-modal-type="daily-log"] .modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #7a8796;
}

.modal-card[data-modal-type="daily-log"] .modal-close:hover {
  background: #e9edf2;
  color: #4b5868;
  border-color: #d3dbe4;
}

#dailyLogForm {
  margin-top: 0.8rem;
  gap: 0.75rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

#dailyLogForm label > span {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: #344355;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#dailyLogForm input,
#dailyLogForm select,
#dailyLogForm textarea {
  width: 100%;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #ffffff;
  padding: 0.56rem 0.68rem;
  color: #273748;
  font-size: 0.9rem;
}

#dailyLogForm input:focus,
#dailyLogForm select:focus,
#dailyLogForm textarea:focus {
  outline: none;
  border-color: #aebbc9;
  box-shadow: 0 0 0 2px rgba(61, 99, 141, 0.08);
}

.dlog-top-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
}

.dlog-fieldset {
  margin: 0;
  border: 1px solid #d8e0e9;
  border-radius: 8px;
  padding: 0.65rem;
  background: #f7f9fb;
  display: grid;
  gap: 0.6rem;
}

.dlog-fieldset legend {
  color: #415469;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.35rem;
}

.dlog-timing-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr 1fr;
  gap: 0.5rem;
  align-items: end;
}

.dlog-checkbox-wrap {
  display: grid;
  gap: 0.38rem;
}

.dlog-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0d61b3;
}

.dlog-wide-row {
  display: grid;
}

.dlog-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.dlog-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  background: #edf2f6;
  border: 1px solid #d3dce6;
  border-radius: 8px;
  padding: 0.2rem;
}

#dailyLogForm .dlog-tab {
  margin-top: 0;
  border: 1px solid #d3dce6;
  border-radius: 6px;
  background: #f8fafc;
  color: #54697e;
  padding: 0.48rem 0.62rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

#dailyLogForm .dlog-tab[aria-selected="true"],
#dailyLogForm .dlog-tab.is-active {
  background: #2f66c5;
  border-color: #2f66c5;
  color: #ffffff;
}

#dailyLogForm .dlog-tab[aria-selected="false"] {
  background: #f8fafc;
  border-color: #d3dce6;
  color: #54697e;
}

.dlog-panel {
  display: grid;
  gap: 0.7rem;
}

#dailyLogForm textarea[name="narrative"] {
  min-height: 62px;
}

#dailyLogForm textarea[name="eventDetails"] {
  min-height: 90px;
}

.daily-event-log {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #ffffff;
  padding: 0.6rem 0.68rem;
  display: grid;
  gap: 0.58rem;
}

.daily-event-log-entry {
  display: grid;
  gap: 0.22rem;
}

.daily-event-log-entry + .daily-event-log-entry {
  border-top: 1px solid #e8edf3;
  padding-top: 0.58rem;
}

.daily-event-log-head {
  margin: 0;
  color: #415469;
  font-size: 0.8rem;
  font-weight: 700;
}

.daily-event-log-body {
  margin: 0;
  color: #273748;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.daily-event-log-empty {
  margin: 0;
  color: #6d7f92;
  font-size: 0.84rem;
}

#dailyLogOperators {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.dlog-inline-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
}

.dlog-bottom-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #dde4ec;
}

.dlog-btn {
  margin-top: 0;
  border-radius: 6px;
  padding: 0.52rem 0.78rem;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}

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

.dlog-btn-muted {
  border-color: #c7d2de;
  background: #f4f7fa;
  color: #3a4f64;
}

.dlog-btn-muted:hover:not(:disabled) {
  border-color: #b7c5d3;
  background: #edf2f6;
}

.dlog-btn-primary {
  border-color: #2f66c5;
  background: #2f66c5;
  color: #ffffff;
}

.dlog-btn-primary:hover:not(:disabled) {
  background: #2a5bb0;
  border-color: #2a5bb0;
}

#dailyLogForm .dlog-btn:hover,
#dailyLogForm .dlog-icon-btn:hover {
  filter: none;
}

.dlog-icon-btn {
  margin-top: 0;
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid #c7d2de;
  background: #f4f7fa;
  color: #556a7f;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.dlog-icon-btn:hover {
  background: #ecf1f5;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  border: 1px solid #bfd2e8;
  background: #eef5fd;
  color: #184a7a;
  border-radius: 10px;
  padding: 0.62rem 0.78rem;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(13, 60, 110, 0.14);
}

.toast.is-error {
  border-color: #ebb8be;
  background: #fff3f4;
  color: #9c2f3c;
}

.is-hidden {
  display: none;
}

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

  .dashboard-shell,
  .dashboard-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar-card {
    min-height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #d5dee8;
    grid-template-rows: auto;
  }

  .sidebar-top {
    grid-template-columns: auto 1fr;
  }

  .sidebar-toggle {
    display: none;
  }

  .brand-text,
  .nav-copy,
  .signout-text {
    display: block;
  }

  .nav-item,
  .signout {
    grid-template-columns: 28px 1fr;
  }

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

  .content-skeleton {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .admin-lookup-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dlog-top-row,
  .dlog-timing-row {
    grid-template-columns: 1fr;
  }

  .dlog-bottom-actions {
    flex-direction: column;
  }

  .dlog-bottom-actions .dlog-btn {
    width: 100%;
    max-width: 260px;
  }
}
