:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #172033;
  --muted: #64748b;
  --panel: #ffffff;
  --soft: #eef4ff;
  --line: #dbe4ef;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --accent: #14b8a6;
  --accent-soft: #e6fffb;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --control-bg: #f8fafc;
  --shadow: 0 22px 48px rgba(15, 23, 42, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Nastaliq Urdu", "Noto Naskh Arabic", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), transparent 46%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-sidebar-open {
  overflow: hidden;
}

body.is-loading .login-shell,
body.is-loading .app {
  display: none !important;
}

.app-loader {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.loader-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(37, 99, 235, 0.16);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.app-loader p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

button {
  cursor: pointer;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 16px;
  font-size: 4.8rem;
  line-height: 0.94;
  letter-spacing: 0;
  font-weight: 850;
}

h2 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 850;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
  line-height: 1.3;
  font-weight: 750;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  min-height: 100vh;
}

.brand-panel,
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}

.brand-panel {
  gap: 22px;
  justify-content: center;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.loader-logo {
  width: 76px;
  height: 76px;
}

.login-logo {
  width: min(150px, 38vw);
  height: auto;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.lead {
  max-width: 440px;
  color: #475569;
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-panel {
  background: rgba(255, 255, 255, 0.58);
  border-inline-start: 1px solid rgba(15, 23, 42, 0.08);
}

.language-row {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-self: flex-end;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.language-row.compact {
  width: 100%;
  margin: 0;
}

.sidebar-scope {
  margin-top: 0;
  color: #334155;
  font-size: 0.84rem;
}

.sidebar-scope select {
  min-height: 40px;
}

.lang-button {
  min-width: 94px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.lang-button.is-active {
  color: #ffffff;
  background: var(--brand);
}

.login-card,
.panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 430px);
  align-self: center;
  padding: clamp(24px, 4vw, 38px);
}

.form-heading p {
  color: var(--muted);
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  min-height: 46px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 14px;
  color: var(--ink);
  background-color: var(--control-bg);
  outline: 0;
}

.field select {
  height: 46px;
}

.field input:not([type="checkbox"]) {
  height: 46px;
}

html[dir="rtl"] .field select {
  padding-inline-start: 14px;
  padding-inline-end: 14px;
}

.field input[type="date"] {
  height: 46px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}

.day-preview {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  color: #0f766e;
  background: #ecfdf5;
  font-size: 0.78rem;
  font-weight: 800;
}

.day-preview.is-duplicate {
  color: #b91c1c;
  background: #fee2e2;
}

.field input.duplicate-date,
.bulk-table input.duplicate-date {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.inline-field {
  max-width: 360px;
  margin-top: 0;
}

.chart-label-mode {
  min-width: 170px;
  max-width: 190px;
}

.chart-label-mode select {
  min-height: 38px;
  height: 38px;
}

.report-filter {
  min-width: min(260px, 100%);
}

.control-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.module-panel[hidden] {
  display: none;
}

.field textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.form-panel > .primary-button {
  margin-top: 22px;
}

.checkbox-field {
  min-height: 52px;
  align-items: center;
  grid-template-columns: auto 1fr;
  flex-direction: row;
  gap: 10px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  min-height: auto;
}

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

.mini-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
}

.mini-check input {
  width: 16px;
  height: 16px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.form-options {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.link-button {
  border: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 700;
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.form-message.success {
  color: var(--success);
}

.form-warning {
  margin: 2px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 8px;
  color: #92400e;
  background: var(--warning-soft);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.nav-button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 750;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.primary-button {
  width: 100%;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.primary-button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--brand-strong);
  background: #eaf1ff;
}

.secondary-button:hover {
  color: #ffffff;
  background: var(--brand);
}

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

.quick-login-button {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  white-space: normal;
}

.demo-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.menu-toggle,
.sidebar-backdrop {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 100vh;
  padding: 24px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-size: 1.1rem;
}

.nav-list,
.sidebar-footer {
  display: grid;
  gap: 10px;
}

.api-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  color: #92400e;
  background: var(--warning-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.api-status.online {
  border-color: #bbf7d0;
  color: var(--success);
  background: var(--success-soft);
}

.nav-section-label {
  margin: 14px 0 2px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: #475569;
  background: transparent;
  text-align: start;
}

.nav-button:hover {
  color: var(--brand-strong);
  background: #f1f5f9;
}

.nav-parent {
  position: relative;
  font-weight: 750;
}

.nav-parent span {
  flex: 1;
}

.nav-parent[aria-expanded="true"] {
  color: var(--brand-strong);
  background: #eaf1ff;
}

.nav-parent[aria-expanded="true"]::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.nav-button svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.nav-chevron {
  margin-left: auto;
  opacity: 0.72;
  transition: transform 160ms ease;
}

html[dir="rtl"] .nav-chevron {
  margin-right: auto;
  margin-left: 0;
}

.nav-parent[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.nav-button.is-active {
  color: #ffffff;
  background: var(--brand);
}

.nav-sublist {
  display: grid;
  gap: 4px;
  margin: 2px 0 8px 28px;
  padding: 6px;
  border-left: 2px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
}

html[dir="rtl"] .nav-sublist {
  margin-right: 28px;
  margin-left: 0;
  border-right: 2px solid #dbeafe;
  border-left: 0;
}

.nav-sublist[hidden] {
  display: none;
}

.nav-sublist button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #64748b;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: start;
  cursor: pointer;
}

.nav-sublist button:hover {
  color: var(--brand-strong);
  background: #eaf1ff;
}

.nav-sublist button.is-active {
  color: #ffffff;
  background: var(--brand);
}

.workspace {
  min-width: 0;
  padding: clamp(22px, 4vw, 42px);
}

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

.header-scope {
  width: min(340px, 38vw);
  margin-top: 0;
}

.header-scope span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: none;
}

.user-pill {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

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

.dashboard-grid article,
.record-card {
  min-height: 126px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.11);
  transform: translateY(-1px);
  outline: none;
}

.card-detail-button {
  min-height: 32px;
  margin-top: auto;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--brand-strong);
  background: var(--soft);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.card-detail-button:hover,
.card-detail-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.42);
  background: #e0ebff;
  outline: none;
}

.dashboard-grid article.warning-card {
  border-color: #fecaca;
  background: var(--danger-soft);
}

.dashboard-grid article.warning-card span,
.dashboard-grid article.warning-card strong {
  color: #991b1b;
}

.dashboard-grid span,
.record-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
}

.dashboard-grid strong,
.record-card strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.12;
  font-weight: 850;
}

.broker-sales-overview {
  margin-top: 14px;
}

.record-card strong {
  margin-top: 18px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

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

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading > .secondary-button,
.panel-heading > .primary-button {
  flex: 0 0 auto;
  min-width: 132px;
}

.form-panel.wide {
  max-width: 980px;
}

.compact-form {
  max-width: none;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  min-height: auto;
  box-shadow: none;
}

.record-card strong {
  margin-top: 0;
  font-size: 1rem;
}

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

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.record-actions .secondary-button,
td .secondary-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.82rem;
}

.status-pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.status-pill.closed {
  color: #92400e;
  background: var(--warning-soft);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.pagination-controls > div {
  display: flex;
  gap: 8px;
}

.pagination-controls .secondary-button {
  min-height: 34px;
  padding: 0 12px;
}

.pagination-controls .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.bulk-table {
  min-width: 1180px;
}

.bulk-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.bulk-control-grid .field {
  margin-top: 0;
}

.bulk-field-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.bulk-field-panel > strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.bulk-field-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-field-options .mini-check {
  margin: 0;
}

.bulk-table input,
.bulk-table select,
.bulk-table textarea {
  width: 100%;
  min-width: 112px;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--control-bg);
  font: inherit;
}

.bulk-table select {
  height: 38px;
}

.bulk-table textarea {
  min-width: 180px;
  padding-top: 8px;
  resize: vertical;
}

.bulk-table .icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.bulk-table-wrap + .primary-button {
  margin-top: 18px;
}

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

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  background: #f8fafc;
}

tbody tr:hover {
  background: #f8fbff;
}

.date-with-day {
  display: grid;
  gap: 3px;
}

.date-with-day strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.date-with-day span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.phase-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-inline-start: 22px;
  color: #334155;
}

.phase-list li::marker {
  color: var(--accent);
  font-weight: 750;
}

.reports-home {
  overflow: hidden;
  padding: 0;
}

.report-hero {
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(37, 99, 235, 0.88)),
    #0f766e;
}

.report-hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.report-hero h3 {
  margin: 4px 0 8px;
  font-size: 2rem;
}

.report-hero p:last-child {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.6;
}

.report-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.report-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: #f8fafc;
}

.report-menu-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.report-menu-card:hover,
.report-menu-card:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 16px 34px rgba(20, 83, 45, 0.12);
  transform: translateY(-2px);
}

.report-menu-card svg {
  width: 34px;
  height: 34px;
  padding: 7px;
  color: #0f766e;
  border-radius: 8px;
  background: #ccfbf1;
}

.report-menu-card strong {
  font-size: 1.08rem;
  line-height: 1.3;
}

.report-menu-card span {
  color: var(--muted);
  line-height: 1.5;
}

.report-panel {
  border-top: 4px solid var(--accent);
}

.report-panel .panel-heading {
  display: grid;
  grid-template-columns: 1fr;
  align-items: flex-start;
  justify-content: stretch;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.report-panel .panel-heading h3 {
  margin-top: 0;
}

.report-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  justify-content: stretch;
  margin-top: 10px;
  width: 100%;
}

.report-toolbar .field {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.report-toolbar .primary-button,
.report-toolbar .secondary-button {
  min-height: 46px;
  width: 100%;
}

.report-toolbar .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.report-toolbar .primary-button svg {
  width: 17px;
  height: 17px;
}

.report-panel .broker-sales-overview article {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.compact-report {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.report-section-title {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 850;
}

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

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

.report-chart-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 16px 0;
}

.report-chart-grid .panel-heading {
  min-height: auto;
  padding-bottom: 0;
}

.report-chart-grid h3 {
  font-size: 1rem;
}

.report-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.daily-flock-profile .report-line,
.daily-report-insights .report-line {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.daily-flock-profile .report-line strong,
.daily-report-insights .report-line strong {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.daily-flock-profile .report-line span,
.daily-report-insights .report-line span {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.report-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-panel {
  max-width: 980px;
}

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

.chart {
  min-height: 330px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
}

.chart .apexcharts-canvas {
  margin: 0 auto;
}

.chart .apexcharts-marker,
.chart .apexcharts-datalabels .apexcharts-data-labels-background,
.chart .apexcharts-datalabels .apexcharts-datalabel-background {
  display: none !important;
}

.chart-bar {
  display: grid;
  align-items: end;
  min-width: 48px;
  height: 180px;
  gap: 6px;
}

.chart:not(:has(.apexcharts-canvas)) {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, #ffffff, #eef4ff);
}

.chart:not(:has(.apexcharts-canvas)) .chart-bar {
  display: grid;
  align-items: end;
  min-width: 48px;
  height: 180px;
  gap: 6px;
}

.chart-fill {
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  background: var(--brand);
}

.chart-bar.weight .chart-fill {
  background: var(--accent);
}

.chart-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  text-align: center;
}

.estimator {
  margin: 16px 0;
}

body.is-authenticated .login-shell {
  display: none;
}

body.is-authenticated .app {
  display: grid;
}

html[dir="rtl"] .eyebrow {
  text-transform: none;
}

html[dir="rtl"] .auth-panel {
  border-inline-start: 0;
  border-inline-end: 1px solid rgba(15, 23, 42, 0.08);
}

html[dir="rtl"] input,
html[dir="rtl"] textarea {
  text-align: right;
}

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

  .brand-panel {
    min-height: auto;
    padding-bottom: 28px;
  }

  .auth-panel {
    border-inline-start: 0;
    padding-top: 0;
  }

  .login-card {
    align-self: stretch;
  }

  .dashboard-grid,
  .form-grid,
  .split-grid,
  .daily-flock-profile,
  .daily-report-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-panel .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .report-panel .panel-heading h3 {
    margin-top: 0;
  }

  .report-toolbar {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  .menu-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--brand-strong);
    stroke-width: 2.4;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    gap: 0;
    width: min(86vw, 320px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;
    border-right: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 18px 0 52px rgba(15, 23, 42, 0.24);
    transform: translateX(-110%);
    transition: transform 180ms ease;
  }

  .sidebar > div:first-child {
    min-height: 0;
    overflow-y: auto;
    padding: 22px 22px 14px;
  }

  .sidebar-footer {
    flex-shrink: 0;
    padding: 14px 22px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.08);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .header-scope {
    width: min(360px, 44vw);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.42);
  }

  .sidebar-backdrop.is-open {
    display: block;
  }
}

@media (max-width: 640px) {
  .brand-panel,
  .auth-panel,
  .workspace {
    padding: 22px;
  }

  .sidebar {
    width: min(92vw, 340px);
  }

  h1 {
    font-size: 3rem;
  }

  .dashboard-grid,
  .form-grid,
  .split-grid,
  .report-menu-grid,
  .daily-flock-profile,
  .daily-report-insights {
    grid-template-columns: 1fr;
  }

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

  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .report-panel {
    padding: 16px;
  }

  .record-actions .report-filter {
    max-width: none;
  }

  .record-actions .secondary-button {
    width: 100%;
  }

  .language-row {
    width: 100%;
    align-self: stretch;
  }

  .form-options,
  .panel-heading,
  .report-line,
  .control-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading > .secondary-button,
  .panel-heading > .primary-button {
    width: 100%;
  }

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

  .bulk-control-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .topbar > div {
    min-width: 0;
    flex: 1 1 calc(100% - 62px);
  }

  .header-scope {
    width: 100%;
    flex: 1 1 100%;
  }
}
