/* ============================================================
   Mandi Pro design system
   Consolidated from several overlapping revisions into one
   source of truth: tokens -> base -> layout shell -> auth ->
   components -> page-specific sections -> responsive overrides
   (desktop-first, largest breakpoint to smallest) -> motion.
   ============================================================ */

:root {
  --background: #f5f7fa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #27313b;
  --ink-soft: #72808c;
  --border: rgba(38, 53, 68, 0.11);
  --border-strong: rgba(38, 53, 68, 0.18);
  --accent: #1d5fbd;
  --accent-strong: #174f9d;
  --accent-soft: #edf4ff;
  --warning: #c77a13;
  --danger: #bd453d;
  --shadow: 0 14px 34px rgba(24, 37, 49, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 8px 22px rgba(24, 35, 29, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f5f7fa;
  font-family: "Manrope", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

.auth-shell-body, .app-shell-body {
  min-height: 100vh;
}

.app-shell-body.sidebar-open {
  overflow: hidden;
}

.app-shell-body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.auth-shell, .app-main, .sidebar, .auth-card, .auth-hero, .card, .table-card, .stat-card, .brand-card, .topbar, .user-pill {
  backdrop-filter: blur(18px);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.auth-grid-compact {
  grid-template-columns: 1fr 0.9fr;
}

.auth-hero, .auth-card, .card, .table-card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.auth-hero {
  padding: 44px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s ease;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -15% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 193, 92, 0.3), rgba(46, 106, 67, 0.08));
}

.auth-card {
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  animation: fadeUp 0.75s ease;
}

.eyebrow {
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1d5fbd;
}

.muted-text, .auth-copy, .nav-label, .field-note, .table-subtitle, .stat-label, .user-pill-meta {
  color: var(--ink-soft);
}

.auth-hero h1, .auth-card h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  margin-bottom: 16px;
}

.auth-card h2 {
  font-size: 1.9rem;
  margin-bottom: 8px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.metric-chip {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(39, 58, 47, 0.08);
}

.metric-value {
  display: block;
  font-weight: 800;
}

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.auth-highlight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.auth-hero-gallery {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: radial-gradient(circle at top left, rgba(255, 196, 85, 0.34), transparent 34%),
    linear-gradient(160deg, #1f3327 0%, #254633 52%, #31573f 100%);
}

.auth-hero-gallery::after {
  display: none;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8f2e9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-columns {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 430px;
  height: auto;
}

.gallery-column {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
}

.gallery-column::before, .gallery-column::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 2;
  pointer-events: none;
}

.gallery-column::before {
  top: 0;
  background: linear-gradient(180deg, rgba(32, 59, 43, 0.92), rgba(32, 59, 43, 0));
}

.gallery-column::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(32, 59, 43, 0.92), rgba(32, 59, 43, 0));
}

.gallery-strip {
  display: grid;
  gap: 12px;
}

.gallery-column-up .gallery-strip {
  animation: galleryUp 18s linear infinite;
}

.gallery-column-down .gallery-strip {
  animation: galleryDown 18s linear infinite;
}

.gallery-card {
  position: relative;
  margin: 0;
  height: 188px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 16px 28px rgba(10, 19, 14, 0.24);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(10, 19, 14, 0.7) 100%);
}

.gallery-card figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.auth-form, .stacked-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.attachment-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 243, 236, 0.72), rgba(255, 255, 255, 0.88));
  border: 1px dashed rgba(39, 58, 47, 0.18);
}

.attachment-card-copy .field-note {
  margin-bottom: 0;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.attachment-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  width: min(100%, 220px);
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(39, 58, 47, 0.1);
  box-shadow: 0 8px 18px rgba(31, 53, 41, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.attachment-thumb {
  display: block;
  grid-row: span 2;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(39, 58, 47, 0.1);
  background: #ffffff;
}

.attachment-chip strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.2;
}

.attachment-chip:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(46, 106, 67, 0.24);
  box-shadow: 0 12px 24px rgba(31, 53, 41, 0.08);
}

.sheet-entry-table td, .sheet-entry-table th {
  white-space: nowrap;
}

.sheet-entry-input {
  width: 100%;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  min-height: 38px;
}

.sheet-entry-file-input {
  width: 100%;
  min-width: 180px;
  font-size: 0.82rem;
  min-height: 36px;
  padding: 7px 8px;
}

.sheet-inline-upload {
  margin-top: 6px;
}

.sheet-entry-fixed {
  white-space: normal;
  min-width: 180px;
}

.sheet-inline-attachments {
  margin-top: 8px;
  gap: 6px;
}

.sheet-inline-attachment-chip {
  width: 128px;
  padding: 6px 8px;
  border-radius: 9px;
  box-shadow: none;
}

.sheet-inline-attachment-chip strong {
  font-size: 0.76rem;
}

.sheet-inline-attachment-chip span {
  font-size: 0.66rem;
}

.topbar-copy, .page-actions, .topbar-actions, .sheet-header > *, .table-card-header > *, .card-header > *, .dashboard-hero-copy, .dashboard-pill-row, .sheet-toolbar, .sheet-mandi-tabs {
  min-width: 0;
}

.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sheet-mandi-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.sheet-master-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.6fr) repeat(2, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(39, 58, 47, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.sheet-master-panel h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

.sheet-master-group {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.sheet-master-group-label {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-filter-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.sheet-filter-form .field-group {
  gap: 5px;
}

.sheet-mandi-tabs::-webkit-scrollbar {
  height: 6px;
}

.sheet-tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(39, 58, 47, 0.1);
  background: #ffffff;
  color: var(--ink-soft);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  min-height: 38px;
  font-size: 0.92rem;
}

.sheet-tab-link:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.sheet-tab-link.is-active {
  background: linear-gradient(135deg, #21734a, #135736);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(46, 106, 67, 0.18);
}

.sheet-entry-action-cell {
  width: 132px;
  text-align: center;
  white-space: nowrap;
}

.sheet-row-toggle-button {
  min-width: 38px;
  width: 38px;
  height: 38px;
}

.sheet-grid-summary-row td {
  background: rgba(255, 255, 255, 0.38);
}

.sheet-entry-inline-form-row td {
  padding: 12px;
  vertical-align: top;
  background: linear-gradient(180deg, rgba(246, 241, 231, 0.92), rgba(255, 255, 255, 0.96));
  border-bottom: 1px solid rgba(39, 58, 47, 0.08);
}

.sheet-inline-flag-cell {
  width: 72px;
}

.sheet-inline-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(46, 106, 67, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-inline-hint {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.unit-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.unit-select {
  width: auto;
  min-height: 28px;
  padding: 4px 24px 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(39, 58, 47, 0.16);
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

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

.sheet-entry-previous-row td {
  background: rgba(255, 255, 255, 0.2);
  color: var(--ink-soft);
}

.sheet-entry-launch-row td {
  background: rgba(255, 255, 255, 0.12);
  border-bottom: 1px dashed rgba(39, 58, 47, 0.12);
  padding: 7px 12px;
}

.sheet-entry-launch-copy {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.button-compact {
  padding: 10px 16px;
  font-size: 0.9rem;
  min-width: 96px;
}

.button-icon {
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

label {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink);
}

input, select, textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  background-color: #ffffff;
  border-color: rgba(38, 53, 68, 0.16);
  box-shadow: none;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-strong) 50%),
    linear-gradient(135deg, var(--accent-strong) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

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

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #5e99e8;
  box-shadow: 0 0 0 3px rgba(45, 123, 229, 0.13);
  transform: translateY(-1px);
}

.button, button, input[type="submit"] {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  border-radius: 10px;
  padding: 10px 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.icon {
  flex-shrink: 0;
}

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

.button-primary, input[type="submit"] {
  color: #ffffff;
  background: #1d5fbd;
  box-shadow: 0 10px 20px rgba(46, 106, 67, 0.18);
  border-color: #1d5fbd;
}

.button-ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border);
  border-color: var(--border);
}

.button-secondary {
  background: #f1f6ff;
  color: #255898;
  border: 1px solid rgba(33, 115, 74, 0.14);
  border-color: #d8e3f3;
}

.button-danger {
  background: rgba(159, 61, 50, 0.12);
  color: var(--danger);
}

.button-success {
  color: #ffffff;
  background: #1f9d55;
  box-shadow: 0 10px 20px rgba(31, 157, 85, 0.22);
}

.button-block {
  width: 100%;
}

.text-link {
  font-weight: 700;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

input[type="checkbox"] {
  width: auto;
}

.auth-footer {
  padding-top: 4px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  transition: grid-template-columns 0.24s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 22px 28px;
  background: linear-gradient(180deg, #172534 0%, #1f3143 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.96);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.app-shell-body.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

.sidebar-mobile-header, .mobile-nav-button, .desktop-sidebar-toggle, .sidebar-overlay {
  display: none;
}

.sidebar-mobile-header {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.sidebar-mobile-brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.sidebar-close-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.sidebar-close-button span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.sidebar-close-button span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.sidebar-close-button span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.brand-card {
  position: relative;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 14px;
}

.brand-top, .brand-tags {
  position: relative;
  z-index: 1;
}

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

.brand-card h1 {
  margin-bottom: 6px;
  font-size: 1.8rem;
  line-height: 1;
  color: #ffffff;
}

.brand-copy {
  position: relative;
  z-index: 1;
}

.brand-copy .eyebrow {
  margin-bottom: 8px;
  color: rgba(213, 231, 220, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.brand-copy-text, .nav-label {
  color: rgba(255, 255, 255, 0.68);
}

.brand-copy-text {
  max-width: 20ch;
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.48;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, #2d7be5, #1d5fbd);
  box-shadow: 0 18px 32px rgba(6, 14, 9, 0.28);
}

.brand-status, .brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
}

.brand-status {
  white-space: nowrap;
}

.brand-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9be16b;
  box-shadow: 0 0 0 6px rgba(155, 225, 107, 0.16);
}

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

.nav-stack {
  display: grid;
  gap: 26px;
  margin-top: 30px;
}

.nav-group {
  display: grid;
  gap: 12px;
}

.nav-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.nav-link-icon {
  flex: 0 0 auto;
  opacity: 0.85;
}

.nav-link.active .nav-link-icon {
  opacity: 1;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #78aef8;
}

.app-main {
  min-width: 0;
  padding: 24px 26px 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-leading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.topbar-copy {
  max-width: 44rem;
}

.mobile-nav-button {
  align-items: center;
  gap: 5px;
  min-width: 60px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 231, 0.92));
  border: 1px solid var(--border);
  box-shadow: 0 12px 22px rgba(31, 53, 41, 0.08);
  color: var(--ink);
  flex-direction: column;
}

.mobile-nav-button span, .desktop-sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
}

.mobile-nav-button em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.desktop-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 231, 0.92));
  border: 1px solid var(--border);
  box-shadow: 0 12px 22px rgba(31, 53, 41, 0.08);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
}

.topbar-subtitle {
  margin-bottom: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.72));
  border: 1px solid var(--border);
}

.user-pill-name {
  display: block;
  font-weight: 800;
}

.page-frame {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.page-frame > *, .responsive-stack > *, .metrics-grid > *, .card-grid > *, .overview-lane-grid > *, .overview-summary-band > *, .dashboard-summary-grid > *, .dashboard-content-grid > * {
  min-width: 0;
}

.flash {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.flash-alert {
  background: rgba(159, 61, 50, 0.1);
  border-color: rgba(159, 61, 50, 0.18);
  color: var(--danger);
}

.flash-notice {
  background: rgba(46, 106, 67, 0.11);
  border-color: rgba(46, 106, 67, 0.18);
  color: var(--accent-strong);
}

.page-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 0;
}

.page-header > * {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 2vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.page-header-with-icon {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  margin-top: 2px;
}

.page-header-icon.tone-blue {
  background: #1d5fbd;
  color: #ffffff;
}

.page-header-icon.tone-green {
  background: #1f9d55;
  color: #ffffff;
}

.table-search-form {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
}

.table-search-icon {
  position: absolute;
  left: 12px;
  display: inline-flex;
  color: var(--ink-soft);
  pointer-events: none;
}

.table-search-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px 9px 36px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 0.88rem;
  background: var(--surface-strong);
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-weight: inherit;
}

.sort-link:hover {
  text-decoration: none;
  color: var(--accent-strong);
}

.number-cell {
  width: 1%;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.table-pagination .muted-text {
  margin: 0;
  font-size: 0.86rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  background: var(--surface-strong);
}

.pagination-arrow:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.pagination-arrow.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 700;
}

.pagination-page:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

.pagination-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  color: var(--ink-soft);
}

.pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.metrics-grid, .card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card, .card, .table-card {
  padding: 20px;
  min-width: 0;
}

.table-card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.84));
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.65rem;
}

.stat-label {
  font-size: 0.93rem;
}

.data-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-radius: 14px;
  border: 1px solid rgba(24, 35, 29, 0.08);
  background: #ffffff;
  border-color: var(--border);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(39, 58, 47, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #687683;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

tbody tr:hover {
  background: rgba(33, 115, 74, 0.055);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(46, 106, 67, 0.1);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge-warning {
  background: rgba(197, 106, 30, 0.12);
  color: var(--warning);
}

.form-layout, .filters-form {
  display: grid;
  gap: 14px;
}

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

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

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

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

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

.auto-fill-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(39, 58, 47, 0.12);
  border-radius: 8px;
  background: rgba(246, 249, 244, 0.86);
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.auto-fill-summary strong, .auto-fill-summary span:not(:first-child) {
  color: var(--ink);
  font-weight: 800;
}

.advanced-form-section {
  border: 1px solid rgba(39, 58, 47, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.advanced-form-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.advanced-form-section .form-grid-three {
  margin-top: 14px;
}

.daily-entry-defaults {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(39, 58, 47, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  animation: fadeUp 0.32s ease;
}

.daily-entry-defaults-title {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.daily-entry-defaults select, .daily-entry-defaults input {
  min-height: 42px;
}

.daily-master-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(46, 106, 67, 0.16);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(224, 240, 229, 0.82), rgba(255, 255, 255, 0.78));
}

.daily-master-notice h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.daily-master-notice p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.daily-master-notice-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.daily-entry-master-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.daily-entry-master-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(39, 58, 47, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.daily-entry-master-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.daily-entry-master-card:first-child .daily-entry-master-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.daily-entry-master-form input, .daily-entry-master-form select {
  min-height: 42px;
}

.empty-state-with-actions {
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.empty-state-with-actions span {
  max-width: 620px;
  color: var(--ink-soft);
}

.report-filter-card {
  padding: 16px 18px;
}

.report-filter-card .card-header {
  margin-bottom: 14px;
  align-items: center;
}

.filters-form-compact .form-grid-three {
  gap: 10px;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.filters-form-compact label {
  font-size: 0.76rem;
}

.filters-form-compact input, .filters-form-compact select {
  min-height: 38px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 10px;
  padding: 8px 32px 8px 11px;
  font-size: 0.9rem;
}

.report-filter-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-filter-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(46, 106, 67, 0.12);
  border-radius: 999px;
  background: rgba(224, 240, 229, 0.76);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  min-height: 32px;
}

.report-grid-table th, .report-grid-table td {
  vertical-align: top;
}

.sheet-grid-summary-row, .sheet-entry-previous-row, .sheet-entry-inline-form-row {
  transition: background 0.18s ease, transform 0.18s ease;
}

.sheet-grid-summary-row:hover td {
  background: rgba(255, 255, 255, 0.62);
}

.sheet-entry-previous-row:hover td {
  background: rgba(255, 255, 255, 0.34);
}

.table-card-header, .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.import-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.import-inline-form input[type="file"] {
  max-width: 170px;
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.import-inline-form input[type="submit"] {
  padding: 9px 13px;
  font-size: 0.88rem;
}

.button-to-inline {
  display: inline;
  margin: 0;
}

.empty-state {
  padding: 44px 30px;
  border-radius: 14px;
  border: 1px dashed rgba(39, 58, 47, 0.18);
  background: linear-gradient(135deg, rgba(227, 244, 233, 0.75), rgba(255, 255, 255, 0.92));
  text-align: center;
  color: var(--ink-soft);
}

.empty-state .button {
  margin-top: 16px;
}

.form-errors {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(159, 61, 50, 0.16);
  background: rgba(159, 61, 50, 0.08);
  color: var(--danger);
}

.form-errors ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.table-title {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.numeric-cell {
  font-variant-numeric: tabular-nums;
}

.responsive-stack {
  display: grid;
  gap: 18px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sheet-header > div:first-child { min-width: 0; }

.sheet-header.compact {
  margin-bottom: 12px;
}

.sheet-mini-title {
  margin-bottom: 0;
  font-size: 1rem;
}

.report-sheet-grid {
  display: grid;
  gap: 18px;
}

.report-sheet-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-sheet-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-sheet-card {
  padding: 22px;
  background: radial-gradient(circle at top right, rgba(255, 205, 116, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
}

.comparison-launch-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.comparison-launch-summary {
  display: inline-grid;
  width: fit-content;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(39, 58, 47, 0.1);
  background: rgba(255, 255, 255, 0.68);
}

.comparison-launch-summary span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-launch-summary strong {
  color: var(--accent-strong);
  font-size: 1.5rem;
}

.report-grid-table th {
  white-space: nowrap;
}

.report-grid-table td:has(> .inline-actions) {
  min-width: 150px;
}

.report-grid-table td:has(> .inline-actions) .inline-actions {
  flex-wrap: nowrap;
}

.report-grid-table tfoot td {
  background: rgba(46, 106, 67, 0.08);
  border-top: 2px solid rgba(46, 106, 67, 0.18);
  border-bottom: none;
  font-weight: 800;
}

.report-average-row td:first-child {
  color: var(--accent-strong);
}

.summary-report-card, .overview-group-card {
  padding: 24px 28px;
  border-radius: 28px;
  background: radial-gradient(circle at top right, rgba(255, 205, 116, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.8));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 0;
}

.summary-report-title {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  line-height: 1.2;
}

.overview-group-card {
  display: grid;
  gap: 18px;
}

/* Four five-column tables never fit one desktop row without each growing its
   own scrollbar, so the lanes wrap into as many columns as actually fit. */
.overview-lane-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(560px, 1fr));
  gap: 16px;
}

.overview-lane {
  padding: 16px 18px;
  min-height: 100%;
}

.overview-lane .sheet-header { margin-bottom: 12px; }
.overview-lane .data-table-wrapper { overflow-x: auto; }
.overview-lane table { min-width: 0; width: 100%; }

.compact-table th, .compact-table td {
  padding: 9px 10px;
  font-size: 0.82rem;
}

.compact-table th { white-space: nowrap; }

.compact-table th { letter-spacing: 0.02em; white-space: nowrap; }
.compact-table td:first-child { color: #52627d; font-weight: 700; }
.overview-name-cell { color: #15254a; font-weight: 800; }

.compact-empty {
  padding: 20px 16px;
}

.overview-summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.overview-summary-chip {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(247, 243, 234, 0.82);
  border: 1px solid rgba(39, 58, 47, 0.08);
  display: grid;
  gap: 8px;
}

.overview-summary-chip span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-summary-chip strong {
  font-size: 1.25rem;
}

.dashboard-shell {
  gap: 18px;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(220px, 260px);
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top right, rgba(255, 206, 116, 0.34), transparent 28%),
    radial-gradient(circle at bottom left, rgba(71, 133, 84, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  left: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 122, 0.14), rgba(255, 209, 122, 0));
}

.dashboard-hero-copy, .live-clock-card {
  position: relative;
  z-index: 1;
}

.dashboard-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.1vw, 3.2rem);
  line-height: 1.08;
}

.dashboard-lead {
  max-width: 52rem;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.58;
}

.dashboard-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard-pill {
  min-width: 150px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(39, 58, 47, 0.08);
  box-shadow: 0 10px 24px rgba(31, 53, 41, 0.08);
  display: grid;
  gap: 6px;
}

.dashboard-pill-label, .dashboard-stat-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-pill-label {
  color: var(--ink-soft);
}

.dashboard-pill strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.dashboard-actions {
  justify-content: flex-start;
}

.live-clock-card {
  position: relative;
  overflow: hidden;
  display: grid;
  width: min(100%, 250px);
  aspect-ratio: 1;
  justify-self: end;
  gap: 12px;
  align-content: center;
  padding: 22px 18px;
  border-radius: 50%;
  background: radial-gradient(circle at top, rgba(255, 212, 129, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(29, 50, 37, 0.98), rgba(20, 35, 27, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 48px rgba(15, 27, 20, 0.24);
  color: #ffffff;
  isolation: isolate;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.live-clock-card::before {
  content: "";
  position: absolute;
  inset: -30% -60%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0.08) 36%, rgba(255, 226, 163, 0.24) 48%, rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0) 78%);
  transform: translateX(-32%) rotate(8deg);
  opacity: 0.52;
  z-index: 0;
  transition: transform 0.75s ease, opacity 0.3s ease;
}

.live-clock-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 122, 0.3), rgba(255, 209, 122, 0));
  animation: pulseGlow 7s ease-in-out infinite;
}

.live-clock-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 226, 163, 0.18);
  box-shadow: 0 28px 54px rgba(15, 27, 20, 0.3);
}

.live-clock-card:hover::before {
  transform: translateX(12%) rotate(8deg);
  opacity: 0.82;
}

.live-clock-card:hover::after {
  animation-duration: 4.2s;
}

.live-clock-face {
  position: relative;
  width: min(132px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 58%, rgba(255, 255, 255, 0.12) 59%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.04);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.live-clock-face::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: repeating-conic-gradient(
      from -90deg,
      rgba(255, 255, 255, 0.22) 0deg 1.8deg,
      transparent 1.8deg 15deg
    );
  mask: radial-gradient(circle, transparent 58%, #000 59%);
  opacity: 0.5;
}

.live-clock-face::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 224, 163, 0.24);
  animation: orbitSpin 22s linear infinite;
}

.live-clock-card:hover .live-clock-face {
  transform: scale(1.04);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.05),
    0 0 0 10px rgba(255, 226, 163, 0.04);
}

.clock-orbit-line {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  animation: hoverSweep 4.6s linear infinite;
  opacity: 0.92;
  transition: opacity 0.28s ease, filter 0.28s ease, transform 0.28s ease;
}

.clock-orbit-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
      from 90deg,
      rgba(255, 255, 255, 0) 0deg 302deg,
      rgba(255, 224, 163, 0.14) 316deg,
      rgba(255, 248, 232, 0.96) 332deg,
      rgba(155, 225, 107, 0.86) 346deg,
      rgba(255, 255, 255, 0) 360deg
    );
  mask: radial-gradient(circle, transparent 84%, #000 85.4%, #000 87.4%, transparent 88.8%);
  filter: drop-shadow(0 0 10px rgba(255, 236, 184, 0.28));
}

.clock-orbit-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 42%, rgba(255, 231, 172, 0.92) 43% 68%, rgba(155, 225, 107, 0.78) 69% 100%);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 6px rgba(255, 236, 184, 0.08),
    0 0 18px rgba(255, 236, 184, 0.3);
}

.live-clock-card:hover .clock-orbit-line {
  opacity: 1;
  filter: saturate(1.08);
  animation-duration: 2.9s;
}

.clock-hover-sweep {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0) 0deg 290deg,
      rgba(255, 229, 168, 0.14) 304deg,
      rgba(255, 243, 214, 0.95) 322deg,
      rgba(155, 225, 107, 0.78) 336deg,
      rgba(255, 255, 255, 0) 352deg 360deg
    );
  mask: radial-gradient(circle, transparent 66%, #000 68%, #000 72%, transparent 74%);
  opacity: 0.18;
  filter: blur(0.4px);
  transform: rotate(0deg);
  transition: opacity 0.28s ease, filter 0.28s ease;
}

.live-clock-card:hover .clock-hover-sweep {
  opacity: 0.96;
  filter: blur(0.1px);
  animation: hoverSweep 2.8s linear infinite;
}

.clock-ring {
  position: absolute;
  border-radius: 50%;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clock-ring-outer {
  inset: 14px;
  border-color: rgba(255, 255, 255, 0.08);
}

.clock-ring-inner {
  inset: 34px;
  border-color: rgba(255, 226, 163, 0.18);
}

.clock-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
}

.clock-axis-vertical {
  width: 1px;
  height: 76%;
}

.clock-axis-horizontal {
  width: 76%;
  height: 1px;
}

.clock-number {
  position: absolute;
  font-size: 0.84rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.74);
}

.clock-number-12 {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.clock-number-3 {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.clock-number-6 {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.clock-number-9 {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  border-radius: 999px;
  transform-origin: bottom center;
  transform: translateX(-50%);
}

.clock-hand-hour {
  width: 6px;
  height: 40px;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.76));
}

.clock-hand-minute {
  width: 4px;
  height: 54px;
  background: linear-gradient(180deg, #ffe0a3, rgba(255, 224, 163, 0.8));
}

.clock-hand-second {
  width: 2px;
  height: 62px;
  background: linear-gradient(180deg, #9be16b, rgba(155, 225, 107, 0.82));
  box-shadow: 0 0 14px rgba(155, 225, 107, 0.32);
}

.clock-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
  transform: translate(-50%, -50%);
}

.live-clock-meta {
  display: grid;
  gap: 6px;
  padding-inline: 10px;
  justify-items: center;
  text-align: center;
}

.live-clock-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-clock-time {
  font-size: clamp(1.25rem, 1.7vw, 1.6rem);
  letter-spacing: 0.06em;
}

.live-clock-date, .live-clock-zone {
  color: rgba(255, 255, 255, 0.72);
}

.live-clock-date {
  font-size: 0.96rem;
}

.live-clock-zone {
  font-size: 0.88rem;
}

.live-clock-signal {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-height: 18px;
}

.live-clock-signal span {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 224, 163, 0.92), rgba(155, 225, 107, 0.88));
  box-shadow: 0 8px 14px rgba(255, 224, 163, 0.16);
  transform-origin: center;
  animation: signalWave 1.8s ease-in-out infinite;
}

.live-clock-signal span:nth-child(2) {
  animation-delay: 0.18s;
}

.live-clock-signal span:nth-child(3) {
  animation-delay: 0.36s;
}

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

.dashboard-stat-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  min-height: 150px;
  background: radial-gradient(circle at top right, rgba(255, 205, 116, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
}

.dashboard-stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 90px;
  height: 90px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(46, 106, 67, 0.08), rgba(255, 206, 116, 0.18));
  transform: rotate(18deg);
}

.dashboard-stat-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-stat-kicker {
  color: var(--accent);
}

.dashboard-stat-card strong {
  margin-top: 0;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  line-height: 1.08;
}

.dashboard-stat-note {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.86rem;
}

.dashboard-stat-highlight {
  background: radial-gradient(circle at top right, rgba(255, 217, 132, 0.24), transparent 34%),
    linear-gradient(145deg, #214634 0%, #2f5b40 56%, #365b44 100%);
  color: #ffffff;
}

.dashboard-stat-highlight .dashboard-stat-kicker, .dashboard-stat-highlight .dashboard-stat-note {
  color: rgba(255, 255, 255, 0.76);
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.dashboard-side-stack {
  display: grid;
  gap: 18px;
}

.dashboard-table-card, .dashboard-coverage-card, .dashboard-quick-card {
  min-height: 100%;
}

.coverage-list, .dashboard-shortcuts {
  display: grid;
  gap: 14px;
}

.coverage-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(249, 246, 240, 0.72);
  border: 1px solid rgba(39, 58, 47, 0.08);
}

.coverage-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.coverage-row-header strong {
  font-size: 1.02rem;
}

.coverage-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(46, 106, 67, 0.12);
}

.coverage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #478454, #dfb968);
  box-shadow: 0 6px 12px rgba(71, 132, 84, 0.2);
}

.dashboard-shortcut {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 243, 236, 0.88));
  border: 1px solid rgba(39, 58, 47, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-shortcut strong {
  color: var(--ink);
  font-size: 1rem;
}

.dashboard-shortcut span {
  color: var(--ink-soft);
  line-height: 1.5;
}

.dashboard-shortcut:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 106, 67, 0.16);
  box-shadow: 0 16px 28px rgba(31, 53, 41, 0.1);
  text-decoration: none;
}

.portal-dashboard {
  --portal-green: var(--accent);
  --portal-green-dark: var(--accent-strong);
  --portal-mint: var(--accent-soft);
  --portal-border: rgba(46, 106, 67, 0.28);
  min-height: 0;
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 20px;
  border-bottom: 1px solid #d7d7d7;
  background: #efefef;
  color: #555555;
  font-size: 0.82rem;
}

.portal-breadcrumb a {
  color: var(--portal-green-dark);
}

.portal-required-note {
  margin-left: auto;
  padding: 3px 8px;
  background: #fffbea;
  color: #8a6b18;
}

.portal-module-panel {
  margin: 12px 12px 0;
  padding: 0 14px 12px;
  border: 1px solid #d5d5d5;
  background: #ffffff;
}

.portal-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
}

.portal-title-kicker {
  color: #777777;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-panel-title h1 {
  margin: 2px 0 0;
  color: #3b3b3b;
  font-size: 1.25rem;
}

.portal-help {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #bdbdbd;
  color: #ffffff;
  font-weight: 800;
}

.portal-module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #d6d6d6;
}

.portal-module-tabs a {
  position: relative;
  padding: 11px 14px;
  border-radius: 2px;
  background: #373737;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-module-tabs a::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #d9a441;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.portal-module-tabs a:hover, .portal-module-tabs a.active {
  background: #63c7a1;
  text-decoration: none;
}

.portal-module-tabs a.active::before {
  content: "✓";
  width: auto;
  height: auto;
  border: 0;
  color: #fff0b6;
  font-size: 1rem;
}

.portal-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.portal-summary-grid article {
  display: grid;
  min-height: 88px;
  align-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #42a773;
  border-top: 5px solid var(--portal-green);
  background: #ffffff;
}

.portal-summary-grid span {
  color: #666666;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-summary-grid strong {
  color: var(--portal-green-dark);
  font-size: 1.4rem;
}

.portal-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 12px;
  padding: 0 12px 16px;
  align-items: start;
}

.portal-table-panel, .portal-side-card {
  border: 1px solid #d5d5d5;
  background: #ffffff;
}

.portal-section-heading, .portal-side-title {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 10px;
  padding: 8px 12px;
  background: #eeeeee;
}

.portal-section-heading h2, .portal-side-title h2 {
  margin: 0;
  color: #3b3b3b;
  font-size: 1rem;
}

.portal-section-heading p {
  margin: 3px 0 0;
  color: #777777;
  font-size: 0.72rem;
}

.portal-collapse-mark {
  display: grid;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 4px;
  background: #64caa4;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
}

.portal-primary-action {
  margin-left: auto;
  padding: 8px 11px;
  border-radius: 3px;
  background: var(--portal-green);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-primary-action:hover {
  background: var(--portal-green-dark);
  color: #ffffff;
  text-decoration: none;
}

.portal-report-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 14px 7px;
}

.portal-report-tabs a {
  padding: 9px 13px;
  border-top: 4px solid #555555;
  background: #f5b74f;
  color: #ffffff;
  font-size: 0.82rem;
}

.portal-report-tabs a.completed {
  border-top-color: transparent;
  background: #65c9a3;
}

.portal-report-tabs a:hover {
  text-decoration: none;
}

.portal-report-tabs strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
}

.portal-table-scroll {
  overflow-x: auto;
  padding: 0 14px;
}

.portal-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.portal-report-table th, .portal-report-table td {
  padding: 9px 7px;
  border: 1px solid var(--portal-border);
  text-align: left;
  vertical-align: top;
}

.portal-report-table th {
  background: var(--portal-mint);
  color: #3f4c45;
  font-size: 0.72rem;
}

.portal-report-table tbody tr:nth-child(odd) {
  background: #f3f3f3;
}

.portal-report-table tbody tr:hover {
  background: #eef9f3;
}

.portal-report-table td {
  color: #4d4d4d;
}

.portal-report-table td strong {
  color: #e58c4b;
}

.portal-report-table small {
  color: #888888;
}

.portal-status {
  display: inline-block;
  padding: 4px 6px;
  border: 1px solid #38a46b;
  background: #e7f6ed;
  color: #16713e;
  font-size: 0.65rem;
  font-weight: 800;
}

.portal-row-action {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 3px;
  background: #e95558;
  color: #ffffff;
  font-weight: 700;
}

.portal-row-action:hover {
  background: #ce4448;
  color: #ffffff;
  text-decoration: none;
}

.portal-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 16px;
  color: #555555;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.portal-table-footer a {
  color: var(--portal-green-dark);
  font-weight: 800;
}

.portal-side-column {
  display: grid;
  gap: 12px;
}

.portal-state-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.portal-state-row {
  display: grid;
  gap: 6px;
}

.portal-state-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

.portal-state-row strong {
  color: var(--portal-green-dark);
}

.portal-progress {
  height: 8px;
  overflow: hidden;
  background: #e1e1e1;
}

.portal-progress span {
  display: block;
  height: 100%;
  background: #52bc8a;
}

.portal-task-list {
  display: grid;
}

.portal-task-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid #dddddd;
  color: #3f3f3f;
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-task-list a:last-child {
  border-bottom: 0;
}

.portal-task-list a:hover {
  background: #eef9f3;
  color: var(--portal-green-dark);
  text-decoration: none;
}

.portal-task-list a span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 2px;
  background: var(--portal-green);
  color: #ffffff;
}

.portal-empty-state {
  margin: 14px;
  padding: 24px;
  border: 1px dashed #94c9aa;
  background: #f4fbf7;
  color: #567060;
  font-size: 0.85rem;
}

.portal-empty-state.compact {
  padding: 14px;
}

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding: 13px;
  border-top: 1px solid #d0d0d0;
  background: #e5e7e8;
  color: #444444;
  font-size: 0.72rem;
}

.portal-footer span, .portal-footer strong {
  padding: 0 18px;
  border-right: 1px solid #c5c5c5;
}

.portal-footer strong {
  border-right: 0;
}

.brand-tag {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.topbar, .page-header, .card, .table-card, .stat-card, .summary-report-card, .overview-group-card, .report-sheet-card, .portal-dashboard .dashboard-latest-panel {
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.field-group label, label {
  color: #24342b;
}

.mandi-showcase {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(19, 87, 54, 0.94), rgba(38, 103, 130, 0.9)),
    #135736;
  box-shadow: var(--shadow);
  color: #ffffff;
}

.mandi-showcase .eyebrow {
  color: rgba(255, 220, 147, 0.92);
}

.mandi-showcase h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
  line-height: 1.08;
}

.mandi-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.mandi-chip-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(13, 42, 28, 0.1);
}

.mandi-chip-cloud-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(227, 244, 233, 0.92), rgba(235, 245, 250, 0.92));
}

.mandi-chip-cloud-panel span {
  background: #ffffff;
  border-color: rgba(33, 115, 74, 0.12);
  color: var(--accent-strong);
}

.dashboard-overview-grid, .portal-dashboard .dashboard-overview-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.portal-dashboard .dashboard-overview-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(235, 246, 241, 0.92));
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(31, 53, 41, 0.08);
}

.dashboard-overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  border-radius: 10px;
}

.dashboard-overview-icon.tone-blue { background: #e4edfc; color: #1d5fbd; }
.dashboard-overview-icon.tone-green { background: #e2f6ea; color: #1f9d55; }
.dashboard-overview-icon.tone-purple { background: #ece5fb; color: #6d3fce; }
.dashboard-overview-icon.tone-orange { background: #fdece0; color: #c9690f; }
.dashboard-overview-icon.tone-pink { background: #fce4ea; color: #c4306b; }

.dashboard-overview-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.portal-dashboard .dashboard-overview-card-strong {
  background: radial-gradient(circle at 88% 18%, rgba(255, 223, 138, 0.34), transparent 30%),
    linear-gradient(135deg, #164832 0%, #2e6a43 58%, #8a6331 100%);
  color: #ffffff;
}

.portal-dashboard .dashboard-clock-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(235, 245, 250, 0.94));
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  align-content: center;
}

.portal-dashboard .dashboard-latest-header {
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.dashboard-latest-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dashboard-latest-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dashboard-latest-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-per-page-form {
  display: flex;
}

.dashboard-per-page-select {
  min-height: 40px;
  padding: 8px 32px 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.dashboard-date-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
}

.dashboard-date-icon, .dashboard-date-chevron {
  display: inline-flex;
  color: var(--ink-soft);
  flex: 0 0 auto;
}

.dashboard-date-input {
  border: none;
  padding: 0;
  min-height: 0;
  font-weight: 700;
  font-size: 0.9rem;
  background: transparent;
}

td {
  color: #26352d;
}

.sheet-grid-summary-row td:first-child, .sheet-entry-previous-row td:first-child {
  color: var(--accent-strong);
  font-weight: 800;
}

.daily-entry-defaults, .sheet-master-panel, .advanced-form-section, .daily-entry-master-card {
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 242, 0.88));
}

.report-filter-stats span, .badge {
  border-radius: 999px;
}

.portal-dashboard .portal-breadcrumb {
  min-height: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.portal-dashboard .portal-required-note {
  border: 1px solid rgba(197, 106, 30, 0.15);
  border-radius: 999px;
  background: rgba(255, 245, 219, 0.76);
  color: #8a632a;
}

.portal-dashboard .portal-module-panel, .portal-dashboard .portal-table-panel, .portal-dashboard .portal-side-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.portal-dashboard .portal-module-panel {
  overflow: hidden;
  padding: 20px 20px 16px;
  background: radial-gradient(circle at top right, rgba(255, 206, 116, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84));
}

.portal-dashboard .portal-panel-title {
  min-height: 62px;
}

.portal-dashboard .portal-title-kicker {
  color: var(--accent);
  letter-spacing: 0.12em;
}

.portal-dashboard .portal-panel-title h1 {
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
}

.portal-dashboard .portal-help, .portal-dashboard .portal-collapse-mark {
  border-radius: 9px;
  background: var(--accent);
  box-shadow: 0 8px 16px rgba(46, 106, 67, 0.16);
}

.portal-dashboard .portal-module-tabs {
  gap: 8px;
  padding: 8px 0 2px;
  border-bottom: 0;
}

.portal-dashboard .portal-module-tabs a {
  padding: 10px 13px 10px 25px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.portal-dashboard .portal-module-tabs a::before {
  left: 13px;
  width: 7px;
  height: 7px;
  border: 0;
  background: #d8b463;
  transform: translate(-50%, -50%);
}

.portal-dashboard .portal-module-tabs a:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 106, 67, 0.2);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-dashboard .portal-module-tabs a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(46, 106, 67, 0.18);
}

.portal-dashboard .portal-module-tabs a.active::before {
  left: 13px;
  color: #ffe0a3;
}

.portal-dashboard .portal-summary-grid {
  gap: 14px;
  padding: 0;
}

.portal-dashboard .portal-summary-grid article {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top right, rgba(255, 205, 116, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
  box-shadow: 0 14px 28px rgba(31, 53, 41, 0.08);
}

.portal-dashboard .portal-summary-grid article::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(46, 106, 67, 0.08), rgba(255, 206, 116, 0.2));
  transform: rotate(18deg);
}

.portal-dashboard .portal-summary-grid span {
  position: relative;
  z-index: 1;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.portal-dashboard .portal-summary-grid strong {
  position: relative;
  z-index: 1;
  color: var(--accent-strong);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.portal-dashboard .portal-work-grid {
  gap: 18px;
  padding: 0;
}

.portal-dashboard .portal-table-panel, .portal-dashboard .portal-side-card {
  overflow: hidden;
}

.portal-dashboard .portal-section-heading, .portal-dashboard .portal-side-title {
  min-height: 62px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(247, 243, 236, 0.92), rgba(242, 237, 228, 0.76));
  border-bottom: 1px solid var(--border);
}

.portal-dashboard .portal-section-heading h2, .portal-dashboard .portal-side-title h2 {
  color: var(--ink);
  font-size: 1.05rem;
}

.portal-dashboard .portal-section-heading p {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.portal-dashboard .portal-primary-action {
  padding: 9px 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 18px rgba(46, 106, 67, 0.15);
}

.portal-dashboard .portal-report-tabs {
  gap: 8px;
  padding: 14px 16px 9px;
}

.portal-dashboard .portal-report-tabs a {
  padding: 9px 13px;
  border: 1px solid rgba(197, 106, 30, 0.14);
  border-top: 1px solid rgba(197, 106, 30, 0.14);
  border-radius: 10px;
  background: rgba(255, 227, 169, 0.76);
  color: #795119;
  font-weight: 800;
}

.portal-dashboard .portal-report-tabs a.completed {
  border-color: rgba(46, 106, 67, 0.14);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-dashboard .dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.portal-dashboard .dashboard-overview-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: rgba(46, 106, 67, 0.08);
  transform: rotate(18deg);
}

.portal-dashboard .dashboard-overview-card > * {
  position: relative;
  z-index: 1;
}

.portal-dashboard .dashboard-overview-card .dashboard-overview-label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-dashboard .dashboard-overview-card strong {
  color: var(--accent-strong);
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.05;
}

.portal-dashboard .dashboard-overview-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.portal-dashboard .dashboard-overview-card-strong span, .portal-dashboard .dashboard-overview-card-strong p {
  color: rgba(255, 255, 255, 0.78);
}

.portal-dashboard .dashboard-overview-card-strong strong {
  color: #ffffff;
}

.dashboard-clock-face {
  position: relative;
  width: 58px;
  height: 58px;
  border: 5px solid rgba(46, 106, 67, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 48%, rgba(224, 240, 229, 0.9) 49% 100%);
  box-shadow: inset 0 0 0 1px rgba(46, 106, 67, 0.14), 0 12px 22px rgba(31, 53, 41, 0.1);
}

.dashboard-clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 3px;
  border-radius: 999px;
  background: var(--accent-strong);
  transform-origin: bottom center;
}

.dashboard-clock-hour {
  height: 16px;
  transform: translateX(-50%) rotate(310deg);
}

.dashboard-clock-minute {
  height: 22px;
  background: #d08a2d;
  transform: translateX(-50%) rotate(42deg);
}

.dashboard-clock-dot {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d08a2d;
  transform: translate(-50%, -50%);
}

.portal-dashboard .dashboard-latest-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 244, 0.88));
  box-shadow: 0 20px 42px rgba(31, 53, 41, 0.13);
  margin-top: 4px;
}

.portal-dashboard .dashboard-latest-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
}

.portal-dashboard .dashboard-latest-header p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.portal-dashboard .dashboard-latest-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.portal-dashboard .dashboard-latest-meta span, .portal-dashboard .dashboard-latest-meta strong {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(224, 240, 229, 0.88);
  color: var(--accent-strong);
  font-size: 0.78rem;
}

.portal-dashboard .dashboard-latest-meta strong {
  background: rgba(255, 237, 195, 0.9);
  color: #795119;
}

.portal-dashboard .dashboard-report-table td:nth-child(2) {
  min-width: 190px;
}

.portal-dashboard .portal-table-scroll {
  padding: 0;
}

.portal-dashboard .portal-report-table {
  font-size: 0.78rem;
}

.portal-dashboard .portal-report-table th, .portal-dashboard .portal-report-table td {
  padding: 10px;
  border-color: var(--portal-border);
}

.portal-dashboard .portal-report-table th {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-dashboard .portal-report-table tbody tr:nth-child(odd) {
  background: rgba(249, 246, 240, 0.72);
}

.portal-dashboard .portal-report-table tbody tr:hover {
  background: rgba(224, 240, 229, 0.72);
}

.portal-dashboard .portal-status {
  border-color: rgba(46, 106, 67, 0.24);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-dashboard .portal-row-action {
  border-radius: 8px;
  background: var(--accent);
}

.portal-dashboard .portal-row-action:hover {
  background: var(--accent-strong);
}

.portal-dashboard .portal-state-list {
  padding: 16px;
}

.portal-dashboard .portal-progress {
  height: 9px;
  border-radius: 999px;
  background: rgba(46, 106, 67, 0.1);
}

.portal-dashboard .portal-progress span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d8b463);
}

.portal-dashboard .portal-task-list a {
  min-height: 46px;
  padding: 10px 14px;
  border-color: var(--border);
  color: var(--ink);
}

.portal-dashboard .portal-task-list a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.portal-dashboard .portal-task-list a span {
  border-radius: 8px;
  background: var(--accent);
}

.portal-dashboard .portal-table-footer {
  padding: 14px 16px 18px;
  color: var(--ink-soft);
}

.portal-dashboard .dashboard-card {
  overflow: hidden;
}

.portal-dashboard .dashboard-card-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-dashboard .dashboard-card-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.1vw, 2rem);
  line-height: 1.1;
}

.portal-dashboard .dashboard-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.portal-dashboard .portal-secondary-action {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-dashboard .portal-secondary-action:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

.portal-dashboard .portal-report-table td strong {
  color: var(--accent-strong);
}

.portal-dashboard .portal-empty-state {
  margin: 16px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.portal-dashboard .dashboard-card-actions .portal-primary-action, .portal-dashboard .dashboard-card-actions .portal-secondary-action {
  margin-left: 0;
}

.portal-dashboard .portal-footer {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
}

.portal-dashboard .dashboard-overview-card, .portal-dashboard .portal-summary-grid article, .dashboard-stat-card, .coverage-row, .dashboard-shortcut {
  border-radius: 14px;
}

.portal-dashboard .dashboard-overview-card-strong {
  background: linear-gradient(135deg, #135736, #21734a 58%, #2b6f8e);
}

.page-actions .import-inline-form, .inline-actions .import-inline-form {
  padding: 4px;
  border: 1px solid rgba(24, 35, 29, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

input[type="submit"] {
  width: auto;
}

.topbar-integrated .topbar-leading {
  justify-content: flex-start;
}

.topbar-integrated .dashboard-card-actions {
  display: none;
}

.report-filter-card .table-title {
  margin: 0;
  font-size: 1.05rem;
}

.filters-form-compact {
  gap: 12px;
}

.filters-form-compact .field-group {
  gap: 5px;
}

.filters-form-compact .inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.filters-form-compact .inline-actions .button, .filters-form-compact .inline-actions input[type="submit"] {
  min-height: 38px;
  padding: 8px 14px;
}

.page-actions .button, .page-actions input[type="submit"] {
  min-height: 40px;
  padding: 9px 14px;
}

.page-actions .import-inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 190px) auto;
  gap: 6px;
  align-items: center;
  max-width: 360px;
}

.page-actions .import-inline-form input[type="file"] {
  width: 100%;
  max-width: none;
  min-height: 36px;
}

.page-actions .import-inline-form input[type="submit"] {
  white-space: nowrap;
}

.daily-entry-toolbar {
  margin-bottom: 10px;
}

.daily-entry-defaults .form-grid-six {
  gap: 10px;
}

.sheet-entry-table th, .sheet-entry-table td {
  padding: 10px 12px;
}

.table-card.report-sheet-card {
  padding: 18px;
}

.table-card-header, .card-header, .sheet-header {
  margin-bottom: 12px;
}

/* A report title is one phrase; give the table room to show it on one line and
   let the wrapper scroll on narrow screens instead of stacking it letter-tall. */
.cotton-index-table {
  width: 100%;
  min-width: 760px;
}

.cotton-index-table th, .cotton-index-table td {
  white-space: nowrap;
}

.cotton-index-table th:nth-child(2), .cotton-index-table td:nth-child(2) {
  width: 120px;
}

.cotton-index-table th:nth-child(5), .cotton-index-table td:nth-child(5) {
  width: 560px;
}

.cotton-index-table .inline-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.cotton-index-table .inline-actions .button {
  min-width: 0;
}

.cotton-index-table .button, .cotton-index-table input[type="submit"] {
  min-height: 40px;
  padding: 8px 13px;
}

.cotton-rate-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.cotton-rate-table th, .cotton-rate-table td {
  padding: 9px 11px;
  white-space: normal;
  overflow-wrap: normal;
}

.cotton-rate-table th {
  font-size: 0.78rem;
}

.cotton-rate-table td {
  font-size: 0.9rem;
}

.cotton-rate-table th:first-child, .cotton-rate-table td:first-child {
  width: 62px;
}

.cotton-rate-table th:nth-child(2), .cotton-rate-table td:nth-child(2) {
  width: 112px;
}

.cotton-rate-table .inline-actions {
  gap: 7px;
}

.cotton-rate-table .button, .cotton-rate-table input[type="submit"] {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.84rem;
}

.seed-rate-table {
  min-width: 700px;
}

.portal-dashboard .dashboard-clean-overview {
  grid-template-columns: 1.15fr repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card {
  padding: 14px 18px;
  border-color: rgba(24, 35, 29, 0.09);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f5faf7 100%);
  box-shadow: 0 16px 32px rgba(31, 53, 41, 0.08);
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card::after {
  display: none;
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card-strong {
  background: linear-gradient(135deg, #135736 0%, #1f7550 62%, #2b6f8e 100%);
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card strong {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  word-break: keep-all;
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card p {
  font-size: 0.82rem;
}

.daily-reports-page {
  gap: 16px;
}

.daily-report-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(33, 47, 61, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 22px rgba(18, 31, 43, 0.05);
}

.daily-upload-bar, .daily-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-upload-bar {
  min-width: 0;
}

.daily-upload-bar input[type="file"] {
  width: min(290px, 40vw);
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(33, 47, 61, 0.18);
  border-radius: 9px;
  background: #ffffff;
  color: #5d6874;
  font-size: 0.8rem;
}

.daily-upload-bar .button-primary {
  border-color: #1d5fbd;
  background: #1d5fbd;
}

.daily-upload-bar .button-primary:hover {
  border-color: #174f9d;
  background: #174f9d;
}

.daily-report-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.daily-report-actions .button, .daily-upload-bar .button {
  min-height: 37px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.daily-report-actions .button-ghost {
  border-color: rgba(33, 47, 61, 0.12);
  background: #ffffff;
  color: #35404b;
}

.daily-report-actions .button-ghost:hover {
  border-color: rgba(29, 95, 189, 0.3);
  color: #1d5fbd;
  text-decoration: none;
}

.daily-report-filter {
  overflow: hidden;
  border: 1px solid rgba(33, 47, 61, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.76);
}

.daily-report-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  cursor: pointer;
  color: #3a4651;
  list-style: none;
}

.daily-report-filter summary::-webkit-details-marker {
  display: none;
}

.daily-report-filter summary::after {
  content: "+";
  order: 3;
  color: #71808d;
  font-size: 1.1rem;
  font-weight: 500;
}

.daily-report-filter[open] summary::after {
  content: "−";
}

.daily-filter-summary {
  margin-left: auto;
  color: #697783;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.daily-report-filter .filters-form-compact .form-grid-three {
  padding-top: 14px;
}

.daily-report-sheet-list {
  display: grid;
  gap: 14px;
}

.daily-mandi-sheet-card {
  overflow: hidden;
  border: 1px solid rgba(33, 47, 61, 0.11);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(18, 31, 43, 0.06);
}

.daily-mandi-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(33, 47, 61, 0.09);
  background: #fbfcfd;
}

.daily-mandi-sheet-header h2 {
  margin: 0 0 3px;
  color: #26323c;
  font-size: 1rem;
}

.daily-mandi-sheet-header p {
  margin: 0;
  color: #7a8792;
  font-size: 0.8rem;
}

.daily-mandi-sheet-count {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf4ff;
  color: #1d5fbd;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.daily-mandi-table-wrapper {
  border: 0;
  border-radius: 0;
}

.daily-mandi-table {
  min-width: 720px;
  table-layout: fixed;
  width: 100%;
}

.daily-mandi-table th {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(33, 47, 61, 0.09);
  background: #f8fafc;
  color: #697783;
  font-size: 0.69rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.daily-mandi-table th:first-child, .daily-mandi-table th:last-child {
  text-align: left;
}

.daily-mandi-table th small {
  color: #98a2ab;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.daily-mandi-table td {
  padding: 12px 13px;
  border-bottom-color: rgba(33, 47, 61, 0.07);
  vertical-align: middle;
}

.daily-mandi-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.daily-mandi-table tbody tr:hover {
  background: #f4f8ff;
}

.daily-mandi-market-cell {
  min-width: 160px;
}

.daily-mandi-market-cell strong {
  display: block;
  color: #303b44;
}

.daily-mandi-market-cell span {
  display: block;
  margin-top: 3px;
  color: #84919b;
  font-size: 0.75rem;
}

.daily-mandi-table .numeric-cell {
  color: #3a4650;
  font-weight: 700;
  text-align: right;
}

.daily-mandi-table .daily-mandi-modal-price {
  color: #1d5fbd;
}

.daily-mandi-reference-cell {
  min-width: 170px;
  color: #707d87;
  font-size: 0.84rem;
}

.daily-mandi-reference-cell > span:first-child {
  display: block;
}

.daily-mandi-row-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.daily-mandi-row-actions .button, .daily-mandi-row-actions input[type="submit"] {
  min-height: 29px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.daily-report-empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border-style: solid;
  border-color: rgba(33, 47, 61, 0.1);
  background: #ffffff;
  color: #83909a;
}

.daily-report-empty-state p {
  margin: 0;
}

.topbar, .page-header, .card, .table-card, .stat-card, .summary-report-card, .overview-group-card, .report-sheet-card {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.button-primary:hover, input[type="submit"]:hover {
  border-color: #174f9d;
  background: #174f9d;
}

.mandi-showcase, .portal-dashboard .dashboard-overview-card-strong {
  background: linear-gradient(135deg, #1a3d68, #1d5fbd);
}

.portal-dashboard .dashboard-overview-card, .portal-dashboard .dashboard-clock-card {
  background: #ffffff;
}

.import-location-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(29, 95, 189, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, #edf4ff, #ffffff);
  box-shadow: 0 8px 22px rgba(18, 31, 43, 0.05);
}

.import-location-notice .eyebrow {
  margin-bottom: 4px;
}

.import-location-notice strong {
  display: block;
  color: #26323c;
}

.import-location-notice p:not(.eyebrow) {
  max-width: 760px;
  margin: 4px 0 0;
  color: #6c7a85;
  font-size: 0.86rem;
}

.import-location-notice form {
  flex: 0 0 auto;
}

.arrival-summary-page {
  gap: 18px;
}

.arrival-summary-filter-card {
  padding: 18px;
}

.arrival-summary-title-card {
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff, #f3f8ff);
}

.arrival-summary-title-card .summary-report-title {
  margin-bottom: 0;
  color: #2f3b45;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
}

.arrival-summary-district-list {
  display: grid;
  gap: 16px;
}

.arrival-summary-district-card {
  overflow: hidden;
  padding: 0;
}

.arrival-summary-district-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(33, 47, 61, 0.09);
  background: linear-gradient(135deg, #fbfcfd, #f3f8ff);
}

.arrival-summary-district-header .eyebrow, .arrival-summary-district-header .table-subtitle {
  margin: 0;
}

.arrival-summary-district-header .table-title {
  margin: 3px 0;
}

.arrival-summary-total {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(18, 31, 43, 0.05);
  text-align: right;
}

.arrival-summary-total span, .arrival-summary-cell-detail, .arrival-summary-table .numeric-cell small {
  color: #84919b;
  font-size: 0.73rem;
}

.arrival-summary-total strong {
  color: #1d5fbd;
  font-variant-numeric: tabular-nums;
}

.arrival-summary-table {
  min-width: 1060px;
}

.arrival-summary-table th, .arrival-summary-table td {
  padding: 11px 12px;
}

.arrival-summary-table th {
  font-size: 0.7rem;
  text-align: left;
}

.arrival-summary-table .numeric-cell {
  font-variant-numeric: tabular-nums;
}

.arrival-summary-table .numeric-cell small, .arrival-summary-cell-detail {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

.arrival-summary-table .arrival-summary-modal {
  color: #1d5fbd;
}

.arrival-summary-reference {
  max-width: 220px;
  color: #6f7b86;
  font-size: 0.84rem;
}

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

.direct-entry-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.direct-entry-card.tone-blue {
  border-color: rgba(29, 95, 189, 0.18);
  background: linear-gradient(135deg, #eef4ff, #ffffff 60%);
}

.direct-entry-card.tone-green {
  border-color: rgba(31, 157, 85, 0.18);
  background: linear-gradient(135deg, #eafbf1, #ffffff 60%);
}

.direct-entry-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.direct-entry-card-head h2 {
  margin: 0;
  color: #26323c;
  font-size: 1.05rem;
}

.direct-entry-card-head .muted-text {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.direct-entry-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.direct-entry-card-icon.tone-blue {
  background: #1d5fbd;
  color: #ffffff;
}

.direct-entry-card-icon.tone-green {
  background: #1f9d55;
  color: #ffffff;
}

.direct-cotton-date-form, .direct-cotton-import-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.direct-cotton-date-form .field-group, .direct-cotton-import-form .field-group {
  flex: 1 1 150px;
  gap: 5px;
  margin: 0;
}

/* The file picker shows the chosen file name, so it gets its own full row
   rather than sharing one with the fallback date. */
.direct-cotton-import-form .direct-cotton-file-field,
.direct-cotton-date-form .direct-cotton-file-field {
  flex: 1 1 100%;
}

.direct-cotton-import-form .field-hint,
.direct-cotton-date-form .field-hint {
  display: block;
  margin-top: 4px;
  color: #8291a8;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
}

.direct-entry-card label {
  color: #52606d;
  font-size: 0.75rem;
}

.direct-entry-card input[type="date"], .direct-entry-card input[type="file"] {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.84rem;
}

.direct-entry-card .button {
  min-height: 38px;
  padding: 8px 13px;
  white-space: nowrap;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes signalWave {
  0%,
  100% {
    transform: scaleX(0.76);
    opacity: 0.46;
  }

  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes hoverSweep {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes galleryUp {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(calc(-50% - 6px));
  }
}

@keyframes galleryDown {
  from {
    transform: translateY(calc(-50% - 6px));
  }

  to {
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .portal-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-work-grid {
    grid-template-columns: 1fr;
  }

  .portal-side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-dashboard .dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-dashboard .portal-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-dashboard .portal-summary-grid article:last-child {
    grid-column: 1 / -1;
  }

  .filters-form-compact .form-grid-three {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .portal-dashboard .dashboard-clean-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hero, .dashboard-content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-clock-card {
    justify-self: center;
  }

  .metrics-grid, .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-pill {
    min-width: 150px;
  }

  .dashboard-overview-grid, .portal-dashboard .dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 980px) {
  .portal-dashboard-page .app-shell {
    display: block;
  }

  .portal-dashboard-page .app-main {
    display: block;
  }

  .portal-dashboard-page .topbar {
    padding: 12px 16px;
  }

  .portal-dashboard-page .sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 50;
  }

  .portal-dashboard-page .sidebar-mobile-header, .portal-dashboard-page .mobile-nav-button {
    display: flex;
  }

  .app-shell-body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell-body.sidebar-collapsed .sidebar {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell, .auth-grid, .auth-grid-compact {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    height: 100vh;
    overflow-y: auto;
    padding: 20px 18px 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    z-index: 40;
    box-shadow: 0 26px 48px rgba(9, 16, 12, 0.34);
  }

  .app-shell-body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-mobile-header, .mobile-nav-button, .sidebar-overlay {
    display: flex;
  }

  .desktop-sidebar-toggle {
    display: none;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    padding: 0;
    background: rgba(14, 22, 17, 0.42);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  .app-shell-body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .auth-card {
    order: 1;
  }

  .auth-hero {
    order: 2;
  }

  .hero-metrics, .form-grid, .form-grid-two, .form-grid-three, .form-grid-four, .daily-entry-master-actions, .metrics-grid, .card-grid, .dashboard-summary-grid, .report-sheet-grid-two, .report-sheet-grid-three, .overview-summary-band {
    grid-template-columns: 1fr;
  }

  .page-header, .table-card-header, .card-header, .sheet-header {
    flex-direction: column;
    align-items: stretch;
  }

  /* The topbar only carries the menu button and account actions, so it stays
     a single row on phones instead of stacking into a tall empty band. */
  .topbar {
    align-items: center;
  }

  .page-actions, .inline-actions {
    width: 100%;
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
  }

  .topbar-copy {
    max-width: none;
  }

  .sheet-toolbar {
    align-items: stretch;
  }

  .sheet-master-panel {
    grid-template-columns: 1fr;
  }

  .sheet-master-group {
    padding-left: 0;
    padding-top: 14px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .sheet-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-mandi-tabs {
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 8px;
  }

  .sheet-toolbar .inline-actions, .sheet-toolbar .inline-actions .button, .sheet-toolbar .inline-actions input[type="submit"] {
    width: auto;
  }

  .data-table-wrapper {
    margin-inline: -6px;
    padding-inline: 6px;
  }

  .report-grid-table {
    min-width: 880px;
  }

  .sheet-entry-table.report-grid-table {
    min-width: 1120px;
  }

  .compact-table.report-grid-table {
    min-width: 640px;
  }

  .form-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-entry-master-form, .daily-entry-master-card:first-child .daily-entry-master-form {
    grid-template-columns: 1fr;
  }

  .overview-lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-clock-card {
    width: min(100%, 300px);
    grid-template-columns: 1fr;
    aspect-ratio: 1;
    justify-self: center;
    border-radius: 50%;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-clock-meta {
    justify-items: center;
    text-align: center;
  }

  .brand-copy-text {
    max-width: none;
  }

  .mandi-showcase {
    grid-template-columns: 1fr;
  }

  .direct-entry-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .portal-summary-grid, .portal-side-column {
    grid-template-columns: 1fr;
  }

  .portal-required-note, .portal-dashboard-page .topbar-subtitle {
    display: none;
  }

  .portal-section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .portal-primary-action {
    width: 100%;
    margin-left: 33px;
    text-align: center;
  }

  .portal-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-shell, .app-main, .sidebar {
    padding: 18px;
  }

  .auth-card, .auth-hero, .card, .table-card, .stat-card, .topbar, .page-header {
    padding: 20px;
    border-radius: 22px;
  }

  .brand-card {
    padding: 18px;
    border-radius: 24px;
  }

  .brand-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-leading {
    gap: 14px;
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 1.25rem;
  }

  .topbar-subtitle {
    display: none;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .user-pill {
    padding: 8px 12px;
    border-radius: 12px;
  }

  .user-pill-meta {
    display: none;
  }

  .page-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-inline: -2px;
    padding-inline: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .page-actions .button, .page-actions input[type="submit"], .page-actions form, .page-actions .import-inline-form {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .page-actions::-webkit-scrollbar {
    height: 6px;
  }

  .inline-actions .button, .inline-actions form {
    width: 100%;
  }

  .inline-actions .button, .inline-actions input[type="submit"] {
    justify-content: center;
    text-align: center;
  }

  td .inline-actions, th .inline-actions {
    flex-wrap: nowrap;
  }

  td .inline-actions .button, th .inline-actions .button, td .inline-actions form, th .inline-actions form {
    width: auto;
    white-space: nowrap;
  }

  .cotton-index-table th:nth-child(5), .cotton-index-table td:nth-child(5) {
    width: 150px;
  }

  .cotton-index-table .inline-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
  }

  .cotton-index-table .inline-actions .button, .cotton-index-table .inline-actions form {
    flex: 0 0 auto;
  }

  .table-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination-controls {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .dashboard-date-form {
    width: 100%;
  }

  .dashboard-date-input {
    flex: 1 1 auto;
    min-width: 0;
  }

  .dashboard-latest-tools {
    width: 100%;
  }

  .table-search-form {
    flex: 1 1 200px;
  }

  .sheet-inline-actions .button, .sheet-inline-actions input[type="submit"], .sheet-inline-actions form, .sheet-entry-action-cell .button-to-inline, .sheet-toolbar .inline-actions .button, .sheet-toolbar .inline-actions input[type="submit"] {
    width: auto;
  }

  .button-to-inline {
    display: block;
  }

  .dashboard-hero {
    padding: 22px;
    border-radius: 24px;
  }

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

  .overview-lane-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-pill {
    min-width: 0;
  }

  .dashboard-pill-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .live-clock-card {
    grid-template-columns: 1fr;
    width: min(100%, 280px);
    aspect-ratio: 1;
    justify-self: center;
    border-radius: 50%;
  }

  .live-clock-face {
    width: 156px;
  }

  .live-clock-meta {
    justify-items: center;
    text-align: center;
  }

  .sheet-toolbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .sheet-filter-form {
    grid-template-columns: 1fr;
  }

  .sheet-mandi-tabs {
    margin-inline: -2px;
    padding-inline: 2px 0;
  }

  .sheet-tab-link {
    padding: 9px 12px;
    font-size: 0.9rem;
  }

  .sheet-entry-action-cell {
    width: 84px;
  }

  .button-compact {
    min-width: 84px;
    padding: 9px 13px;
  }

  .button-icon {
    min-width: 38px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .sheet-inline-actions {
    gap: 6px;
  }

  .sheet-inline-flag {
    min-width: 40px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .sheet-entry-launch-copy {
    font-size: 0.84rem;
  }

  .table-card, .summary-report-card, .overview-group-card, .report-sheet-card {
    padding: 18px;
  }

  .report-grid-table {
    min-width: 760px;
  }

  .sheet-entry-table.report-grid-table {
    min-width: 1060px;
  }

  .compact-table.report-grid-table {
    min-width: 560px;
  }

  th, td {
    padding: 12px 10px;
  }

  .attachment-chip {
    width: min(100%, 190px);
  }

  .sheet-inline-attachment-chip {
    width: 112px;
  }

  .attachment-thumb {
    width: 36px;
    height: 36px;
  }

  .gallery-columns {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    gap: 10px;
  }

  .gallery-column {
    height: 160px;
  }

  .gallery-card {
    height: 150px;
  }

  .mandi-showcase, .mandi-chip-cloud-panel {
    padding: 16px;
  }

  .mandi-chip-cloud {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .mandi-chip-cloud span {
    flex: 0 0 auto;
  }

  .dashboard-overview-grid, .portal-dashboard .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 12px;
  }

  .button, button, input[type="submit"] {
    min-height: 42px;
  }

  .portal-dashboard {
    gap: 14px;
  }

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

  .portal-dashboard .dashboard-latest-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-dashboard .dashboard-latest-meta {
    justify-content: flex-start;
  }

  .portal-dashboard .portal-module-panel {
    padding: 16px;
  }

  .portal-dashboard .portal-module-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-dashboard .portal-summary-grid, .portal-dashboard .portal-side-column {
    grid-template-columns: 1fr;
  }

  .portal-dashboard .portal-summary-grid article:last-child {
    grid-column: auto;
  }

  .portal-dashboard .portal-footer span, .portal-dashboard .portal-footer strong {
    padding: 5px 10px;
    border: 0;
  }

  .portal-dashboard .dashboard-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-dashboard .dashboard-card-actions {
    width: 100%;
    margin-left: 0;
  }

  .portal-dashboard .dashboard-card-actions .portal-primary-action, .portal-dashboard .dashboard-card-actions .portal-secondary-action {
    flex: 1 1 auto;
    text-align: center;
  }

  .daily-master-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-master-notice-actions, .daily-master-notice-actions .button {
    width: 100%;
  }

  .page-header {
    min-height: 0;
    align-items: stretch;
  }

  .portal-dashboard .dashboard-clean-overview {
    grid-template-columns: 1fr;
  }

  .filters-form-compact .form-grid-three {
    grid-template-columns: 1fr;
  }

  .filters-form-compact .inline-actions {
    justify-content: stretch;
  }

  .filters-form-compact .inline-actions .button, .filters-form-compact .inline-actions input[type="submit"], .filters-form-compact .inline-actions form {
    width: 100%;
  }

  .table-card.report-sheet-card {
    padding: 14px;
  }

  .daily-report-commandbar {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-upload-bar, .daily-report-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .daily-upload-bar input[type="file"] {
    width: min(220px, 60vw);
    flex: 0 0 auto;
  }

  .daily-upload-bar .button, .daily-report-actions .button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .daily-upload-bar::-webkit-scrollbar, .daily-report-actions::-webkit-scrollbar {
    height: 6px;
  }

  .daily-report-actions {
    justify-content: flex-start;
  }

  .topbar, .page-header, .card, .table-card, .stat-card {
    border-radius: 12px;
  }

  .import-location-notice, .arrival-summary-district-header {
    align-items: stretch;
    flex-direction: column;
  }

  .import-location-notice .button, .import-location-notice form {
    width: 100%;
  }

  .arrival-summary-total {
    text-align: left;
  }

  .direct-cotton-date-form, .direct-cotton-import-form {
    align-items: stretch;
    flex-direction: column;
  }

  .direct-cotton-date-form .field-group, .direct-cotton-import-form .field-group, .direct-cotton-date-form .button, .direct-cotton-import-form .button {
    flex: 0 0 auto;
    width: 100%;
  }

  .direct-cotton-file-field {
    flex-basis: auto !important;
  }

}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .app-main, .auth-shell, .sidebar {
    padding: 14px;
  }

  .topbar, .page-header, .table-card, .card, .stat-card, .summary-report-card, .overview-group-card, .report-sheet-card, .auth-card, .auth-hero {
    padding: 16px;
    border-radius: 20px;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .dashboard-hero h1 {
    font-size: 2rem;
  }

  .dashboard-lead, .muted-text, .table-subtitle, .topbar-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .brand-card {
    padding: 16px;
    gap: 12px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .nav-link {
    min-height: 42px;
    padding: 10px 12px;
  }

  .dashboard-shortcut, .coverage-row, .overview-summary-chip, .dashboard-pill {
    padding: 14px 15px;
  }

  .sheet-entry-action-cell {
    width: 70px;
  }

  .sheet-tab-link {
    padding: 8px 11px;
  }

  .form-grid-six {
    grid-template-columns: 1fr;
  }

  .attachment-chip, .sheet-inline-attachment-chip {
    width: min(100%, 160px);
  }

  .mobile-nav-button {
    min-width: 56px;
    padding: 10px 12px;
  }

  .portal-dashboard .portal-breadcrumb {
    display: none;
  }

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

  .portal-dashboard .portal-module-tabs a {
    width: 100%;
  }

  .portal-dashboard .portal-panel-title h1 {
    font-size: 1.65rem;
  }

}

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

}

/* ============================================================
   Vivid workspace refresh
   Shared styles keep every report, master form and table in the
   same polished blue-first visual language.
   ============================================================ */

:root {
  --background: #f4f7ff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-muted: #f7f9fe;
  --ink: #13213c;
  --ink-soft: #71809a;
  --border: rgba(76, 106, 157, 0.14);
  --border-strong: rgba(64, 95, 148, 0.26);
  --accent: #1769f5;
  --accent-strong: #0d4fc8;
  --accent-soft: #ebf2ff;
  --shadow: 0 18px 42px rgba(31, 73, 143, 0.12);
  --shadow-soft: 0 9px 24px rgba(31, 73, 143, 0.09);
}

body {
  background:
    radial-gradient(circle at 93% -4%, rgba(91, 136, 255, 0.2), transparent 27rem),
    radial-gradient(circle at 45% 108%, rgba(77, 211, 173, 0.14), transparent 27rem),
    var(--background);
}

.sidebar {
  padding: 22px 18px 30px;
  background:
    radial-gradient(circle at 12% 0%, rgba(53, 128, 255, 0.32), transparent 15rem),
    linear-gradient(180deg, #07182f 0%, #0b2343 55%, #102c50 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.06);
}

.brand-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-color: rgba(175, 205, 255, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.brand-top { grid-row: 1; }

.brand-copy { grid-column: 2; }

.brand-card h1 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2b82ff, #1557dc);
  box-shadow: 0 12px 24px rgba(0, 47, 125, 0.45);
}

.nav-stack { gap: 24px; margin-top: 28px; }

.nav-group { gap: 7px; }

.nav-label {
  padding: 0 10px;
  color: rgba(206, 226, 255, 0.58);
  font-size: 0.69rem;
}

.nav-link {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(238, 245, 255, 0.84);
}

.nav-link:hover {
  background: rgba(113, 166, 255, 0.13);
  border-color: rgba(160, 199, 255, 0.12);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(38, 120, 251, 0.46), rgba(79, 148, 255, 0.19));
  border-color: rgba(115, 173, 255, 0.2);
  box-shadow: inset 3px 0 #55a0ff, 0 9px 19px rgba(0, 20, 59, 0.23);
}

.app-main { padding: 18px 22px 30px; }

.topbar {
  min-height: 66px;
  padding: 11px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(35, 72, 137, 0.08);
}

.desktop-sidebar-toggle {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f5f8ff;
  box-shadow: none;
}

.user-pill {
  padding: 8px 13px;
  border-radius: 10px;
  background: #f5f8ff;
}

.button-primary, input[type="submit"] {
  border-color: #1769f5;
  background: linear-gradient(135deg, #2177ff, #1156dc);
  box-shadow: 0 10px 20px rgba(23, 105, 245, 0.22);
}

.button-primary:hover, input[type="submit"]:hover {
  border-color: #0d4fc8;
  background: linear-gradient(135deg, #1769f5, #0d4fc8);
}

.button-ghost {
  border-color: #dce6f6;
  color: #24519a;
  background: #ffffff;
}

.page-header,
.card,
.table-card,
.stat-card,
.daily-report-commandbar,
.daily-report-filter,
.daily-mandi-sheet-card,
.arrival-summary-district-card,
.import-location-notice {
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.page-header {
  padding: 20px 22px;
  background:
    radial-gradient(circle at 88% -65%, rgba(67, 135, 255, 0.2), transparent 15rem),
    rgba(255, 255, 255, 0.88);
}

.page-header h1 { color: #101e3a; letter-spacing: -0.035em; }

.page-header-icon.tone-sun {
  color: #e78a06;
  background: linear-gradient(135deg, #fff4bd, #ffda5a);
  box-shadow: 0 9px 20px rgba(246, 181, 41, 0.25);
}

.page-header-icon.tone-blue {
  background: linear-gradient(135deg, #297bff, #175bdc);
}

.dashboard-date-form {
  border-color: #dbe6f7;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(50, 95, 177, 0.06);
}

input:focus, select:focus, textarea:focus {
  border-color: #6aa3ff;
  box-shadow: 0 0 0 4px rgba(47, 122, 255, 0.13);
}

th {
  color: #48607f;
  background: #f2f6ff;
}

tbody tr:hover { background: #f2f7ff; }

.daily-report-commandbar,
.daily-report-filter {
  background: rgba(255, 255, 255, 0.88);
}

.daily-mandi-sheet-header,
.arrival-summary-district-header {
  background: linear-gradient(135deg, #fbfdff, #edf4ff);
}

.dashboard-vivid-page { display: grid; gap: 18px; }

.portal-dashboard .dashboard-clean-overview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card {
  min-height: 145px;
  padding: 16px;
  border-radius: 16px;
  border-color: rgba(83, 112, 163, 0.11);
  background: linear-gradient(145deg, #ffffff, #f5f8ff);
  box-shadow: 0 12px 28px rgba(39, 80, 153, 0.08);
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card:nth-child(2) { background: linear-gradient(145deg, #ffffff, #effff6); }
.portal-dashboard .dashboard-clean-overview .dashboard-overview-card:nth-child(3) { background: linear-gradient(145deg, #ffffff, #f7efff); }
.portal-dashboard .dashboard-clean-overview .dashboard-overview-card:nth-child(4) { background: linear-gradient(145deg, #ffffff, #fff5e9); }
.portal-dashboard .dashboard-clean-overview .dashboard-overview-card:nth-child(5) { background: linear-gradient(145deg, #ffffff, #fff0f6); }

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card strong {
  margin-top: 3px;
  color: #14244b;
  font-size: clamp(1.5rem, 2.1vw, 2rem);
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: 1.16fr 0.96fr 0.96fr;
  gap: 16px;
}

.dashboard-insight-card {
  min-height: 280px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.dashboard-insight-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-insight-heading > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; }

.dashboard-insight-icon {
  grid-row: span 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
}

.dashboard-insight-icon.tone-blue { background: #e8f0ff; color: #1769f5; }
.dashboard-insight-icon.tone-purple { background: #f0eaff; color: #8155de; }
.dashboard-insight-icon.tone-orange { background: #fff0dc; color: #ea8213; }

.dashboard-insight-heading h2 {
  margin: 1px 0 2px;
  color: #152340;
  font-size: 0.98rem;
}

.dashboard-insight-heading p {
  margin: 0;
  color: #8190a6;
  font-size: 0.75rem;
}

.dashboard-reporting-date {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f4f7fc;
  color: #5a6f90;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.arrival-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 190px;
  margin-top: 15px;
  padding: 6px 4px 0;
  border-bottom: 1px solid #e5edf9;
}

.arrival-chart-column {
  display: flex;
  align-items: center;
  flex: 1;
  align-self: stretch;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.arrival-chart-value {
  color: #7590bc;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.arrival-chart-column:hover .arrival-chart-value { opacity: 1; }

.arrival-chart-bar {
  display: block;
  width: min(30px, 70%);
  min-height: 8px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #9ac4ff, #4b90f8);
  box-shadow: 0 7px 13px rgba(44, 122, 243, 0.16);
}

.arrival-chart-bar.is-current {
  background: linear-gradient(180deg, #2878ff, #1155da);
  box-shadow: 0 9px 17px rgba(23, 105, 245, 0.28);
}

.arrival-chart-column small {
  color: #8190a6;
  font-size: 0.62rem;
  white-space: nowrap;
}

.commodity-share-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 196px;
}

.commodity-donut {
  display: grid;
  width: 135px;
  height: 135px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--donut-gradient));
  box-shadow: 0 10px 24px rgba(47, 92, 167, 0.12);
}

.commodity-donut > div {
  display: grid;
  width: 91px;
  height: 91px;
  place-content: center;
  border-radius: inherit;
  background: #ffffff;
  text-align: center;
}

.commodity-donut strong { color: #18284a; font-size: 1rem; }
.commodity-donut span { color: #8290a7; font-size: 0.68rem; }

.commodity-share-legend { display: grid; gap: 10px; min-width: 0; }

.commodity-share-legend > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #63738e;
  font-size: 0.75rem;
}

.commodity-share-dot { width: 8px; height: 8px; border-radius: 50%; }
.commodity-share-legend strong { color: #20385e; font-size: 0.75rem; }

.dashboard-view-link {
  color: #1769f5;
  font-size: 0.76rem;
  font-weight: 800;
}

.dashboard-view-link:hover { color: #0d4fc8; text-decoration: none; }

.top-mandi-list {
  display: grid;
  gap: 15px;
  margin-top: 25px;
}

.top-mandi-row {
  display: grid;
  grid-template-columns: minmax(55px, 0.85fr) minmax(70px, 1.5fr) auto;
  align-items: center;
  gap: 8px;
  color: #556987;
  font-size: 0.73rem;
}

.top-mandi-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-mandi-row strong { color: #263c61; font-size: 0.72rem; }

.top-mandi-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0fb;
}

.top-mandi-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #87b8ff, #2c78ed);
}

.dashboard-insight-empty {
  display: grid;
  min-height: 177px;
  place-items: center;
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #cfddf3;
  border-radius: 12px;
  color: #7889a3;
  background: #f9fbff;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 1240px) {
  .portal-dashboard .dashboard-clean-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-mandi-card { grid-column: 1 / -1; min-height: 230px; }
}

@media (max-width: 760px) {
  .app-main { padding: 12px; }
  .topbar { border-radius: 13px; }
  .user-pill { display: none; }
  .page-header { padding: 17px; }
  .portal-dashboard .dashboard-clean-overview,
  .dashboard-insights-grid { grid-template-columns: 1fr; }
  .dashboard-mandi-card { grid-column: auto; }
  .dashboard-insight-card { min-height: auto; }
  .commodity-share-content { justify-content: flex-start; }
}

/* Unified app header: one card holding the menu button, the page heading, the
   page's own actions and the account controls. */
.app-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border: 1px solid #dde7f7;
  border-radius: 16px;
  background:
    radial-gradient(circle at 96% -70%, rgba(67, 135, 255, 0.16), transparent 16rem),
    linear-gradient(135deg, #ffffff 60%, #f4f8ff);
  box-shadow: var(--shadow-soft);
}

.app-topbar-heading {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 0;
}

.app-topbar-heading > * { min-width: 0; }

.app-topbar-heading h1 {
  margin: 0;
  color: #15254a;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.app-topbar-heading .eyebrow { margin: 0 0 2px; color: #2870e9; font-size: 0.66rem; }
.app-topbar-heading .muted-text { margin: 3px 0 0; color: #74849d; font-size: 0.8rem; }
.app-topbar-heading .page-header-with-icon { align-items: center; gap: 12px; }

.app-topbar-trail {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.app-topbar-account { order: 10; }

.app-topbar-trail .page-actions {
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* The account block is pinned to the end and separated from the page actions. */
.app-topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-left: 12px;
  border-left: 1px solid #e3ebf8;
}

.app-topbar-account .user-pill { display: grid; gap: 1px; }

.app-topbar-account .button {
  min-height: 38px;
  padding: 8px 15px;
}

/* Narrow screens stack the card: menu and account share the first line, then
   the heading, then the page's own actions. */
@media (max-width: 1100px) {
  .mobile-nav-button, .desktop-sidebar-toggle { order: 0; }
  .app-topbar-account { order: 1; margin-left: auto; }
  .app-topbar-heading { order: 2; flex: 1 1 100%; }
  .app-topbar-trail { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .app-topbar-trail .page-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .app-topbar { gap: 10px; padding: 12px 14px; }
  .app-topbar-account { padding-left: 0; border-left: 0; }
  .app-topbar-trail { gap: 10px; }
}

/* Daily reports: command-center layout */
.daily-reports-page { gap: 16px; }

.daily-report-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  border: 1px solid #dce7f8;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 55%, #eaf2ff);
  box-shadow: var(--shadow-soft);
}

.daily-report-hero-icon {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, #3b86ff, #1558d7);
  box-shadow: 0 12px 23px rgba(35, 104, 233, 0.25);
}

.daily-report-hero-copy { min-width: 0; }
.daily-report-hero h1 { margin: 0; color: #15254a; font-size: clamp(1.45rem, 2.2vw, 1.95rem); letter-spacing: -0.03em; }
.daily-report-hero p { margin: 4px 0 0; color: #74849d; font-size: 0.88rem; }

.daily-report-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border: 1px solid #dfe8f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.daily-upload-bar, .daily-report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-file-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 30vw);
  max-width: 100%;
  min-height: 42px;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  color: #4a72af;
  background: #f9fbff;
}

.daily-file-picker input[type="file"] {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #71809a;
  font-size: 0.76rem;
}

.daily-upload-bar .button, .daily-report-actions .button {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
}

/* Shared filter bar: a search box, the lookups, a date range and the two
   actions, all on one line the way the sheet reads in Excel. */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border: 1px solid #dfe8f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.filter-bar-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding-right: 4px;
  color: #334a6e;
  font-size: 0.86rem;
  font-weight: 800;
}

.filter-bar-tag .icon { color: #1769f5; }

/* The search box leads the bar and keeps more room than the lookups beside it. */
.filter-bar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 210px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  background: #f8fbff;
  color: #8c9ab1;
}

.filter-bar-search:focus-within {
  border-color: #9cc2fb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(23, 105, 245, 0.12);
}

.filter-bar-search .icon { flex: 0 0 auto; color: #7f93b4; }

.filter-bar-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d3f5c;
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-bar-search input:focus { outline: none; box-shadow: none; }

/* In-report search: one wide box above the sections it filters. */
.sheet-search-bar { flex-wrap: nowrap; }
.sheet-search-bar .filter-bar-search { flex: 1 1 auto; }

.sheet-search-status {
  flex: 0 0 auto;
  color: #7a89a2;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Rows and sections the search hides must stay hidden even though table rows
   and cards carry their own display values. */
[data-sheet-section][hidden],
[data-sheet-section] tbody tr[hidden] { display: none !important; }

@media (max-width: 720px) {
  .sheet-search-bar { flex-wrap: wrap; }
}

/* Compact count chips that ride along a header or a filter bar instead of
   taking a card row of their own. */
.header-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid #dde7f7;
  border-radius: 10px;
  background: #f6f9ff;
  white-space: nowrap;
}

.header-stat strong {
  color: #1a4b99;
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.header-stat small {
  color: #7c8aa3;
  font-size: 0.7rem;
  font-weight: 700;
}

.page-header-trail {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.page-header-trail .page-actions { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.page-header-copy { min-width: 0; }

/* A report title carries its date, so it is sized to stay on one line beside
   the actions instead of wrapping the header to two rows. */
.page-header-copy h1 {
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-header-copy .eyebrow { margin-bottom: 2px; }
.page-header-copy .muted-text { margin-top: 2px; font-size: 0.8rem; }

.sheet-count-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

/* The two entry cards size to their own content rather than stretching to the
   taller one, which used to leave a block of empty space under the date form. */
.direct-entry-grid { align-items: start; gap: 14px; }
.direct-entry-card { gap: 13px; padding: 16px 18px; }
.direct-entry-card-head { gap: 12px; }
.direct-entry-card h2 { font-size: 1rem; }
.direct-entry-card .muted-text { font-size: 0.78rem; }

.direct-cotton-date-form, .direct-cotton-import-form { gap: 10px; }

/* File picker, fallback date and the button share one line. */
.direct-cotton-import-form .direct-cotton-file-field { flex: 2 1 240px; }
.direct-cotton-import-form .field-group { flex: 1 1 140px; }
.direct-cotton-import-form .button, .direct-cotton-date-form .button { flex: 0 0 auto; }

/* A bare file input reports a very wide intrinsic size, which pushed the card
   into a horizontal scroll on phones. */
.direct-cotton-import-form input[type="file"],
.direct-cotton-date-form input[type="file"] {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .direct-cotton-import-form .direct-cotton-file-field,
  .direct-cotton-import-form .field-group { flex: 1 1 100%; }
}

/* Below 760px these forms switch to a column. A wrapping column treats a 100%
   basis as 100% of its height and spills items into side-by-side columns, so
   the children stack explicitly instead. */
@media (max-width: 760px) {
  .direct-cotton-date-form, .direct-cotton-import-form { flex-wrap: nowrap; }

  .direct-cotton-date-form > *, .direct-cotton-import-form > * {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
}
.filter-bar-search input::placeholder { color: #93a2b9; font-weight: 600; }

.filter-bar select,
.filter-bar .filter-bar-date {
  flex: 1 1 104px;
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 9px 26px 9px 10px;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  color: #42536f;
  background-color: #ffffff;
  font-size: 0.79rem;
  font-weight: 700;
}

.filter-bar .filter-bar-date {
  flex: 1 1 110px;
  padding-right: 10px;
}

.filter-bar .filter-bar-date::placeholder { color: #8c9ab1; font-weight: 700; }

/* Apply and Clear wrap as a pair so Clear never strands on a line of its own. */
.filter-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.filter-bar .button,
.filter-bar input[type="submit"] {
  flex: 0 0 auto;
  width: auto;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.81rem;
}

.daily-report-sheet-list {
  display: grid;
  gap: 16px;
}

.daily-mandi-sheet-card {
  overflow: hidden;
  border: 1px solid #dde6f4;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(45, 83, 145, 0.08);
}

.daily-mandi-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  background: #ffffff;
}

.daily-mandi-sheet-title { display: flex; align-items: center; gap: 12px; }

.daily-mandi-commodity-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #1f9c47;
  background: #e6f8ec;
}

.daily-mandi-sheet-header h2 { margin: 0; color: #15254a; font-size: 1.12rem; letter-spacing: -0.02em; }
.daily-mandi-sheet-header p { margin: 3px 0 0; color: #7c8aa3; font-size: 0.79rem; font-weight: 600; }
.daily-mandi-dot { margin: 0 3px; color: #b6c2d6; }

.daily-mandi-sheet-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  color: #1964d7;
  background: #e9f1ff;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.daily-mandi-table-wrapper { border-top: 1px solid #e8eefa; }
.daily-mandi-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: auto; }

/* Headers read in sentence case and line up on the same edge as the values
   underneath them, so a column and its data never look offset. */
.daily-mandi-table th {
  position: static;
  padding: 13px 15px;
  border-right: 1px solid #e7edf8;
  border-bottom: 1px solid #e2eaf7;
  background: #f3f7fe;
  color: #48597a;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

.daily-mandi-table td {
  padding: 13px 15px;
  border-right: 1px solid #eef2fa;
  border-bottom: 1px solid #eef2fa;
  color: #4c5e7b;
  font-size: 0.84rem;
  text-align: left;
  vertical-align: middle;
}

.daily-mandi-table th:last-child,
.daily-mandi-table td:last-child { border-right: 0; }

.daily-mandi-table tbody tr:last-child td { border-bottom: 0; }
.daily-mandi-table tbody tr:hover { background: #f7faff; }

.daily-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.daily-sort-link .icon { color: #9aabc4; }
.daily-sort-link:hover { color: #1769f5; }
.daily-sort-link:hover .icon { color: #1769f5; }
.daily-sort-link.is-active { color: #1769f5; }
.daily-sort-link.is-active .icon { color: #1769f5; }

.daily-mandi-number-cell {
  width: 52px;
  color: #8391a7;
  font-weight: 700;
}

.daily-mandi-market-cell strong { display: block; color: #15254a; font-size: 0.86rem; font-weight: 800; }
.daily-mandi-market-cell span { display: block; margin-top: 2px; color: #8b99af; font-size: 0.72rem; }

.daily-mandi-value-cell { font-variant-numeric: tabular-nums; font-weight: 700; }
.daily-mandi-table .daily-mandi-modal-price { color: #1769f5; font-weight: 900; }

.daily-mandi-reference-cell { min-width: 160px; color: #8290a7; font-size: 0.8rem; }
.daily-mandi-actions-cell { width: 104px; }

.daily-mandi-row-actions { display: inline-flex; gap: 7px; margin: 0; }

.daily-mandi-row-actions .button {
  width: 31px;
  min-height: 31px;
  height: 31px;
  padding: 0;
  border-radius: 8px;
}

.button-icon-edit { color: #1769f5; border: 1px solid #c7dcfd; background: #eef5ff; }
.button-icon-edit:hover { background: #e0edff; }
.button-icon-delete { color: #e2435c; border: 1px solid #fbd0d7; background: #fef0f2; }
.button-icon-delete:hover { background: #fde2e6; }

.daily-mandi-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-top: 1px solid #e8eefa;
  background: #ffffff;
}

.daily-mandi-sheet-footer p {
  margin: 0;
  color: #7a89a2;
  font-size: 0.8rem;
  font-weight: 600;
}

.daily-mandi-sheet-footer .pagination-controls { display: flex; align-items: center; gap: 7px; }

.daily-mandi-sheet-footer .pagination-arrow {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #dde6f4;
  border-radius: 8px;
  color: #8f9fb8;
  background: #ffffff;
}

.daily-mandi-sheet-footer .pagination-current {
  display: grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #1769f5;
  font-size: 0.8rem;
  font-weight: 800;
}

.button-outline {
  color: #1769f5;
  border: 1px solid #c7dcfd;
  background: #ffffff;
}

.button-outline:hover { background: #f3f8ff; }

.button-soft {
  color: #1d59b8;
  border: 1px solid #dbe8fb;
  background: #f1f6ff;
}

.button-soft:hover { background: #e6f0ff; }

@media (max-width: 1420px) {
  .filter-bar select,
  .filter-bar .filter-bar-date { flex: 1 1 140px; }
}

@media (max-width: 1100px) {
  .filter-bar select,
  .filter-bar .filter-bar-date { flex: 1 1 150px; }
  .filter-bar-search { flex: 1 1 100%; }
}

@media (max-width: 720px) {
  .daily-report-hero { align-items: flex-start; padding: 18px; }
  .daily-report-commandbar { align-items: stretch; flex-direction: column; }
  .daily-file-picker { width: 100%; }
  .filter-bar select,
  .filter-bar .filter-bar-date { flex: 1 1 100%; }
  .filter-bar-actions { width: 100%; margin-left: 0; }
  .filter-bar .button,
  .filter-bar input[type="submit"] { flex: 1 1 calc(50% - 5px); }
  .daily-mandi-sheet-header { align-items: flex-start; }
  .daily-mandi-sheet-count { font-size: 0.72rem; }
}


.responsive-stack:not(.daily-reports-page) { gap: 20px; }

.responsive-stack > .page-header {
  min-height: 92px;
  border-radius: 17px;
}

.responsive-stack > .page-header .eyebrow { margin-bottom: 5px; color: #2870e9; font-size: 0.68rem; }

.table-card,
.card,
.summary-report-card,
.overview-group-card,
.report-sheet-card {
  border-color: #dbe5f4;
  box-shadow: 0 13px 31px rgba(37, 75, 139, 0.08);
}

.table-card-header, .card-header, .sheet-header {
  padding-bottom: 13px;
  border-bottom: 1px solid #e6edf8;
}

.table-title { color: #1a2c4d; letter-spacing: -0.02em; }
.table-subtitle { color: #74839c; }

.metrics-grid .stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff, #f5f8ff);
}

.metrics-grid .stat-card::after {
  position: absolute;
  right: -20px;
  bottom: -25px;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: rgba(50, 123, 255, 0.08);
  content: "";
  transform: rotate(22deg);
}

.metrics-grid .stat-card strong { position: relative; z-index: 1; color: #164b9f; }

.form-layout, .stacked-form { gap: 18px; }
.field-group label { color: #38506f; font-size: 0.81rem; }

.empty-state {
  border-color: #cadbf3;
  background: linear-gradient(135deg, #f7faff, #eef5ff);
  color: #71839f;
}

@media (max-width: 720px) {
  .daily-mandi-sheet-header { align-items: flex-start; }
  .daily-mandi-sheet-count { font-size: 0.7rem; }
}

/* Compact workspace pass --------------------------------------------------
   Keep report pages information-dense on desktop while preserving generous
   touch targets and a stacked layout on smaller screens. */
@media (min-width: 981px) {
  .app-shell {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 14px 24px;
  }

  .nav-stack {
    gap: 18px;
    margin-top: 20px;
  }

  .nav-group {
    gap: 4px;
  }

  .nav-link {
    min-height: 38px;
    padding: 8px 10px;
  }

  .app-main {
    padding: 14px 18px 24px;
  }
}

.app-topbar {
  gap: 12px;
  min-height: 64px;
  padding: 11px 16px;
}

.page-frame {
  gap: 14px;
  margin-top: 14px;
}

.responsive-stack:not(.daily-reports-page),
.arrival-summary-page {
  gap: 14px;
}

.card,
.table-card,
.stat-card {
  padding: 16px;
}

.card-header,
.table-card-header,
.sheet-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

/* Arrival summary: use the whole row, and keep filters/actions together. */
.arrival-summary-filter-card {
  padding: 15px 16px;
}

.arrival-summary-filter-card .filters-form-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.arrival-summary-filter-card .filters-form-compact .inline-actions {
  width: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.arrival-summary-page .metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.arrival-summary-title-card {
  padding: 12px 16px;
  border-radius: 13px;
}

.arrival-summary-title-card .eyebrow {
  margin-bottom: 4px;
}

.arrival-summary-district-list {
  gap: 14px;
}

.arrival-summary-district-header {
  padding: 14px 16px;
}

.arrival-summary-table th,
.arrival-summary-table td {
  padding: 9px 11px;
}

/* Cotton report index: action controls need room, not a half-page column. */
.cotton-index-table th:nth-child(5),
.cotton-index-table td:nth-child(5) {
  width: 405px;
}

.cotton-index-table .inline-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.cotton-index-table .button,
.cotton-index-table input[type="submit"] {
  min-height: 34px;
  padding: 7px 10px;
}

.cotton-index-table th,
.cotton-index-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.direct-entry-grid {
  gap: 14px;
}

.direct-entry-card {
  gap: 12px;
  padding: 15px 16px;
}

@media (max-width: 980px) {
  .arrival-summary-filter-card .filters-form-compact {
    grid-template-columns: 1fr;
  }

  .arrival-summary-filter-card .filters-form-compact .inline-actions {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-topbar,
  .arrival-summary-filter-card,
  .direct-entry-card {
    padding: 12px;
  }

  .arrival-summary-page .metrics-grid {
    grid-template-columns: 1fr;
  }

  .arrival-summary-filter-card .filters-form-compact .inline-actions {
    flex-wrap: wrap;
  }

  .cotton-index-table .inline-actions {
    flex-wrap: wrap;
  }
}

@media (min-width: 981px) {
  .arrival-summary-filter-card .filters-form-compact .form-grid-three {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

/* Content-first screens: headings, data and actions stay visible; instructional
   copy is deliberately quiet so every page is easier to scan. */
.app-main .eyebrow,
.app-main .muted-text,
.app-main .table-subtitle,
.app-main .field-note,
.app-main .field-hint,
.auth-shell .auth-copy,
.auth-shell .muted-text {
  display: none !important;
}

.filter-bar-tag {
  display: inline-flex;
  width: 24px;
  padding: 0;
  justify-content: center;
  font-size: 0;
}

.filter-bar-tag .icon {
  width: 17px;
  height: 17px;
}

.direct-entry-grid {
  align-items: stretch;
}

.direct-entry-card-head,
.app-topbar-heading .page-header-with-icon {
  align-items: center;
}

.direct-entry-card-head {
  min-height: 42px;
}

.direct-entry-card .field-group {
  gap: 4px;
}

.portal-dashboard .dashboard-overview-card > p,
.dashboard-insight-heading p,
.dashboard-latest-heading p {
  display: none !important;
}

.portal-dashboard .dashboard-clean-overview .dashboard-overview-card {
  min-height: 116px;
}

@media (max-width: 720px) {
  .filter-bar-tag {
    display: none;
  }

  .direct-entry-card {
    padding: 14px;
  }
}

/* ============================================================
   IMAN market workspace
   Final layer for every signed-in screen: a floating glass sidebar that
   collapses to an icon rail, a slim search bar, a photo banner per page and
   compact white cards over a soft mandi photograph.
   ============================================================ */

:root {
  --background: #eef6ef;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-muted: #f4faf5;
  --ink: #12302a;
  --ink-soft: #5f7a72;
  --border: rgba(22, 90, 64, 0.14);
  --border-strong: rgba(22, 101, 52, 0.26);
  --accent: #16833f;
  --accent-strong: #11672f;
  --accent-soft: #e6f6ea;
  --shadow: 0 10px 26px rgba(16, 64, 40, 0.12);
  --shadow-soft: 0 6px 16px rgba(16, 64, 40, 0.09);

  --iman-glass: rgba(255, 255, 255, 0.84);
  --iman-glass-line: rgba(255, 255, 255, 0.85);
  --iman-radius: 14px;
  --iman-gap: 10px;
  --iman-sidebar: 236px;
  --iman-rail: 72px;
}

/* ---------- Tones shared by nav tiles, banner icons and pins ---------- */
.tone-blue    { --tone: #2f6fe4; --tone-2: #5b9bff; --tone-soft: #e7f0ff; }
.tone-green   { --tone: #17924a; --tone-2: #49c06b; --tone-soft: #e3f7e9; }
.tone-indigo  { --tone: #4f55d8; --tone-2: #7f86ff; --tone-soft: #ecedff; }
.tone-pink    { --tone: #d23f86; --tone-2: #f478b2; --tone-soft: #fde8f2; }
.tone-orange  { --tone: #e2701d; --tone-2: #ffa356; --tone-soft: #fff0e3; }
.tone-teal    { --tone: #0d8f8a; --tone-2: #3cc5bd; --tone-soft: #e0f6f4; }
.tone-lime    { --tone: #5f9a12; --tone-2: #94cf35; --tone-soft: #eff8df; }
.tone-amber   { --tone: #c7860a; --tone-2: #f2b737; --tone-soft: #fff5dc; }
.tone-violet  { --tone: #8044d8; --tone-2: #ad7cff; --tone-soft: #f2eaff; }

/* ---------- Page background ---------- */
body.app-shell-body {
  background:
    linear-gradient(115deg, rgba(240, 248, 241, 0.86), rgba(246, 250, 244, 0.70) 55%, rgba(236, 246, 238, 0.80)),
    var(--mandi-market-image) center / cover fixed;
  background-color: #eef6ef;
  color: var(--ink);
}

.app-shell {
  grid-template-columns: var(--iman-sidebar) minmax(0, 1fr);
  min-height: 100dvh;
  transition: grid-template-columns 0.22s ease;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  overflow-x: hidden;
  color: #f2fff5;
  background:
    linear-gradient(180deg, rgba(12, 74, 44, 0.80), rgba(16, 92, 52, 0.74) 50%, rgba(9, 64, 38, 0.86)),
    var(--mandi-market-image) 30% center / cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 34px rgba(8, 48, 28, 0.25);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-top { display: contents; }

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(140deg, #f7b733 0%, #7ccf3a 52%, #129a4e 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  font-size: 0;
}

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

.brand-name {
  display: block;
  color: #ffffff;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
}

.brand-copy-text {
  display: block !important;
  margin: 3px 0 0;
  color: rgba(234, 255, 240, 0.74);
  font-size: 0.6rem;
  line-height: 1.25;
}

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

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

.nav-label {
  display: block !important;
  margin: 2px 0 4px 10px;
  color: rgba(230, 255, 236, 0.58);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: rgba(246, 255, 249, 0.92);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.16s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.10);
  transform: translateX(2px);
}

.nav-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--tone-2), var(--tone));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.nav-icon .nav-link-icon { width: 15px; height: 15px; }
.nav-text { overflow: hidden; text-overflow: ellipsis; }

.nav-link.active {
  color: #0f3a1f;
  font-weight: 800;
  background: linear-gradient(95deg, #d7f25c, #9be15d 55%, #6fcf5a);
  border-color: rgba(240, 255, 190, 0.8);
  box-shadow: 0 6px 16px rgba(8, 40, 20, 0.30);
  transform: none;
}

.nav-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.92);
  color: var(--tone);
  box-shadow: none;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 14px 8px 4px;
  color: rgba(240, 255, 244, 0.85);
}

.sidebar-footer-mark {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #c9f27a;
  background: rgba(201, 242, 122, 0.14);
}

.sidebar-footer strong,
.sidebar-footer small { display: block; white-space: nowrap; }
.sidebar-footer strong { font-family: Georgia, "Times New Roman", serif; font-size: 0.86rem; font-style: italic; font-weight: 600; }
.sidebar-footer small { font-family: Georgia, "Times New Roman", serif; font-size: 0.78rem; font-style: italic; opacity: 0.82; }

/* Desktop: floating glass panel; collapsing leaves an icon rail. */
@media (min-width: 981px) {
  .app-shell { grid-template-columns: var(--iman-sidebar) minmax(0, 1fr); }

  .sidebar {
    position: sticky;
    top: 10px;
    height: calc(100dvh - 20px);
    margin: 10px 0 10px 10px;
    border-radius: 18px;
  }

  .app-shell-body.sidebar-collapsed .app-shell { grid-template-columns: var(--iman-rail) minmax(0, 1fr); }

  .app-shell-body.sidebar-collapsed .sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    padding: 12px 8px;
  }

  .app-shell-body.sidebar-collapsed .brand-card { justify-content: center; padding: 4px 0 12px; }
  .app-shell-body.sidebar-collapsed .brand-copy,
  .app-shell-body.sidebar-collapsed .nav-text,
  .app-shell-body.sidebar-collapsed .sidebar-footer > span:last-child { display: none; }
  .app-shell-body.sidebar-collapsed .nav-label {
    height: 1px;
    margin: 4px 8px 6px;
    overflow: hidden;
    color: transparent;
    background: rgba(255, 255, 255, 0.18);
  }
  .app-shell-body.sidebar-collapsed .nav-link { justify-content: center; padding: 5px; }
  .app-shell-body.sidebar-collapsed .nav-link:hover { transform: none; }
  .app-shell-body.sidebar-collapsed .sidebar-footer { justify-content: center; padding-inline: 0; }
}

/* ---------- Main column + topbar ---------- */
.app-main {
  min-width: 0;
  padding: 10px 12px 14px;
  background: transparent;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--iman-glass-line);
  border-radius: var(--iman-radius);
  background: var(--iman-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.desktop-sidebar-toggle,
.mobile-nav-button {
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  gap: 4px;
  padding: 0;
  border: 1px solid #d5e9da;
  border-radius: 11px;
  background: #f1faf3;
  box-shadow: none;
  cursor: pointer;
}

.desktop-sidebar-toggle { display: flex; }
.desktop-sidebar-toggle:hover,
.mobile-nav-button:hover { background: #e2f4e6; }
.desktop-sidebar-toggle span,
.mobile-nav-button span { display: block; width: 16px; height: 2px; border-radius: 2px; background: #17733a; transition: transform 0.2s ease, width 0.2s ease; }
.desktop-sidebar-toggle span:nth-child(2) { width: 11px; margin-right: 5px; }
.app-shell-body.sidebar-collapsed .desktop-sidebar-toggle span:nth-child(2) { width: 16px; margin-right: 0; }

.app-global-search {
  display: flex;
  flex: 0 1 440px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d9eadc;
  border-radius: 11px;
  color: #5c8b6c;
  background: rgba(250, 255, 251, 0.92);
}

.app-global-search:focus-within { border-color: #6cc283; box-shadow: 0 0 0 3px rgba(22, 131, 63, 0.12); }

.app-global-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #1f4a32;
  font-size: 0.82rem;
}

.app-global-search input:focus { border: 0; box-shadow: none; transform: none; }
.app-global-search input::placeholder { color: #86a593; }

.app-topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0;
  border: 0;
}

.user-pill {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 3px 12px 3px 3px;
  border: 1px solid #dcebdf;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

.user-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(140deg, #3b82f6, #1e3a8a);
  font-size: 0.8rem;
  font-weight: 800;
}

.user-pill-name { display: block; color: #17322a; font-size: 0.78rem; font-weight: 800; line-height: 1.15; }
.user-pill-meta { display: block; margin-top: 1px; color: #6f8a80; font-size: 0.66rem; white-space: nowrap; }

.app-topbar-account form { margin: 0; }
.app-topbar-account .button.app-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #dcebdf;
  border-radius: 11px;
  color: #23443a;
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}
.app-topbar-account .button.app-logout:hover { color: #b42318; border-color: #f3c4bf; background: #fff6f5; }

/* ---------- Page frame + photo banner ---------- */
.page-frame {
  display: flex;
  flex-direction: column;
  gap: var(--iman-gap);
  margin-top: var(--iman-gap);
}

.page-frame > .responsive-stack,
.page-frame > section { gap: var(--iman-gap); }

.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 12px 16px;
  overflow: hidden;
  border: 1px solid var(--iman-glass-line);
  border-radius: 16px;
  /* Full-width grain sacks behind everything, washed white under the title. */
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.90) 26%, rgba(255, 255, 255, 0.45) 52%, rgba(255, 255, 255, 0.12) 78%, rgba(255, 255, 255, 0.30) 100%),
    var(--mandi-market-image) center 86% / cover no-repeat;
  box-shadow: var(--shadow-soft);
}

/* Mandi trader in a Ploughman Agro shirt; the image edges are pre-feathered so
   it melts into the banner instead of sitting in a hard box. */
.page-hero-art {
  flex: 0 4 360px;
  align-self: stretch;
  min-width: 0;
  margin: -12px 0;
  background: var(--mandi-hero-image) 40% center / cover no-repeat;
}

.page-hero-icon {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--tone-2), var(--tone));
  box-shadow: 0 8px 18px rgba(16, 64, 40, 0.22);
}

.page-hero-heading { flex: 1 1 auto; min-width: min(300px, 100%); }
.page-hero-heading > div,
.page-hero-heading .page-header-with-icon { display: block; }
.page-hero-heading .page-header-icon { display: none !important; }

.page-hero-heading h1 {
  margin: 0;
  color: #10302a;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.app-main .page-hero .eyebrow {
  display: block !important;
  margin: 0 0 2px;
  color: #16833f;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-main .page-hero .muted-text {
  display: block !important;
  margin: 4px 0 0;
  color: #48645a;
  font-size: 0.84rem;
}

.page-hero-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.page-hero-side .page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 0; }

.page-hero-date {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 13px;
  color: #16833f;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 6px 16px rgba(16, 64, 40, 0.12);
  backdrop-filter: blur(10px);
}

.page-hero-date strong,
.page-hero-date small { display: block; white-space: nowrap; }
.page-hero-date strong { color: #10302a; font-size: 0.92rem; font-weight: 800; }
.page-hero-date small { color: #6b857b; font-size: 0.7rem; }

/* Legacy in-page headers keep the same compact card look. */
.page-header,
.responsive-stack > .page-header {
  min-height: 0;
  padding: 12px 16px;
  border: 1px solid var(--iman-glass-line);
  border-radius: var(--iman-radius);
  background: var(--iman-glass);
  box-shadow: var(--shadow-soft);
}

/* ---------- Cards, tables, forms ---------- */
.flash { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 0.84rem; }

.card,
.table-card,
.stat-card,
.summary-report-card,
.overview-group-card,
.report-sheet-card,
.daily-mandi-sheet-card,
.dashboard-insight-card,
.dashboard-latest-panel {
  border: 1px solid var(--iman-glass-line);
  border-radius: var(--iman-radius);
  background: var(--iman-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.card,
.table-card,
.stat-card { padding: 12px 14px; }

.table-card-header,
.card-header,
.sheet-header { margin-bottom: 8px; padding-bottom: 8px; border-bottom-color: #e2efe5; }

.table-title,
.card h2,
.table-card h2 { color: #14352b; font-size: 1rem; }

label,
.field-group label { color: #2f5546; font-size: 0.76rem; font-weight: 700; }

input,
select,
textarea {
  padding: 8px 10px;
  border: 1px solid #d3e6d8;
  border-radius: 10px;
  color: #1f4436;
  background-color: #ffffff;
  font-size: 0.84rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #5fbf7a;
  box-shadow: 0 0 0 3px rgba(22, 131, 63, 0.12);
  outline: none;
  transform: none;
}

.form-layout,
.stacked-form,
.form-grid,
.form-grid-two,
.form-grid-three,
.form-grid-four { gap: 12px; }

/* Buttons */
.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

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

.button-primary,
input[type="submit"] {
  color: #ffffff;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #2aa356, #13783a);
  box-shadow: 0 6px 14px rgba(19, 120, 58, 0.24);
}

.button-blue {
  color: #ffffff;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #3b8bff, #1d5fd6);
  box-shadow: 0 6px 14px rgba(29, 95, 214, 0.24);
}

.button-violet {
  color: #ffffff;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #9a5cff, #6a2fd6);
  box-shadow: 0 6px 14px rgba(106, 47, 214, 0.24);
}

.button-primary:hover,
.button-blue:hover,
.button-violet:hover { filter: brightness(1.06); color: #ffffff; }

.button-outline { color: #13783a; border: 1px solid #a9dbb7; background: #f6fff8; }
.button-soft,
.button-secondary { color: #13603a; border: 1px solid #cfe8d6; background: #eef9f1; }
.button-ghost { color: #23443a; border: 1px solid #dcebdf; background: #ffffff; }

/* Tables */
.data-table-wrapper {
  border: 1px solid #e0eee4;
  border-radius: 12px;
  background: #ffffff;
}

th,
td { padding: 9px 12px; border-bottom: 1px solid #edf4ef; }

th {
  background: #f3faf5;
  color: #36594b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

td { color: #2a4a3e; font-size: 0.84rem; }
tbody tr:hover { background: #f4fbf6; }

/* ---------- Daily reports ---------- */
.daily-report-commandbar,
.filter-bar,
.import-location-notice {
  margin: 0;
  border: 1px solid var(--iman-glass-line);
  border-radius: var(--iman-radius);
  background: var(--iman-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.daily-report-commandbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.daily-upload-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }

.daily-file-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 4px 0 10px;
  border: 1px solid #d9eadc;
  border-radius: 11px;
  color: #3d6b4f;
  background: #ffffff;
}

.daily-file-picker input[type="file"] { max-width: 230px; padding: 0; border: 0; background: transparent; font-size: 0.76rem; }
.daily-file-picker input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 5px 10px;
  border: 1px solid #d9eadc;
  border-radius: 8px;
  color: #1f4436;
  background: #f3faf5;
  font-weight: 700;
  cursor: pointer;
}

.daily-report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.daily-report-commandbar .button { min-height: 38px; }
.daily-upload-bar .button-primary {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #1fae7a, #0f7a55);
  box-shadow: 0 6px 14px rgba(15, 122, 85, 0.24);
}

.import-location-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(234, 243, 255, 0.92), rgba(255, 255, 255, 0.86));
}

.import-location-notice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(140deg, #4f95ff, #1d5fd6);
}

.import-location-notice > div { flex: 1; min-width: 0; }
.import-location-notice strong { display: block; color: #17325a; font-size: 0.88rem; }
.import-location-notice p { margin: 2px 0 0; color: #536a85; font-size: 0.76rem; }
.import-location-notice form { margin: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.filter-bar-tag { display: none !important; }

.filter-bar-search {
  display: flex;
  flex: 1.6 1 200px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d9eadc;
  border-radius: 10px;
  color: #5c8b6c;
  background: #ffffff;
}

.filter-bar-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.filter-bar-search input:focus { box-shadow: none; }

.filter-bar select { flex: 1 1 118px; min-width: 0; max-width: 190px; min-height: 38px; padding-block: 0; }
.filter-bar .filter-bar-date { flex: 0 1 128px; min-width: 110px; min-height: 38px; padding-block: 0; }
.filter-bar-actions { display: flex; flex: 0 0 auto; gap: 6px; margin-left: auto; }

/* Wide screens: every filter on one row; selects shrink before anything wraps. */
@media (min-width: 1200px) {
  .filter-bar {
    display: grid;
    grid-template-columns: minmax(150px, 1.5fr) repeat(6, minmax(0, 1fr)) repeat(2, minmax(0, 0.9fr)) auto;
  }

  .filter-bar select,
  .filter-bar .filter-bar-date { max-width: none; min-width: 0; width: 100%; }
  .filter-bar select { padding-right: 24px; text-overflow: ellipsis; }
}
.filter-bar-actions .button,
.filter-bar-actions input[type="submit"] { min-height: 38px; }

.daily-report-sheet-list { display: flex; flex-direction: column; gap: var(--iman-gap); }

.daily-mandi-sheet-card { overflow: hidden; }

.daily-mandi-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e6f0e9;
  background: transparent;
}

.daily-mandi-sheet-title { display: flex; align-items: center; gap: 10px; }
.daily-mandi-sheet-title h2 { margin: 0; color: #10302a; font-size: 1.08rem; font-weight: 800; }
.daily-mandi-sheet-title p { margin: 1px 0 0; color: #5f7a72; font-size: 0.76rem; }

.daily-mandi-commodity-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(140deg, #6fd06b, #179046);
  box-shadow: 0 5px 12px rgba(23, 144, 70, 0.25);
}

.daily-mandi-sheet-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #d6e6fb;
  border-radius: 10px;
  color: #1d5fd6;
  background: #f0f6ff;
  font-size: 0.76rem;
  font-weight: 800;
}

.daily-mandi-table-wrapper { margin: 0; border: 0; border-radius: 0; }
.daily-mandi-table { width: 100%; min-width: 820px; table-layout: auto; }

.daily-mandi-table th {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #e3eee7;
  background: #f5faf6;
  color: #3b5c4e;
  font-size: 0.72rem;
  white-space: nowrap;
}

.daily-mandi-table td {
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #eef4f0;
  color: #2b4a3f;
  font-size: 0.84rem;
  vertical-align: middle;
}

.daily-mandi-table tbody tr:nth-child(even) { background: #fbfdfb; }
.daily-mandi-table tbody tr:hover { background: #f1f9f3; }
.daily-mandi-table .daily-mandi-number-cell { width: 40px; color: #7b948a; text-align: center; }
.daily-mandi-table .daily-mandi-value-cell { font-variant-numeric: tabular-nums; }

.daily-mandi-market-cell strong { display: inline-flex; align-items: center; gap: 6px; color: #10302a; font-weight: 800; }
.daily-mandi-market-cell > span { display: block; margin: 1px 0 0 20px; color: #6f8a80; font-size: 0.72rem; }
.daily-mandi-market-cell .daily-mandi-pin { display: inline-grid; margin: 0; color: var(--pin); font-size: inherit; }
.pin-tone-0 { --pin: #f06d22; }
.pin-tone-1 { --pin: #2f6fe4; }
.pin-tone-2 { --pin: #c7860a; }
.pin-tone-3 { --pin: #8044d8; }
.pin-tone-4 { --pin: #d23f86; }

.daily-mandi-table .daily-mandi-modal-price { color: inherit; }

.price-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  color: #12723a;
  background: #e3f6e8;
  font-weight: 800;
  white-space: nowrap;
}

.daily-mandi-reference-cell { max-width: 220px; color: #47645a; font-size: 0.78rem; }
.daily-mandi-reference-cell > span { display: block; }

.daily-mandi-reference-cell .sheet-inline-attachments { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.daily-mandi-reference-cell .sheet-inline-attachment-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  max-width: 200px;
  padding: 4px 8px 4px 4px;
  border: 1px solid #e0ebf8;
  border-radius: 9px;
  background: #f6faff;
  text-decoration: none;
}

.daily-mandi-reference-cell .sheet-inline-attachment-chip::before {
  content: "";
  grid-row: span 2;
  width: 24px;
  height: 28px;
  border-radius: 5px;
  background:
    linear-gradient(#ffffff, #ffffff) 6px 10px / 12px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 6px 15px / 12px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 6px 20px / 8px 2px no-repeat,
    linear-gradient(140deg, #5b9bff, #2f6fe4);
}

.daily-mandi-reference-cell .sheet-inline-attachment-chip:has(.attachment-thumb)::before { display: none; }
.daily-mandi-reference-cell .attachment-thumb { grid-row: span 2; width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.daily-mandi-reference-cell .sheet-inline-attachment-chip strong { overflow: hidden; color: #1d3f6b; font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
.daily-mandi-reference-cell .sheet-inline-attachment-chip span { color: #6b84a3; font-size: 0.66rem; }
.daily-mandi-reference-cell .sheet-inline-attachment-chip:hover { border-color: #b9d3f5; background: #eaf3ff; }

.daily-mandi-actions-cell { width: 1%; white-space: nowrap; }
.daily-mandi-row-actions { display: inline-flex; gap: 6px; }
.daily-mandi-row-actions form { margin: 0; }

.button.button-icon-edit,
.button.button-icon-delete {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  box-shadow: none;
}

.button.button-icon-edit { color: #1d5fd6; border: 1px solid #d6e6fb; background: #eef5ff; }
.button.button-icon-delete { color: #d92d20; border: 1px solid #fbd5d1; background: #fff1f0; }
.button.button-icon-edit:hover { background: #dfeeff; }
.button.button-icon-delete:hover { background: #ffe4e1; }

.daily-mandi-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid #e6f0e9;
  background: transparent;
}

.daily-mandi-sheet-footer p { margin: 0; color: #5f7a72; font-size: 0.76rem; }
.pagination-current { color: #ffffff; background: #16833f; }

/* ---------- Dashboard ---------- */
.portal-dashboard .dashboard-clean-overview { gap: var(--iman-gap); }
.portal-dashboard .dashboard-clean-overview .dashboard-overview-card {
  border: 1px solid var(--iman-glass-line);
  border-radius: var(--iman-radius);
  background: var(--iman-glass);
  box-shadow: var(--shadow-soft);
}
.dashboard-insights-grid { gap: var(--iman-gap); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .page-hero-date { display: none; }
  .page-hero-art { flex-basis: 300px; }
}

@media (max-width: 980px) {
  .app-shell,
  .app-shell-body.sidebar-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(270px, calc(100vw - 40px));
    height: 100dvh;
    margin: 0;
    border-radius: 0 18px 18px 0;
  }

  .sidebar-mobile-header { display: none !important; }
  .mobile-nav-button { display: flex; }
  .mobile-nav-button em { display: none; }
  .desktop-sidebar-toggle { display: none; }
  .app-main { padding: 8px 10px 14px; }
  .daily-report-actions { margin-left: 0; }
}

@media (max-width: 720px) {
  :root { --iman-gap: 8px; }

  .app-topbar { gap: 7px; min-height: 50px; padding: 6px 7px; }
  .app-global-search { flex: 1 1 auto; }
  .user-pill > span:last-child,
  .app-logout > span { display: none; }
  .user-pill { padding: 0; border: 0; background: transparent; }
  .app-topbar-account { gap: 4px; }
  .app-topbar-account .button.app-logout { width: 38px; padding: 0; }

  .page-hero {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .page-hero-art { display: none; }
  .page-hero-icon { width: 42px; height: 42px; border-radius: 12px; }
  .page-hero-heading { flex: 1 1 0; }
  .app-main .page-hero .muted-text { font-size: 0.76rem; }
  .page-hero-side { flex: 1 1 100%; }
  .page-hero-side:empty { display: none; }
  .page-hero-side .page-actions { justify-content: flex-start; }

  .card, .table-card, .stat-card { padding: 10px; }
  .daily-report-commandbar, .filter-bar { padding: 8px; }
  .daily-upload-bar, .daily-report-actions { width: 100%; }
  .daily-file-picker { flex: 1 1 auto; }
  .daily-report-actions .button { flex: 1 1 auto; }
  .filter-bar select, .filter-bar .filter-bar-date { flex: 1 1 calc(50% - 4px); max-width: none; }
  .filter-bar-actions { width: 100%; }
  .filter-bar-actions > * { flex: 1; }
  .import-location-notice { flex-wrap: wrap; }
}
