/* =========================================================
   CATATAN BUDIDAYA IKAN - Stylesheet
   Desain sederhana, bersih, cocok untuk usaha kecil.
   ========================================================= */

:root {
  --primary: #0e7c66;
  --primary-dark: #0a5f4e;
  --primary-light: #e6f4f1;
  --danger: #c0392b;
  --danger-light: #fbeae8;
  --warning: #b9770e;
  --text: #2b2b2b;
  --text-muted: #6b7280;
  --border: #e2e5e9;
  --bg: #f5f7f8;
  --white: #ffffff;
  --sidebar-width: 230px;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }

.app-wrapper { min-height: 100vh; }

/* ---------- Topbar ---------- */
.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}
.topbar-title { font-weight: 700; color: var(--primary-dark); flex: 1; }
.topbar-user { color: var(--text-muted); font-size: 14px; }

/* ---------- Layout ---------- */
.app-body {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-menu { list-style: none; margin: 0; padding: 12px 0; }
.nav-menu li a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  font-size: 15px;
  border-left: 3px solid transparent;
}
.nav-menu li a:hover { background: var(--primary-light); }
.nav-menu li a.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-divider { height: 1px; background: var(--border); margin: 10px 16px; }

.content { flex: 1; padding: 22px; max-width: 100%; overflow-x: hidden; }

.overlay { display: none; }

/* ---------- Content header ---------- */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.content-header h1 { font-size: 20px; margin: 0; }

/* ---------- Cards / Dashboard ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.group-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card .card-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.card .card-value { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.card.negative .card-value { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--white);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f0f1f2; }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 640px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.helper-text { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c0; }
.alert-success { background: #e6f7ee; color: #1c7c4c; border: 1px solid #bfe8d1; }

/* ---------- Filter form ---------- */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
}
.filter-form select,
.filter-form input[type="text"],
.filter-form input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

/* ---------- Tables ---------- */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tfoot td {
  padding: 12px 14px;
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: var(--primary-light);
}
td.empty { text-align: center; color: var(--text-muted); padding: 24px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-berjalan { background: #fff4d6; color: var(--warning); }
.badge-panen { background: #dbeafe; color: #1e4fa3; }
.badge-selesai { background: #e6f7ee; color: #1c7c4c; }

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
  padding: 20px;
}
.login-box {
  background: var(--white);
  padding: 32px 28px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
}
.login-box h1 { font-size: 20px; text-align: center; margin: 0 0 4px; color: var(--primary-dark); }
.login-box .subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- Report summary rows ---------- */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.summary-row:last-child { border-bottom: none; font-weight: 700; font-size: 17px; }
.summary-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  max-width: 480px;
  margin-bottom: 20px;
}

/* ---------- Laporan menu ---------- */
.laporan-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.laporan-menu a {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-weight: 600;
  color: var(--primary-dark);
}
.laporan-menu a:hover { border-color: var(--primary); background: var(--primary-light); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hamburger { display: block; }
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 30;
    box-shadow: 2px 0 10px rgba(0,0,0,.08);
  }
  .sidebar.open { transform: translateX(0); }
  .overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 25;
  }
  .overlay.show { display: block; }
  .content { padding: 16px; }
}
