:root {
  --horilla-logo-auth: url("/auth-logo.png");
  --horilla-logo-main: url("/horilla-logo.png");
  --horilla-brand: #004966;
  --horilla-brand-light: #0e6081;
  --horilla-secondary: #f06000;
  --horilla-secondary-dark: #cc5000;
  --horilla-success: #1fa463;
  --horilla-warning: #e4910c;
  --horilla-neutral: #93a0b4;
  --horilla-bg: #f9f9f9;
  --horilla-surface: #ffffff;
  --horilla-surface-soft: #f5f7f9;
  --horilla-border: #d5dde5;
  --horilla-border-light: #e9edf1;
  --horilla-text: #1c1c1c;
  --horilla-muted: #666666;
  --horilla-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body {
  background: linear-gradient(180deg, #f9f9f9 0%, #f3f5f7 100%);
  color: var(--horilla-text);
}

h1,
h2,
h3 {
  font-weight: 600;
}

.loading-mark,
.auth-logo,
.avatar-fallback,
.hero-avatar--fallback {
  background: linear-gradient(
    160deg,
    var(--horilla-brand) 0%,
    var(--horilla-brand-light) 100%
  );
  box-shadow: 0 12px 24px rgba(0, 73, 102, 0.18);
}

.loading-mark,
.auth-logo {
  width: 176px;
  height: 42px;
  border-radius: 0;
  background: center / contain no-repeat var(--horilla-logo-auth);
  box-shadow: none;
  color: transparent;
}

.auth-brand {
  align-items: flex-start;
}

.auth-screen {
  background:
    linear-gradient(180deg, rgba(0, 73, 102, 0.08) 0, rgba(0, 73, 102, 0.02) 240px, transparent 240px),
    var(--horilla-bg);
}

.auth-panel {
  background: var(--horilla-surface);
  border: 1px solid var(--horilla-border-light);
  border-top: 5px solid var(--horilla-secondary);
  border-radius: 10px;
  box-shadow: var(--horilla-shadow);
  padding: 24px;
}

.auth-brand {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--horilla-border-light);
}

.auth-brand .eyebrow {
  display: none;
}

.auth-brand h1 {
  margin-top: 0.15rem;
}

.auth-description,
.muted-text,
.small-text,
.metric-copy,
.list-copy,
.hero-copy {
  color: var(--horilla-muted);
}

.eyebrow {
  color: var(--horilla-brand-light);
}

.mini-chip {
  background: #eef4f7;
  color: var(--horilla-brand-light);
  border: 1px solid rgba(14, 96, 129, 0.12);
}

.mini-chip.is-inverse {
  background: #fff4eb;
  color: var(--horilla-secondary);
  border: 1px solid rgba(240, 96, 0, 0.18);
}

.app-shell {
  max-width: 560px;
  padding: 12px 12px calc(102px + env(safe-area-inset-bottom));
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 14px;
  margin: -12px -12px 18px;
  padding: 18px 16px;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--horilla-brand) 0%,
    var(--horilla-brand-light) 100%
  );
  border: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 10px 24px rgba(0, 73, 102, 0.16);
}

.section-title-row > div:first-child::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  background: left center / auto 100% no-repeat var(--horilla-logo-main);
}

.shell-header h1,
.shell-header .eyebrow,
.shell-header .muted-text {
  color: #ffffff;
}

.shell-header .eyebrow {
  display: none;
}

.shell-header .muted-text {
  opacity: 0.78;
}

.profile-row {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: none;
}

.profile-row strong,
.profile-row .small-text {
  color: #ffffff;
}

.profile-row .small-text {
  opacity: 0.8;
}

.ghost-button,
.segment-button {
  min-height: 40px;
  background: var(--horilla-surface);
  color: var(--horilla-brand);
  border: 1px solid var(--horilla-border);
  border-radius: 6px;
  box-shadow: none;
}

.shell-header .ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.shell-header .ghost-button:hover,
.shell-header .ghost-button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.primary-button {
  min-height: 42px;
  background: var(--horilla-secondary);
  color: #ffffff;
  border: 1px solid var(--horilla-secondary);
  border-radius: 6px;
  box-shadow: var(--horilla-shadow);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--horilla-secondary-dark);
}

.segment-button.is-active {
  background: var(--horilla-brand-light);
  color: #ffffff;
  border-color: var(--horilla-brand-light);
}

.offline-banner,
.status-banner {
  border-radius: 6px;
  box-shadow: none;
}

.offline-banner,
.status-banner.is-warning {
  color: #7b4600;
  background: #fff5e9;
  border: 1px solid #f4d5ad;
  border-left: 4px solid var(--horilla-warning);
}

.status-banner.is-success {
  color: #13653d;
  background: #eefaf4;
  border: 1px solid #cfe9db;
  border-left: 4px solid var(--horilla-success);
}

.status-banner.is-error,
.status-pill.is-rejected,
.level-pill.is-rejected {
  background: #fdf1f1;
  border: 1px solid #efc9c9;
  border-left: 4px solid #d04a4a;
  color: #b53c3c;
}

.status-banner.is-info,
.level-pill.is-info {
  background: #eef4f7;
  border: 1px solid #d7e4ec;
  border-left: 4px solid var(--horilla-brand-light);
  color: var(--horilla-brand);
}

.section-card,
.stat-card,
.info-tile,
.list-card,
.hero-card {
  background: var(--horilla-surface);
  border: 1px solid var(--horilla-border-light);
  border-radius: 8px;
  box-shadow: var(--horilla-shadow);
}

.section-card,
.hero-card {
  border-top: 5px solid var(--horilla-brand-light);
}

.action-card {
  border-top-color: var(--horilla-secondary);
}

.hero-card {
  color: var(--horilla-text);
  gap: 16px;
  padding: 18px;
}

.hero-card .eyebrow {
  color: var(--horilla-brand-light);
}

.hero-user {
  align-items: flex-start;
}

.hero-avatar {
  border: 2px solid rgba(0, 73, 102, 0.12);
}

.metric-grid .stat-card:nth-child(1) {
  border-top: 5px solid var(--horilla-brand-light);
}

.metric-grid .stat-card:nth-child(2) {
  border-top: 5px solid var(--horilla-success);
}

.metric-grid .stat-card:nth-child(3) {
  border-top: 5px solid var(--horilla-warning);
}

.metric-grid .stat-card:nth-child(4) {
  border-top: 5px solid var(--horilla-neutral);
}

.metric-value {
  color: var(--horilla-text);
}

.metric-label {
  color: var(--horilla-muted);
}

.quick-link {
  background: var(--horilla-surface);
  border: 1px solid var(--horilla-border-light);
  border-left: 4px solid var(--horilla-brand-light);
  border-radius: 8px;
  box-shadow: none;
}

.quick-link:nth-child(2) {
  border-left-color: var(--horilla-secondary);
}

.quick-link:nth-child(3) {
  border-left-color: var(--horilla-neutral);
}

.quick-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--horilla-shadow);
}

.info-tile {
  background: var(--horilla-surface-soft);
  border-radius: 6px;
  box-shadow: none;
}

.input-control {
  background: var(--horilla-surface);
  color: var(--horilla-text);
  border: 1px solid var(--horilla-border);
  border-radius: 6px;
  min-height: 44px;
}

.input-control:focus {
  border-color: var(--horilla-brand-light);
  box-shadow: 0 0 0 3px rgba(14, 96, 129, 0.12);
}

.segmented-control {
  background: var(--horilla-surface-soft);
  border: 1px solid var(--horilla-border-light);
  border-radius: 8px;
}

.list-card--highlight {
  background: #fff8f2;
  border-color: rgba(240, 96, 0, 0.2);
}

.status-pill,
.level-pill {
  border-radius: 999px;
}

.status-pill.is-success,
.level-pill.is-success {
  background: #eefaf4;
  border: 1px solid #cfe9db;
  color: #13653d;
}

.status-pill.is-neutral {
  background: #f2f4f6;
  border: 1px solid var(--horilla-border);
  color: #5e6876;
}

.status-pill.is-requested,
.level-pill.is-warning {
  background: #fff5e9;
  border: 1px solid #f4d5ad;
  color: #9a6000;
}

.empty-state {
  background: var(--horilla-surface-soft);
  border: 1px dashed var(--horilla-border);
  border-radius: 8px;
  color: var(--horilla-muted);
}

.bottom-nav {
  width: min(calc(100% - 20px), 520px);
  padding: 8px;
  gap: 6px;
  bottom: 10px;
  background: var(--horilla-brand);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 73, 102, 0.22);
  backdrop-filter: blur(10px);
}

.nav-link {
  color: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 10px 6px;
}

.nav-link.is-active {
  position: relative;
  color: #ffffff;
  background: var(--horilla-brand-light);
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--horilla-secondary);
  transform: translateX(-50%);
}

@media (min-width: 540px) {
  .metric-grid,
  .link-grid,
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .loading-mark,
  .auth-logo {
    width: 144px;
    height: 36px;
  }

  .section-title-row > div:first-child::before {
    width: 28px;
    height: 28px;
  }
}
