﻿:root {
  --bg: #f4fbf9;
  --bg-soft: #e9f7f4;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --line: rgba(52, 120, 111, 0.18);
  --text: #184640;
  --muted: #5e7f79;
  --primary: #7bd2c5;
  --primary-strong: #56b8a9;
  --primary-deep: #2c8074;
  --accent: #f39a4a;
  --accent-deep: #de7d28;
  --danger: #d95757;
  --success: #2ea271;
  --shadow: 0 22px 44px rgba(22, 82, 73, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --max-width: 1280px;
  --header-height: 84px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(123, 210, 197, 0.3), transparent 34%),
    linear-gradient(180deg, #f8fffd 0%, #eef8f6 52%, #eff6f4 100%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.large { font-size: 1.06rem; line-height: 1.7; }
.center { text-align: center; }

.notifications {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 2000;
  display: grid;
  gap: 10px;
}
.notice {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  animation: slideIn .28s ease;
}
.notice.success { border-left: 4px solid var(--success); }
.notice.error { border-left: 4px solid var(--danger); }
.notice.warn { border-left: 4px solid var(--accent); }

.site-shell,
.app-shell {
  width: min(calc(100% - 36px), var(--max-width));
  margin: 16px auto 28px;
}

.public-header,
.app-header,
.panel,
.hero-panel,
.feature-card,
.module-shell,
.glass-card,
.login-card,
.card,
.data-card,
.document-card,
.metric-card,
.empty-state,
.form-shell,
.tabs {
  backdrop-filter: blur(18px);
}

.public-header,
.app-header {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(233,247,244,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.brand-wrap,
.app-brand {
  display: flex;
  gap: 22px;
  align-items: center;
  min-width: 0;
}
.brand-copy,
.app-brand > div:last-child { min-width: 0; }
.logo-ohana{
  width:100%;
  max-width:260px;
  height:160px;
  object-fit:contain;
  display:block;
  margin:0 auto 20px auto;
  mix-blend-mode: multiply;
  filter: saturate(1.03) contrast(1.02);
}
.brand-kicker,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .82rem;
  color: var(--primary-deep);
}
.public-header h1,
.app-header h2,
.hero-copy h2,
.panel h2,
.module-shell h2 {
  margin: 0;
  line-height: 1.05;
}
.public-header h1 { font-size: clamp(2.6rem, 4vw, 4.8rem); }
.brand-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.65;
  font-size: 1.04rem;
}
.header-actions,
.app-top-actions,
.hero-actions,
.inline-actions,
.card-actions,
.modal-actions,
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
  user-select: none;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #093c35;
  box-shadow: 0 12px 24px rgba(86, 184, 169, 0.28);
}
.button.secondary {
  background: linear-gradient(135deg, #fff5eb, #ffe1c4);
  color: #6a3a08;
}
.button.ghost {
  background: rgba(255,255,255,0.84);
  color: var(--text);
  border: 1px solid var(--line);
}
.button.orange {
  background: linear-gradient(135deg, #ffb266, var(--accent));
  color: #4f2500;
}
.button.danger {
  background: linear-gradient(180deg, #ef7b7b, #d95757);
  color: #fff;
}
.button.small { padding: 10px 16px; font-size: .94rem; }
.button.full { width: 100%; justify-content: center; }

.public-main,
.app-main {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}
.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(222,245,240,0.85));
  box-shadow: var(--shadow);
}
.hero-copy { display: grid; gap: 18px; align-content: center; }
.hero-copy h2 { font-size: clamp(2rem, 3vw, 3.2rem); max-width: 760px; }
.hero-stats { display: grid; gap: 16px; align-content: center; }
.glass-card,
.feature-card,
.panel,
.module-shell,
.empty-state,
.card,
.data-card,
.document-card,
.metric-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(240,250,247,0.96));
  box-shadow: var(--shadow);
}
.glass-card { padding: 20px; }
.stat-label { margin: 0 0 8px; color: var(--accent-deep); font-size: .86rem; text-transform: uppercase; letter-spacing: .2em; }
.float-card { animation: floatSoft 5.5s ease-in-out infinite; }
.float-card.delay-2 { animation-delay: .8s; }

.feature-grid,
.dashboard-grid,
.data-grid,
.documents-grid,
.forms-grid,
.metrics-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}
.feature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.feature-card { padding: 22px; }
.feature-card h3 { margin: 0 0 10px; font-size: 1.22rem; }
.feature-card p { margin: 0; line-height: 1.65; }

.tabs {
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-button {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 12px 14px;
  font-weight: 700;
}
.tab-button-utility {
  margin-left: 0;
  padding-inline: 18px;
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255,255,255,0.92);
}
.tab-button.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #08342f;
  box-shadow: 0 10px 20px rgba(86, 184, 169, 0.25);
}
.module-shell { padding: 22px; animation: fadeUp .32s ease; }
.module-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.module-header p,
.panel p,
.metric-card p,
.card p,
.data-card p { margin: 0; }
.metrics-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metric-card { padding: 18px; }
.metric-card strong { display: block; margin-top: 10px; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--primary-deep); }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.panel,
.card,
.data-card,
.document-card { padding: 20px; }
.card-title-row,
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.card-title-row h3,
.data-card h3,
.document-card h3,
.metric-card h3,
.module-shell h3 { margin: 0 0 10px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(123,210,197,0.16);
  color: var(--primary-deep);
  font-weight: 700;
  font-size: .82rem;
}
.badge.warn { background: rgba(243,154,74,0.16); color: #8f4a08; }
.badge.danger { background: rgba(217,87,87,0.14); color: #9d2020; }
.badge.ok { background: rgba(46,162,113,0.12); color: #1d7b54; }
.list-stack { display: grid; gap: 14px; }
.card-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.kv { display: grid; gap: 8px; }
.kv strong { color: var(--text); }
.payment-card {
  display: grid;
  gap: 12px;
}
.payment-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  line-height: 1.4;
}
.payment-breakdown-item {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.input,
.textarea,
.select {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(52, 120, 111, 0.18);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(86,184,169,0.72);
  box-shadow: 0 0 0 4px rgba(123,210,197,0.18);
}
.textarea { min-height: 118px; resize: vertical; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-weight: 700; color: var(--primary-deep); }
.details-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(255,255,255,0.78);
}
.details-panel summary { cursor: pointer; font-weight: 700; color: var(--text); }
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  position: relative;
  overflow: hidden;
}
.empty-state::after {
  content: "";
  position: absolute;
  inset: auto -15% -55% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(123,210,197,0.22), transparent 68%);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 41, 38, 0.42);
  z-index: 1500;
}
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100% - 36px));
  max-height: min(88vh, 940px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,250,247,0.98));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(10, 47, 42, 0.24);
  z-index: 1600;
  animation: fadeScale .22s ease;
}
.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: rgba(245, 251, 249, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 8;
}
.modal-body {
  padding: 18px 20px 22px;
  display: grid;
  gap: 18px;
  overflow: auto;
  overflow-x: hidden;
  min-height: 0;
}
.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  font-size: 1.5rem;
  line-height: 1;
}
.viewer-frame,
.viewer-image {
  width: 100%;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.viewer-image {
  object-fit: contain;
  min-height: auto;
  max-height: 70vh;
}
.preview-shell {
  display: grid;
  gap: 14px;
}
.preview-toolbar {
  position: sticky;
  bottom: 0;
  z-index: 7;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(245, 251, 249, 0.9), rgba(245, 251, 249, 0.98));
  border-top: 1px solid rgba(143, 190, 181, 0.35);
  backdrop-filter: blur(10px);
}
.preview-stage {
  position: relative;
  min-height: 280px;
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f4fbf9);
  touch-action: none;
}
.preview-stage.preview-stage-doc {
  padding: 18px;
  touch-action: auto;
}
.preview-image-wrap {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
}
.preview-image-wrap.is-grabbing,
.preview-image-wrap.is-grabbing .viewer-image {
  cursor: grabbing;
}
.preview-image-wrap .viewer-image {
  width: auto;
  max-width: none;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 16px 32px rgba(10, 47, 42, 0.12);
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.preview-hint {
  font-size: .92rem;
  color: var(--muted);
}
.preview-toolbar .button.small {
  min-width: 48px;
}
.preview-toolbar .button {
  position: relative;
  z-index: 4;
}
.preview-toolbar .button.preview-zoom-button {
  min-width: 58px;
  padding-inline: 18px;
}
.preview-toolbar .button.preview-fullscreen-button {
  padding-inline: 18px;
}
.reveal { animation: fadeUp .45s ease both; }
.stagger-1 { animation-delay: .06s; }
.stagger-2 { animation-delay: .12s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeScale {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes floatSoft {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 980px) {
  .public-header,
  .hero-panel { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .feature-grid,
  .dashboard-grid,
  .metrics-grid,
  .card-grid-two,
  .form-grid.two,
  .form-grid.three { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-shell,
  .app-shell { width: min(calc(100% - 24px), var(--max-width)); margin: 10px auto calc(16px + var(--safe-bottom)); }
  .public-header,
  .app-header,
  .hero-panel,
  .module-shell,
  .panel { padding: 16px; }
  .public-header h1 { font-size: 2.7rem; }
  .hero-copy h2 { font-size: 2rem; }
  .app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 16px;
    border-radius: 24px;
  }
  .app-brand {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
  }
  .logo-ohana{
    max-width:220px;
    height:140px;
    margin:0 auto 16px auto;
  }
  .app-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
  }
  .app-top-actions .button {
    width: 100%;
    padding: 12px 14px;
    min-height: 50px;
    font-size: 0.98rem;
  }
  .tabs {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 10px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 10px 24px rgba(15, 72, 65, 0.12);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-button {
    flex: 0 0 auto;
    padding: 11px 15px;
  }
  .tab-button-utility {
    margin-left: 0;
    border-color: var(--line);
    background: rgba(255,255,255,0.92);
  }
  .modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 30px);
    border-radius: 22px;
  }
  .input,
  .textarea,
  .select {
    padding: 12px 14px;
    border-radius: 14px;
  }
  .viewer-frame { min-height: 320px; }
  .preview-toolbar { gap: 8px; padding-bottom: 6px; }
  .preview-stage { max-height: 62vh; }
  .preview-toolbar .button {
    min-height: 50px;
  }
  .preview-toolbar .button.preview-zoom-button,
  .preview-toolbar .button.preview-fullscreen-button {
    min-width: 64px;
    font-size: 1.05rem;
  }
  .preview-hint {
    width: 100%;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 12px 14px 16px;
    gap: 14px;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
}
