:root { --orange: #f15a24; --blue: #073a9b; --ink: #161616; --muted: #909090; --line: #b7b7b7; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; background: #fff; color: var(--ink); font-family: Inter, Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: 100%; min-height: 100vh; min-height: 100dvh; margin: auto; background: #fff; }

.is-hidden { display: none !important; }
.auth-view { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 28px; animation: page-enter .65s cubic-bezier(.2,.8,.2,1); }
.auth-card { width: min(100%, 360px); }
.brand { text-align: center; font-size: clamp(22px, 6vw, 27px); font-weight: 800; font-style: italic; letter-spacing: .2px; line-height: 1; }
.brand-logo { display: block; width: min(230px, 74vw); max-height: 54px; margin: 0 auto; object-fit: contain; }
.brand-orange { color: var(--orange); }.brand-blue { color: var(--blue); }.brand-mark { color: var(--blue); display: inline-block; font-style: normal; transform: rotate(45deg); margin: 0 2px; }
.brand small { display: block; margin-top: 8px; color: #333; font-size: 11px; font-weight: 500; font-style: normal; }
.auth-form { display: grid; gap: 7px; margin-top: 38px; animation: rise-in .55s .12s both cubic-bezier(.2,.8,.2,1); }
.auth-form h1 { margin: 0 0 8px; font-size: 22px; }
label { color: #7c7c7c; font-size: 12px; }
input, select { height: 40px; border: 1.5px solid #999; border-radius: 7px; padding: 0 12px; outline-color: var(--blue); font-size: 12px; }
.primary-button { margin-top: 14px; height: 42px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; font-weight: 700; box-shadow: 0 7px 14px #073a9b30; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.primary-button:hover { background: #052e7d; transform: translateY(-2px); box-shadow: 0 10px 18px #073a9b35; }.primary-button:active { transform: scale(.98); }
.text-button { width: 100%; margin-top: 15px; border: 0; background: transparent; color: var(--blue); font-size: 12px; text-decoration: underline; }
.form-message { min-height: 17px; margin: 3px 0 0; color: #c1272d; font-size: 11px; }

.home-view { min-height: 100vh; min-height: 100dvh; padding: max(42px, env(safe-area-inset-top)) clamp(24px, 5vw, 60px) max(108px, env(safe-area-inset-bottom)); position: relative; animation: page-enter .55s cubic-bezier(.2,.8,.2,1); }
.measurement-view { min-height: 100vh; min-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) clamp(18px, 5vw, 60px) max(118px, env(safe-area-inset-bottom)); position: relative; animation: page-enter .55s cubic-bezier(.2,.8,.2,1); }
.history-view, .report-view { min-height: 100vh; min-height: 100dvh; padding: max(42px, env(safe-area-inset-top)) clamp(22px, 5vw, 60px) max(118px, env(safe-area-inset-bottom)); position: relative; animation: page-enter .55s cubic-bezier(.2,.8,.2,1); }

.page-header { max-width: 100%; margin: 0 auto; }.page-header h1 { margin: 0; font-size: clamp(27px, 5vw, 33px); letter-spacing: -.9px; }
.info-card, .form-card { max-width: 100%; margin: 32px auto 0; border: 1.5px solid #c7c7c7; border-radius: 14px; padding: 20px 21px; }.info-card p { display: flex; justify-content: space-between; gap: 18px; margin: 0 0 16px; color: #858585; font-size: 14px; }.info-card p:last-child { margin-bottom: 0; }.info-card strong { color: #454545; font-size: 12px; text-align: right; }
.measurement-form { max-width: 100%; margin: 0 auto; }.measurement-form .form-card { margin-top: 21px; }.measurement-form label { display: block; margin: 0 0 7px; font-size: 14px; }.measurement-form input, .measurement-form select { width: 100%; height: 39px; margin-bottom: 15px; border: 1.5px solid #888; border-radius: 8px; padding: 0 12px; background: #fff; font-size: 12px; }.measurement-form select { appearance: auto; }.measurement-form label:last-of-type + input, .measurement-form label:last-of-type + select { margin-bottom: 0; }
.measurement-form label::after { content: ' *'; color: #c53030; font-weight: 700; }
.measurement-form label:has(+ .optional-field)::after { content: ''; }
.dynamic-card { padding: 13px 21px 17px; }.dynamic-card fieldset { margin: 0; padding: 0 12px 14px; border: 1.5px solid #777; border-radius: 8px; }.dynamic-card legend { padding: 0 3px; color: #888; font-size: 15px; }.dynamic-card label { margin-top: 8px; font-size: 12px; }.submit-measurement { display: block; min-width: 190px; height: 42px; margin: 23px auto 0; border: 0; border-radius: 8px; background: #08745b; color: #fff; font-weight: 700; box-shadow: 0 6px 13px #08745b32; transition: transform .2s, background .2s; }.submit-measurement:hover { background: #065e49; transform: translateY(-2px); }.submit-measurement:active { transform: scale(.98); }

.history-filter { max-width: 100%; margin: 40px auto 29px; padding: 20px 21px 25px; border: 1.5px solid #c7c7c7; border-radius: 14px; }
.history-filter label, .report-tools label { display: block; margin-bottom: 7px; color: #858585; font-size: 14px; }
.history-filter select, .report-tools select { width: 100%; height: 40px; border: 1.5px solid #888; border-radius: 8px; padding: 0 12px; background: #fff; font-size: 12px; }
.filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; }

.report-tools { max-width: 100%; display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 40px auto 24px; padding: 20px 21px; border: 1.5px solid #c7c7c7; border-radius: 14px; }
.print-button { height: 40px; border: 0; border-radius: 8px; padding: 0 18px; background: #073a9b; color: #fff; font-weight: 700; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 100%; margin: 0 auto 30px; }
.report-summary article { min-height: 112px; display: grid; align-content: center; gap: 6px; padding: 18px; border: 1.5px solid #d0d0d0; border-radius: 14px; }
.report-summary span { color: #777; font-size: 13px; }
.report-summary strong { font-size: 30px; }
.safe-summary strong { color: #198c42; }
.limit-summary strong { color: #c53030; }
.report-table-section { max-width: 100%; margin: 0 auto; }
.report-table-section h2 { margin: 0 0 14px; font-size: 18px; }
.table-scroll { width: 100%; max-width: 100%; margin: 0 auto; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 7px; }
.table-scroll::-webkit-scrollbar-thumb { background: #aaa; border-radius: 10px; }
table { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 11px; }
th { padding: 10px 7px; border-bottom: 2px solid #c7c7c7; color: #555; text-align: left; font-weight: 700; }
td { padding: 11px 7px; border-bottom: 1px solid #e5e5e5; color: #505050; vertical-align: top; }
td:first-child { color: #777; }
.status-safe { color: #198c42; font-weight: 600; }
.status-limit { color: #c53030; font-weight: 700; }
.history-empty { max-width: 100%; margin: 22px auto; color: #808080; font-size: 13px; text-align: center; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 100%; margin: 18px auto 0; }
.page-btn { height: 38px; padding: 0 16px; border: 1.5px solid var(--blue); border-radius: 8px; background: #fff; color: var(--blue); font-weight: 700; font-size: 12px; transition: background .2s, color .2s, transform .1s; }
.page-btn:hover:not(:disabled) { background: var(--blue); color: #fff; }
.page-btn:active:not(:disabled) { transform: scale(.96); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; border-color: #c7c7c7; color: #999; }
.page-info { color: #666; font-size: 12px; font-weight: 600; }

@media print { .pagination { display: none !important; } }

.delete-btn { height: 28px; padding: 0 10px; border: 0; border-radius: 5px; background: #c53030; color: #fff; font-size: 10px; font-weight: 700; transition: background .2s, transform .1s; }
.delete-btn:hover { background: #9b2c2c; }
.delete-btn:active { transform: scale(0.95); }

.toast { position: fixed; z-index: 10; left: 50%; bottom: max(92px, calc(env(safe-area-inset-bottom) + 76px)); width: min(calc(100% - 40px), 370px); padding: 14px 18px; border-radius: 12px; background: #08745b; color: #fff; font-size: 14px; font-weight: 600; text-align: center; box-shadow: 0 10px 25px #0000002c; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.date-label { margin: 0 0 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.home-view h1 { margin: 0; font-size: clamp(21px, 4vw, 27px); letter-spacing: -.7px; }
.brand-line { display: flex; margin-top: 10px; height: 8px; overflow: hidden; border-radius: 10px; }
.brand-line span:first-child { width: 51%; background: var(--orange); }
.brand-line span:last-child { flex: 1; background: var(--blue); }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 25px; max-width: 100%; }
.menu-card { min-height: 155px; display: grid; place-content: center; gap: 14px; border: 1.5px solid var(--line); border-radius: 17px; background: #fff; color: #252525; text-align: left; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s; animation: rise-in .5s both cubic-bezier(.2,.8,.2,1); }
.menu-card:nth-child(2) { animation-delay: .08s; }
.menu-card:hover { border-color: var(--blue); box-shadow: 0 10px 25px #073a9b18; transform: translateY(-5px); }
.menu-card:active { transform: scale(.97); }
.menu-card svg { width: 58px; height: 58px; fill: none; stroke: #000; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.menu-card span { font-size: 13px; font-weight: 600; line-height: 1.25; }
.home-message { max-width: 100%; color: #616161; font-size: 13px; }

.bottom-nav { 
  position: fixed; 
  bottom: 24px; 
  left: 50%; 
  transform: translateX(-50%); 
  display: grid; 
  grid-template-columns: repeat(5, minmax(0, 1fr)); 
  width: min(calc(100% - 36px), 520px); 
  padding: 7px; 
  border-radius: 36px; 
  background: rgba(222, 222, 222, 0.95); 
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px #00000018; 
  z-index: 1000; 
}
.nav-item { display: grid; place-items: center; gap: 1px; min-height: 45px; min-width: 0; border: 0; border-radius: 25px; background: transparent; color: #777; font-size: 9px; transition: transform .2s, background .2s, color .2s; }
.nav-item .icon { font-size: 21px; line-height: 18px; }
.nav-item.active { background: #959595; color: white; }
.nav-item:hover { background: #b7b7b7; color: #fff; }
.nav-item:active { transform: scale(.9); }

.modal { border: none; border-radius: 14px; padding: 24px; max-width: 500px; width: 90%; max-height: 85vh; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal::backdrop { background: rgba(0,0,0,0.5); }
.modal-scroll-area { max-height: calc(85vh - 160px); overflow-y: auto; padding-right: 10px; margin-bottom: 12px; overscroll-behavior: contain; }
.modal-scroll-area::-webkit-scrollbar { width: 6px; }
.modal-scroll-area::-webkit-scrollbar-thumb { background: #bbb; border-radius: 10px; }
.export-form-layout fieldset { margin: 0 0 18px; border: 1.5px solid #ccc; border-radius: 8px; padding: 16px; }
.export-form-layout legend { font-weight: 700; color: #454545; padding: 0 6px; }
.export-form-layout label { display: block; margin-top: 14px; font-size: 13px; }
.export-form-layout label:first-of-type { margin-top: 4px; }
.export-form-layout input { width: 100%; margin-top: 5px; margin-bottom: 0; height: 38px; }

.filter-fields { row-gap: 22px; }
.trend-filter { max-width: 100%; margin: 26px auto 22px; }
.trend-filter select { width: auto; min-width: 190px; height: 42px; border: 1.5px solid #c7c7c7; border-radius: 10px; padding: 0 14px; background: #fff; color: #454545; font-size: 13px; }

#trend-view { min-height: 100vh; min-height: 100dvh; padding: max(42px, env(safe-area-inset-top)) clamp(22px, 5vw, 60px) max(118px, env(safe-area-inset-bottom)); position: relative; animation: page-enter .55s cubic-bezier(.2,.8,.2,1); overflow-x: hidden; max-width: 100%; }

.trend-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 100%; margin: 0 auto 18px; }
.trend-summary article { min-height: 100px; display: grid; align-content: center; gap: 6px; padding: 16px; border: 1.5px solid #d0d0d0; border-radius: 14px; }
.trend-summary span { color: #777; font-size: 13px; }
.trend-summary strong { font-size: 26px; }

.trend-map-section { max-width: 100%; margin: 0 auto 24px; padding: 16px; border: 1.5px solid #d0d0d0; border-radius: 14px; box-sizing: border-box; }
.trend-map-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.trend-map-header h3 { margin: 0; font-size: 13px; color: #333; }
.trend-map-legend { display: flex; gap: 14px; }
.trend-map-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #666; }
.trend-map-legend-item .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.trend-map-legend-item .dot-safe { background: #159447; }
.trend-map-legend-item .dot-over { background: #ce3535; }
.trend-map-legend-item .dot-user { background: #4285f4; }
.trend-map { width: 100%; height: 260px; border-radius: 10px; overflow: hidden; background: #eee; }
.trend-map-empty { text-align: center; font-size: 12px; color: #888; margin: 10px 0 0; }
.gps-status { font-size: 11px; color: #888; margin: 6px 0 0; min-height: 14px; }

.trend-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: 100%; margin: 0 auto 24px; }
.trend-metric-panel { min-height: 200px; box-sizing: border-box; padding: 16px; border: 1.5px solid #d0d0d0; border-radius: 14px; }
.trend-metric-panel h3 { margin: 0 0 14px; font-size: 13px; color: #333; }
.trend-plant-rows { display: flex; flex-direction: column; gap: 12px; }
.trend-plant-row { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #666; }
.trend-plant-label { width: 66px; flex-shrink: 0; line-height: 1.25; }
.trend-plant-bar-track { flex: 1; height: 16px; border-radius: 8px; background: #ececec; overflow: hidden; }
.trend-plant-bar-fill { display: block; height: 100%; border-radius: 8px; transition: width .3s ease; }
.trend-plant-bar-fill.safe { background: #159447; }
.trend-plant-bar-fill.unsafe { background: #ce3535; }
.trend-plant-bar-fill.neutral { background: #cfcfcf; }
.trend-plant-value { width: 54px; flex-shrink: 0; text-align: right; }

@media (max-width: 699px) { 
  input, select { font-size: 16px !important; } 
  .auth-form input { height: 46px; } 
  .measurement-form input, .measurement-form select, .history-filter select, .report-tools select { height: 46px; } 
  .filter-fields { grid-template-columns: 1fr; }
  .report-tools { display: grid; margin-top: 30px; }
  .print-button { height: 46px; }
  .report-summary { gap: 8px; }
  .report-summary article { min-height: 94px; padding: 12px; }
  .report-summary span { font-size: 11px; }
  .report-summary strong { font-size: 25px; }
  .trend-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .trend-summary article { min-height: 88px; padding: 12px; }
  .trend-summary span { font-size: 11px; }
  .trend-summary strong { font-size: 22px; }
  .trend-metric-empty { display: none; }
  .bottom-nav { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); width: min(calc(100% - 36px), 430px); } 
}

@media print { 
  body { background: #fff; } 
  .app-shell { width: 100%; box-shadow: none; } 
  .bottom-nav, .print-button, .toast { display: none !important; } 
  .report-view { padding: 20px; } 
  .report-tools { margin-top: 20px; } 
}

/* =====================================================
   KEYFRAMES
   ===================================================== */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.88); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes bar-grow {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
@keyframes pulse-success {
  0%   { box-shadow: 0 0 0 0 #08745b55; }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}
@keyframes counter-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes nav-bounce {
  0%,100% { transform: translateY(0); }
  40%     { transform: translateY(-5px); }
  60%     { transform: translateY(-2px); }
}
@keyframes brand-line-grow {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px) scale(.95); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes row-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =====================================================
   ANIMASI BRAND LINE
   ===================================================== */
.brand-line { animation: brand-line-grow .7s .2s both cubic-bezier(.2,.8,.2,1); }

/* =====================================================
   TRANSISI HALAMAN – lebih ekspresif
   ===================================================== */
.home-view, .measurement-view, .history-view, .report-view {
  animation: page-enter .5s cubic-bezier(.2,.8,.2,1);
}
#trend-view { animation: page-enter .5s cubic-bezier(.2,.8,.2,1); }

/* =====================================================
   MENU CARD – stagger + lift
   ===================================================== */
.menu-card {
  transition: transform .28s cubic-bezier(.2,.8,.2,1),
              border-color .28s, box-shadow .28s;
  animation: slide-up .5s both cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.menu-card:nth-child(1) { animation-delay: .05s; }
.menu-card:nth-child(2) { animation-delay: .13s; }
.menu-card:nth-child(3) { animation-delay: .21s; }
.menu-card:nth-child(4) { animation-delay: .29s; }
.menu-card:hover {
  border-color: var(--blue);
  box-shadow: 0 14px 30px #073a9b22;
  transform: translateY(-7px) scale(1.01);
}
.menu-card:active { transform: scale(.96); box-shadow: none; }

/* =====================================================
   KARTU RINGKASAN – pop-in berurutan
   ===================================================== */
.report-summary article,
.trend-summary article {
  animation: pop-in .45s both cubic-bezier(.2,.8,.2,1);
  transition: box-shadow .25s, transform .25s;
}
.report-summary article:nth-child(1), .trend-summary article:nth-child(1) { animation-delay: .06s; }
.report-summary article:nth-child(2), .trend-summary article:nth-child(2) { animation-delay: .13s; }
.report-summary article:nth-child(3), .trend-summary article:nth-child(3) { animation-delay: .20s; }
.trend-summary article:nth-child(4) { animation-delay: .27s; }
.report-summary article:hover, .trend-summary article:hover {
  box-shadow: 0 8px 24px #0001;
  transform: translateY(-3px);
}

/* =====================================================
   INFO CARD & FORM CARD – slide-up berurutan
   ===================================================== */
.info-card, .form-card {
  animation: slide-up .5s both cubic-bezier(.2,.8,.2,1);
}
.info-card:nth-of-type(1), .form-card:nth-of-type(1) { animation-delay: .08s; }
.info-card:nth-of-type(2), .form-card:nth-of-type(2) { animation-delay: .16s; }
.info-card:nth-of-type(3), .form-card:nth-of-type(3) { animation-delay: .24s; }
.info-card:nth-of-type(4), .form-card:nth-of-type(4) { animation-delay: .32s; }

/* =====================================================
   PANEL TREN & HRA – fade+lift berurutan
   ===================================================== */
.trend-metric-panel {
  animation: slide-up .5s both cubic-bezier(.2,.8,.2,1);
  transition: box-shadow .25s, transform .25s;
}
.trend-metric-panel:nth-child(1) { animation-delay: .08s; }
.trend-metric-panel:nth-child(2) { animation-delay: .16s; }
.trend-metric-panel:nth-child(3) { animation-delay: .24s; }
.trend-metric-panel:nth-child(4) { animation-delay: .32s; }
.trend-metric-panel:hover {
  box-shadow: 0 8px 22px #0001;
  transform: translateY(-3px);
}

.hra-grid > * {
  animation: slide-up .48s both cubic-bezier(.2,.8,.2,1);
}
.hra-grid > *:nth-child(1) { animation-delay: .10s; }
.hra-grid > *:nth-child(2) { animation-delay: .18s; }
.hra-grid > *:nth-child(3) { animation-delay: .26s; }

/* =====================================================
   BAR TREN & HRA – tumbuh dari kiri
   ===================================================== */
.trend-plant-bar-fill {
  animation: bar-grow .6s both cubic-bezier(.2,.8,.2,1);
}
.trend-plant-row:nth-child(1) .trend-plant-bar-fill { animation-delay: .15s; }
.trend-plant-row:nth-child(2) .trend-plant-bar-fill { animation-delay: .22s; }
.trend-plant-row:nth-child(3) .trend-plant-bar-fill { animation-delay: .29s; }
.trend-plant-row:nth-child(4) .trend-plant-bar-fill { animation-delay: .36s; }
.trend-plant-row:nth-child(5) .trend-plant-bar-fill { animation-delay: .43s; }

.hra-risk-bar-fill {
  animation: bar-grow .7s both cubic-bezier(.2,.8,.2,1);
}

/* =====================================================
   TABEL – baris muncul berurutan
   ===================================================== */
tbody tr {
  animation: row-in .35s both ease;
}
tbody tr:nth-child(1)  { animation-delay: .04s; }
tbody tr:nth-child(2)  { animation-delay: .08s; }
tbody tr:nth-child(3)  { animation-delay: .12s; }
tbody tr:nth-child(4)  { animation-delay: .16s; }
tbody tr:nth-child(5)  { animation-delay: .20s; }
tbody tr:nth-child(6)  { animation-delay: .24s; }
tbody tr:nth-child(7)  { animation-delay: .28s; }
tbody tr:nth-child(8)  { animation-delay: .32s; }
tbody tr:nth-child(9)  { animation-delay: .36s; }
tbody tr:nth-child(10) { animation-delay: .40s; }

/* =====================================================
   INPUT FOCUS – glow effect
   ===================================================== */
input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #073a9b22;
  transition: box-shadow .2s, border-color .2s;
}
.measurement-form input:focus, .measurement-form select:focus {
  box-shadow: 0 0 0 3px #073a9b1a;
}

/* =====================================================
   FORM VALIDATION – shake + success pulse
   ===================================================== */
.input-shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; }
.submit-pulse { animation: pulse-success .5s ease; }

/* =====================================================
   TOMBOL – ripple container
   ===================================================== */
.primary-button, .submit-measurement, .print-button, .page-btn, .delete-btn {
  position: relative;
  overflow: hidden;
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  width: 10px; height: 10px;
  pointer-events: none;
  transform: scale(0);
  animation: ripple .55s linear;
}

/* =====================================================
   NAVIGASI – active pill & icon bounce
   ===================================================== */
.nav-item {
  transition: transform .22s cubic-bezier(.2,.8,.2,1),
              background .2s, color .2s;
}
.nav-item.active {
  background: linear-gradient(135deg, #2a2a2a, #444);
  color: #fff;
  box-shadow: 0 4px 12px #0003;
}
.nav-item.nav-bounce .icon { animation: nav-bounce .4s cubic-bezier(.2,.8,.2,1); }

/* =====================================================
   TOAST
   ===================================================== */
.toast.is-visible {
  animation: toast-in .3s cubic-bezier(.2,.8,.2,1) forwards;
}

/* =====================================================
   RANKINGS PANEL
   ===================================================== */
.rankings-panel {
  animation: slide-up .5s both cubic-bezier(.2,.8,.2,1);
  transition: box-shadow .25s, transform .25s;
}
.rankings-panel:nth-child(1) { animation-delay: .10s; }
.rankings-panel:nth-child(2) { animation-delay: .20s; }
.rankings-panel:hover { box-shadow: 0 8px 22px #0001; transform: translateY(-3px); }
.rankings-table tr { animation: row-in .3s both ease; }
.rankings-table tr:nth-child(1) { animation-delay: .05s; }
.rankings-table tr:nth-child(2) { animation-delay: .10s; }
.rankings-table tr:nth-child(3) { animation-delay: .15s; }
.rankings-table tr:nth-child(4) { animation-delay: .20s; }
.rankings-table tr:nth-child(5) { animation-delay: .25s; }

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (min-width: 700px) { 
  .app-shell { min-height: 720px; box-shadow: none; }
  .auth-view { min-height: 720px; }
  .home-view { min-height: 720px; }
  .auth-card { width: 380px; }
  .menu-card { min-height: 180px; } 
}

/* ========================================================= */
/* PENINGKATAN FITUR ANALISIS TREN (COMPARISON, HRA, RANKINGS) */
/* ========================================================= */
.trend-comp-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; padding: 2px 6px; border-radius: 6px; font-weight: bold; margin-top: 4px; }
.trend-comp-badge.up { background: #fee2e2; color: #ef4444; }
.trend-comp-badge.down { background: #dcfce7; color: #159447; }
.trend-comp-badge.equal { background: #f3f4f6; color: #6b7280; }

.trend-plant-row-comp { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.02); border: 1px solid rgba(0, 0, 0, 0.04); margin-bottom: 4px; }
.trend-plant-row-comp-bar { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.trend-plant-row-comp-year { font-weight: bold; font-size: 10px; color: #777; width: 42px; flex-shrink: 0; }

.hra-section { margin-top: 24px; }
.hra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 14px; }
.hra-risk-bar-track { display: flex; height: 18px; border-radius: 9px; background: #e5e7eb; overflow: hidden; margin: 12px 0 6px; }
.hra-risk-bar-fill { height: 100%; transition: width .3s ease; }
.hra-risk-bar-fill.very-low { background: #10b981; }
.hra-risk-bar-fill.low { background: #3b82f6; }
.hra-risk-bar-fill.medium { background: #f59e0b; }
.hra-risk-bar-fill.high { background: #ef4444; }
.hra-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; margin-top: 8px; color: #555; }
.hra-legend-item { display: flex; align-items: center; gap: 4px; }
.hra-legend-color { width: 10px; height: 10px; border-radius: 50%; }

.rankings-section { margin-top: 28px; }
.rankings-filter { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.rankings-filter label { font-size: 13px; font-weight: bold; color: #555; }
.rankings-filter select { height: 38px; border-radius: 8px; border: 1.5px solid #c7c7c7; padding: 0 12px; background: #fff; font-size: 13px; color: #333; }
.rankings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rankings-panel { border: 1.5px solid #d0d0d0; border-radius: 14px; padding: 16px; background: #fff; overflow-x: auto; }
.rankings-panel h3 { font-size: 14px; color: #333; margin: 0 0 12px; border-bottom: 1.5px solid #eee; padding-bottom: 8px; display: flex; justify-content: space-between; }
.rankings-table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; table-layout: fixed; }
.rankings-table th, .rankings-table td { padding: 6px 6px; border-bottom: 1px solid #e5e7eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rankings-table th { background: #f9fafb; font-weight: bold; color: #4b5563; }
.rankings-table tr:hover { background: #f9fafb; }
.rankings-table td span.badge { padding: 2px 5px; border-radius: 4px; font-weight: bold; font-size: 9px; text-transform: uppercase; }
.rankings-table td span.badge.aman { background: #d1fae5; color: #065f46; }
.rankings-table td span.badge.bahaya { background: #fee2e2; color: #991b1b; }

@media (max-width: 820px) {
  .rankings-grid { grid-template-columns: 1fr; }
}