/* ==========================================================================
   AGRIVAKT — Light Theme Design System
   Merriweather 900 headlines + Source Sans 3 body
   No dark backgrounds in the app.
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg:        #FFFFFF;
  --surface:   #F4F6F1;
  --green:     #2D5A27;
  --green-dk:  #234820;
  --green-lt:  #e8f0e6;
  --amber:     #C4892A;
  --amber-lt:  #fdf3e3;
  --amber-dk:  #8a5e1a;
  --red:       #C0392B;
  --red-lt:    #fdecea;
  --text:      #1A1A1A;
  --muted:     #555555;
  --border:    #E2E2DC;

  --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --sans:  'Source Sans 3', system-ui, -apple-system, sans-serif;
  --mono:  'Courier New', Courier, monospace;

  --radius-sm:   4px;
  --radius-pill: 100px;

  --nav-height:  60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --------------------------------------------------------------------------
   Reset + Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  overscroll-behavior: none;
}

a { color: var(--green); text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input,
textarea,
select {
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  width: 100%;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.headline {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.headline--lg { font-size: 2rem; }
.headline--sm { font-size: 1.2rem; }

/* All numbers and data */
.data {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.text-muted { color: var(--muted); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Views — full-screen panels
   -------------------------------------------------------------------------- */
.view {
  display: none;
  width: 100%;
  min-height: 100dvh;
  padding: 24px 20px 0;
}

.view.active {
  display: block;
}

/* --------------------------------------------------------------------------
   Task Cards — white bg, green left border
   -------------------------------------------------------------------------- */
.task-card {
  width: 100%;
  min-height: 80px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  transition: background 0.1s ease, border-color 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.task-card:active {
  background: var(--surface);
  border-left-color: var(--amber);
}

.task-card__title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Skill Tag
   -------------------------------------------------------------------------- */
.skill-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Status Badges
   -------------------------------------------------------------------------- */
.status-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}

.status-badge--active {
  background: var(--green-lt);
  color: var(--green);
}

.status-badge--pending {
  background: var(--amber-lt);
  color: var(--amber-dk);
}

.status-badge--not-started,
.status-badge--completed {
  background: #f0f0ed;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Hour Gauge
   -------------------------------------------------------------------------- */
.hour-gauge-wrapper {
  width: 100%;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.hour-gauge-bar {
  width: 100%;
  height: 12px;
  background: var(--border);        /* light grey track */
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 10px;
}

.hour-gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease, background-color 0.4s ease;
}

.hour-gauge-fill--green { background-color: var(--green); }
.hour-gauge-fill--amber { background-color: var(--amber); }
.hour-gauge-fill--red   { background-color: var(--red);   }

.gauge-text {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.gauge-remaining {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Warning Banners
   -------------------------------------------------------------------------- */
.warning-banner {
  display: none;
  width: 100%;
  background: var(--amber);
  color: #3d2600;
  text-align: center;
  padding: 16px 20px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
}

.warning-banner.visible { display: block; }

.hard-stop-banner {
  display: none;
  width: 100%;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 20px;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
}

.hard-stop-banner.visible { display: block; }

/* --------------------------------------------------------------------------
   Buttons — all min-height 64px
   -------------------------------------------------------------------------- */
.btn-primary {
  display: block;
  width: 100%;
  min-height: 64px;
  background: var(--green);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary:active   { background: var(--green-dk); }
.btn-primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; opacity: 0.7; }

.btn-clockin {
  display: block;
  width: 100%;
  height: 72px;
  background: var(--green);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-clockin:active   { background: var(--green-dk); }
.btn-clockin:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; opacity: 0.7; }

.btn-clockout {
  display: block;
  width: 100%;
  height: 72px;
  background: var(--amber);
  color: #3d2600;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-clockout:active { background: #a06f1a; }

.btn-deviation {
  display: block;
  width: 100%;
  height: 56px;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-deviation:active { background: #9b2e22; }

.btn-secondary {
  display: block;
  min-height: 56px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0 20px;
  transition: border-color 0.1s ease, color 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-secondary:active { border-color: var(--muted); color: var(--text); }

/* --------------------------------------------------------------------------
   Running Timer Display
   -------------------------------------------------------------------------- */
.timer-display {
  font-family: var(--mono);
  font-size: 3rem;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  text-align: center;
  letter-spacing: 0.04em;
  padding: 32px 0;
}

/* --------------------------------------------------------------------------
   Bottom Navigation — white, light border
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--nav-height) + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--nav-height);
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
  padding: 0;
}

.bottom-nav-item.active { color: var(--green); }
.bottom-nav-item:active { color: var(--text); }

.bottom-nav-item__icon  { font-size: 1.1rem; line-height: 1; }
.bottom-nav-item__label { line-height: 1; }

/* --------------------------------------------------------------------------
   Login Screen — clean white centered form
   -------------------------------------------------------------------------- */
.login-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-logo {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 4px;
}

.login-subtitle {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-error {
  display: none;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--red);
  padding: 12px 16px;
  border: 1px solid #f5c9c4;
  border-radius: var(--radius-sm);
  background: var(--red-lt);
}

.login-error.visible { display: block; }

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Section Header
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Admin Table
   -------------------------------------------------------------------------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.admin-table th {
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px 12px;
  color: var(--text);
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:nth-child(odd)  td { background: var(--surface); }
.admin-table tbody tr:nth-child(even) td { background: var(--bg); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* --------------------------------------------------------------------------
   Admin Tabs
   -------------------------------------------------------------------------- */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

.admin-tab {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 14px 18px;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.1s ease, border-color 0.1s ease;
}

.admin-tab.active { color: var(--text); border-bottom-color: var(--green); }
.admin-tab:hover  { color: var(--text); }

.admin-panel        { display: none; }
.admin-panel.active { display: block; }

/* --------------------------------------------------------------------------
   Approve Button
   -------------------------------------------------------------------------- */
.btn-approve {
  min-height: 44px;
  padding: 0 20px;
  background: var(--green);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.btn-approve:active { background: var(--green-dk); }
.btn-approve.approved {
  background: var(--surface);
  color: var(--muted);
  cursor: default;
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Admin Password Gate
   -------------------------------------------------------------------------- */
.gate-wrap {
  max-width: 400px;
  margin: 80px auto 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gate-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
}

.gate-error        { display: none; font-family: var(--sans); font-size: 0.85rem; color: var(--red); }
.gate-error.visible { display: block; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px;    }
.mt-24 { margin-top: 24px;    }

.text-center { text-align: center; }
.text-right  { text-align: right;  }
.full-width  { width: 100%;        }
.hidden      { display: none !important; }
