/* ── GeoCelsius — Geonamics Brand UI ─────────────────────────────── */

:root {
  --orange: #E8610A;
  --orange-light: #F47B2A;
  --orange-dark: #C4520A;
  --grey-dark: #666666;
  --grey-mid: #555555;
  --grey-light: #F5F5F5;
  --grey-border: #DEDEDE;
  --white: #FFFFFF;
  --danger: #D32F2F;
  --success: #2E7D32;
  --font: 'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--grey-light);
  color: var(--grey-dark);
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────── */
header {
  background: var(--grey-dark);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

header h1 {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
}

header h1 span {
  color: var(--orange);
}

nav a {
  color: #CCCCCC;
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.9em;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--orange);
}

/* ── Main content ─────────────────────────────────────────────────── */
main {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}

h2 {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--grey-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--orange);
  display: inline-block;
}

h3 {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--grey-mid);
  margin: 20px 0 10px 0;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

/* ── Forms ────────────────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="datetime-local"],
select {
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.95em;
  font-family: var(--font);
  color: var(--grey-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus {
  border-color: var(--orange);
}

label {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--grey-mid);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
button,
.btn {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.btn:hover {
  background: var(--orange-dark);
}

.btn-secondary {
  background: var(--grey-mid);
}

.btn-secondary:hover {
  background: var(--grey-dark);
}

/* ── Tables ───────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

thead {
  background: var(--grey-dark);
  color: var(--white);
}

thead th {
  padding: 12px 16px;
  font-size: 0.85em;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.5px;
}

tbody tr {
  border-bottom: 1px solid var(--grey-border);
  transition: background 0.15s;
}

tbody tr:hover {
  background: #FFF5EE;
}

tbody td {
  padding: 11px 16px;
  font-size: 0.9em;
}

tbody tr:last-child {
  border-bottom: none;
}

/* ── Links ────────────────────────────────────────────────────────── */
a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--orange-dark);
  text-decoration: underline;
}

/* ── Login page ───────────────────────────────────────────────────── */
.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  background: var(--white);
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  text-align: center;
}

.login-wrap h2 {
  border: none;
  margin-bottom: 24px;
  font-size: 1.8em;
  display: block;
}

.login-wrap .logo-text {
  font-size: 2em;
  font-weight: 800;
  color: var(--grey-dark);
  margin-bottom: 6px;
}

.login-wrap .logo-text span {
  color: var(--orange);
}

.login-wrap .subtitle {
  color: var(--grey-mid);
  font-size: 0.85em;
  margin-bottom: 28px;
}

.login-wrap input {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.login-wrap button {
  width: 100%;
  padding: 11px;
  font-size: 1em;
}

.error-msg {
  color: var(--danger);
  font-size: 0.88em;
  margin-bottom: 12px;
}

/* ── Stat cards (dashboard) ───────────────────────────────────────── */
.stat-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: 8px;
  padding: 18px 20px;
  min-width: 210px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-top: 4px solid var(--orange);
}

.stat-card .sensor-name {
  font-weight: 700;
  font-size: 1em;
  margin-bottom: 6px;
  color: var(--grey-dark);
}

.stat-card .current-temp {
  font-size: 2.2em;
  font-weight: 800;
  color: var(--orange);
  line-height: 1.1;
}

.stat-card .last-time {
  font-size: 0.78em;
  color: #999;
  margin-bottom: 10px;
}

.stat-card .stats-row {
  display: flex;
  gap: 10px;
  font-size: 0.82em;
  color: var(--grey-mid);
  border-top: 1px solid var(--grey-border);
  padding-top: 8px;
  margin-top: 6px;
}

.stat-card .stats-row span {
  flex: 1;
  text-align: center;
}

.stat-card .stats-row strong {
  display: block;
  font-size: 1.1em;
  color: var(--grey-dark);
}

/* ── Alert banners ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.95em;
}

.alert-danger {
  background: #FDECEA;
  border: 2px solid var(--danger);
  color: var(--danger);
}

.alert-success {
  background: #EAF7EA;
  border: 2px solid var(--success);
  color: var(--success);
}

/* ── Filter form ──────────────────────────────────────────────────── */
.filter-form {
  background: var(--white);
  border-radius: 8px;
  padding: 18px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.filter-form p {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--grey-dark);
  font-size: 0.9em;
}

.filter-form label {
  margin-right: 16px;
  font-size: 0.88em;
}

/* ── Page title bar ───────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Misc ─────────────────────────────────────────────────────────── */
p {
  line-height: 1.6;
  margin-bottom: 10px;
}

.hint {
  color: #999;
  font-size: 0.82em;
  margin-top: 6px;
}

canvas {
  background: var(--white);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}
