/* MarineZen Pvt. Ltd. — Commercial Vertical Crab Farming OS Stylesheet */
:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-alt: #f0f6fa;
  --sidebar: #071928;
  --sidebar-hover: #102e46;
  --line: #dce7ef;
  --txt: #132c3e;
  --muted: #5c7688;
  --primary: #1a7bb9;
  --accent: #27b19e;
  --green: #14845a;
  --green-bg: #e3f6ee;
  --amber: #a86411;
  --amber-bg: #fff2dc;
  --red: #c43c4b;
  --red-bg: #fde8eb;
  --blue-bg: #e8f3fc;
  --shadow: 0 6px 24px rgba(13, 44, 62, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.side {
  background: var(--sidebar);
  color: #e6f3fa;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #13324b;
}

.brand-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.brand-box img {
  max-width: 100%;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7cc5d8;
  text-align: center;
  margin-bottom: 18px;
  font-weight: 700;
}

.nav small {
  display: block;
  color: #6b8ea6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  margin: 18px 10px 6px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #b5cedd;
  padding: 11px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.18s ease;
  margin-bottom: 3px;
}

.nav button:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav button.active {
  background: linear-gradient(110deg, #1a7bb9, #25a79c);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 123, 185, 0.35);
}

.side-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #153752;
  font-size: 11px;
  color: #7d9eb4;
  line-height: 1.5;
}

/* Main Content */
main {
  padding: 24px 30px;
  max-width: 1580px;
  width: 100%;
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo-pill {
  display: flex;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.header-logo-pill img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 800;
  text-transform: uppercase;
}

.top h1 {
  margin: 2px 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--txt);
}

.muted { color: var(--muted); font-size: 12px; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: #26485e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 132, 90, 0.2);
}

.btn {
  background: linear-gradient(110deg, #1a7bb9, #24a49a);
  border: 0;
  color: #ffffff;
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 10px rgba(26, 123, 185, 0.25);
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(26, 123, 185, 0.35); }

.btn2 {
  background: var(--surface-alt);
  border: 1px solid #cde0ec;
  color: #1f4f6b;
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn2:hover { background: #e1eff6; }

/* Grid & Cards */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; }
.two { grid-template-columns: 1.25fr 1fr; margin-bottom: 18px; }
.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--txt);
}

.tag {
  border: 1px solid #cde0ec;
  background: var(--surface-alt);
  color: #235573;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.tag.green { background: var(--green-bg); color: var(--green); border-color: #bce8d5; }
.tag.amber { background: var(--amber-bg); color: var(--amber); border-color: #f3d9ad; }

.kpi label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 28px; margin: 6px 0 4px; color: var(--txt); letter-spacing: -0.5px; }
.kpi em { font-style: normal; color: var(--green); font-size: 11px; font-weight: 600; }

/* Water Sensors */
.water { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sensor {
  background: #f8fbfd;
  border: 1px solid #e1ecf2;
  border-radius: 11px;
  padding: 12px;
}
.sensor small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.sensor b { display: block; font-size: 22px; margin: 4px 0; color: var(--txt); }
.bar { height: 6px; background: #e3edf3; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }

/* Camera / Digital Twin */
.camera {
  height: 235px;
  background: radial-gradient(circle at top right, #164866, #071928);
  border: 1px solid #245773;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #eaf6fb;
}

.rack { width: 82%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.crate {
  height: 34px;
  border: 1px solid #2a87b5;
  background: rgba(11, 86, 130, 0.85);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.crate:hover { border-color: #7ce8ff; transform: scale(1.04); }
.crate.focus { outline: 2px solid #42d39a; background: #13674f; }
.crate.alert { border-color: #ffbf5b; background: #6b4714; }

.beam {
  position: absolute;
  top: 0; bottom: 0; left: 15%;
  width: 2px;
  background: #39c5df;
  box-shadow: 0 0 18px 4px rgba(57, 197, 223, 0.6);
  animation: move 4.5s infinite alternate ease-in-out;
}
@keyframes move { to { left: 85%; } }

.camtop {
  position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: #b7f1fa;
}

.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th {
  text-align: left;
  color: #567183;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  background: #f9fcfe;
}
td { padding: 11px 10px; border-bottom: 1px solid #edf3f7; font-size: 12.5px; color: #223f52; }
tr:hover td { background: #f6fafd; }

.status {
  display: inline-block;
  background: var(--green-bg);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.status.warn { background: var(--amber-bg); color: var(--amber); }
.status.blue { background: var(--blue-bg); color: var(--primary); }
.status.red { background: var(--red-bg); color: var(--red); }

/* Sections & Forms */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field label { display: block; color: #476375; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #ffffff;
  color: var(--txt);
  border: 1px solid #c9dce7;
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 123, 185, 0.12); }

.note {
  background: #f0f8fc;
  border: 1px solid #c7e3f2;
  color: #1c4e6b;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12px;
  margin: 12px 0;
}

/* Charts */
.chart {
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 6px 0;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}
.chart-lbl { font-size: 10px; color: var(--muted); margin-top: 6px; }

/* Interactive Heatmap Grid */
.heatmap {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  margin-top: 10px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: #14845a;
  cursor: pointer;
  transition: transform 0.1s;
}
.hm-cell:hover { transform: scale(1.3); z-index: 2; }
.hm-cell.empty { background: #dce7ef; }
.hm-cell.molt { background: #1a7bb9; }
.hm-cell.warn { background: #e89b2d; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 25, 40, 0.55);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal.show { display: flex; }
.modalbox {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 16px;
  width: min(560px, 100%);
  box-shadow: 0 20px 50px rgba(7, 25, 40, 0.25);
}

.footer { font-size: 11px; color: var(--muted); margin-top: 18px; text-align: center; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .two, .three { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .layout { display: block; }
  .side { padding: 14px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav button { white-space: nowrap; width: auto; }
  .nav small, .side-footer { display: none; }
  main { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .form { grid-template-columns: 1fr; }
  .water { grid-template-columns: repeat(2, 1fr); }
  .top { flex-direction: column; align-items: flex-start; }
  .heatmap { grid-template-columns: repeat(16, 1fr); }
}
