@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #16a34a;
  --primary-dark: #166534;
  --primary-light: #dcfce7;
  --primary-glow: rgba(22,163,74,0.18);
  --bg: #f0f4f1;
  --text: #1a2332;
  --muted: #6b7280;
  --border: #e2e8f0;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 6px 24px rgba(22,163,74,0.14);
  --radius: 18px;
  --font: 'Google Sans','Nunito','Segoe UI',sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Hero top section */
.login-hero {
  background:
    linear-gradient(160deg, rgba(10,61,20,0.82) 0%, rgba(22,163,74,0.70) 60%, rgba(5,150,105,0.65) 100%),
    url('https://images.unsplash.com/photo-1500595046743-cd271d694d30?w=1200&q=90&auto=format&fit=crop&crop=center') center/cover no-repeat;
  padding: 56px 32px 48px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-blob {
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  top: -80px; right: -60px;
}
.hero-blob2 {
  width: 180px; height: 180px;
  bottom: -60px; left: -40px;
  top: auto; right: auto;
  background: rgba(255,255,255,0.05);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  margin-bottom: 32px;
}

.hero-icon {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

.hero-content h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero-content p {
  font-size: 15px;
  opacity: 0.85;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
}

.hstat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hstat strong {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.hstat span {
  font-size: 11px;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
}

.hstat-div {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.25);
}

/* Login sheet */
.login-sheet {
  flex: 1;
  background: var(--white);
  border-radius: 28px 28px 0 0;
  margin-top: -20px;
  padding: 28px 24px 40px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  position: relative;
  z-index: 2;
}

.sheet-handle {
  width: 40px; height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  margin: 0 auto 24px;
}

.login-sheet h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.sheet-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-group i.fa {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.input-group .toggle-pass {
  left: auto;
  right: 16px;
  pointer-events: all;
  cursor: pointer;
}

.input-group input {
  width: 100%;
  padding: 16px 48px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: #f8fafb;
  outline: none;
  transition: all 0.2s;
}

.input-group input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.login-btn {
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #15803d);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(22,163,74,0.35);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.login-btn:active {
  transform: scale(0.98);
  box-shadow: 0 3px 10px rgba(22,163,74,0.25);
}

#loginMsg {
  text-align: center;
  margin-top: 14px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
}

/* ══════════════════════════════════════
   DASHBOARD
══════════════════════════════════════ */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Sticky header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  border-bottom: 2px solid var(--primary-light);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo { font-size: 30px; line-height: 1; }

.header-left h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.header-left span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  display: block;
}

.logout-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(239,68,68,0.28);
  transition: all 0.2s;
  white-space: nowrap;
}

.logout-btn:active { transform: scale(0.97); }

/* Scrollable content */
.content {
  flex: 1;
  padding: 18px 16px 0;
  overflow-y: auto;
}

/* Section labels */
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 20px 0 10px 2px;
  letter-spacing: 0.02em;
}

/* Form rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

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

/* Field cards */
.field-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
  width: 100%;
}

.field-card.full {
  display: flex;
  width: 100%;
}

.field-card:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.field-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.field-body {
  flex: 1;
  min-width: 0;
}

.field-body label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}

.field-body input,
.field-body select {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.field-body input[readonly] {
  color: var(--muted);
}

.field-body input::placeholder {
  color: #cbd5e1;
  font-weight: 400;
}

/* Result bar */
.result-bar {
  background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  margin: 8px 0 0;
  box-shadow: 0 8px 28px rgba(22,163,74,0.32);
}

.result-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.result-label {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.result-val {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.result-val.big {
  font-size: 28px;
  color: #bbf7d0;
}

.result-sep {
  width: 1px;
  height: 44px;
  background: rgba(255,255,255,0.22);
  margin: 0 20px;
  flex-shrink: 0;
}

#saveMsg {
  margin-top: 14px;
  text-align: center;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 10px;
  background: var(--primary-light);
  border-radius: 10px;
  display: none;
}

#saveMsg.show { display: block; }

/* ── Sticky bottom action bar ── */
.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: var(--white);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.09);
  border-top: 1px solid var(--border);
}

.btn-save, .btn-clear {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-save {
  background: linear-gradient(135deg, var(--primary), #15803d);
  color: #fff;
  box-shadow: 0 4px 16px rgba(22,163,74,0.32);
  flex: 2;
}

.btn-save:active { transform: scale(0.97); }

.btn-clear {
  background: #f3f4f6;
  color: #374151;
  border: 1.5px solid var(--border);
  flex: 1;
}

.btn-clear:active { transform: scale(0.97); }

/* ══════════════════════════════════════
   DESKTOP — split screen login
══════════════════════════════════════ */
@media (min-width: 768px) {
  /* Login — side by side */
  .login-container {
    flex-direction: row;
  }

  .login-hero {
    flex: 1.1;
    padding: 64px 56px;
    border-radius: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
      linear-gradient(160deg, rgba(10,61,20,0.80) 0%, rgba(22,163,74,0.68) 60%, rgba(5,150,105,0.62) 100%),
      url('https://images.unsplash.com/photo-1500595046743-cd271d694d30?w=1600&q=90&auto=format&fit=crop&crop=center') center/cover no-repeat;
  }

  .hero-content { margin-bottom: 40px; }
  .hero-content h1 { font-size: 40px; }
  .hero-content p { font-size: 17px; }
  .hero-icon { font-size: 60px; }

  .hero-stats {
    max-width: 380px;
    padding: 18px 28px;
  }

  .hstat strong { font-size: 24px; }
  .hstat span { font-size: 12px; }

  .login-sheet {
    flex: 0.9;
    border-radius: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    box-shadow: none;
    max-width: 480px;
  }

  .sheet-handle { display: none; }

  .login-sheet h2 { font-size: 30px; margin-bottom: 6px; }
  .sheet-sub { font-size: 15px; margin-bottom: 32px; }

  /* Dashboard — wider layout */
  .dashboard { max-width: 900px; margin: 0 auto; width: 100%; }

  header {
    border-radius: 18px;
    margin: 20px 20px 0;
    padding: 16px 24px;
    position: relative;
    top: auto;
  }

  .content { padding: 20px 20px 0; }

  .form-row { gap: 16px; }
  .form-row.three { grid-template-columns: 1fr 1fr 1fr; }

  .field-card { padding: 16px 20px; gap: 14px; margin-bottom: 14px; }
  .field-icon { width: 46px; height: 46px; font-size: 18px; }
  .field-body label { font-size: 11px; }
  .field-body input, .field-body select { font-size: 16px; }

  .result-bar { padding: 24px 32px; margin: 10px 0 0; }
  .result-val { font-size: 26px; }
  .result-val.big { font-size: 32px; }
  .result-sep { height: 50px; margin: 0 28px; }

  .bottom-bar {
    position: relative;
    border-radius: 16px;
    margin: 16px 20px 32px;
    box-shadow: var(--shadow-md);
    border: none;
  }

  .btn-save, .btn-clear { padding: 16px; font-size: 16px; }
}

@media (min-width: 1024px) {
  .login-sheet { max-width: 520px; }
  .dashboard { max-width: 1100px; }
}
