/* ============================================================ */
/*  TEMPLE BEE — Premium Amber Dashboard                       */
/* ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ============================================================ */
/*  DESIGN TOKENS                                               */
/* ============================================================ */

:root {
  --hive-void:      #1a0c02;
  --hive-obsidian:  #241006;
  --hive-espresso:  #3b1a08;
  --hive-bark:      #6b310f;
  --hive-sienna:    #9e4c18;
  --hive-terra:     #c76522;
  --hive-flame:     #e0872e;

  --gold-antique:   #9a7410;
  --gold-rich:      #c89a18;
  --gold-pure:      #ddb830;
  --gold-bright:    #f0d060;
  --gold-pale:      #fae99a;

  --surface-bg:     #faf3e8;
  --surface-warm:   #f2e4cc;
  --surface-card:   #fffaf2;

  --ink-deep:       #1e0d04;
  --ink-mid:        #5c3010;
  --ink-soft:       #9a6030;
  --ink-muted:      #c4904a;
  --ink-light:      #fef8ec;
  --ink-pale:       #ffe8b8;

  --ok:             #3daa68;
  --glow-gold:      rgba(221, 184, 48, 0.28);
  --glow-amber:     rgba(199, 101, 34, 0.22);
  --shadow-deep:    rgba(26, 12, 2, 0.45);
  --shadow-mid:     rgba(26, 12, 2, 0.20);

  --font-display:   'Playfair Display', Georgia, serif;
  --font-ui:        'DM Sans', sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --ease: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================ */
/*  RESET & BASE                                                */
/* ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-display);
  background-color: var(--surface-bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 0% 0%,    rgba(199,101,34,0.07) 0%, transparent 100%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(221,184,48,0.09) 0%, transparent 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 2 L54 16 L54 44 L28 58 L2 44 L2 16 Z' fill='none' stroke='%23c7651614' stroke-width='1.2'/%3E%3Cpath d='M28 52 L54 66 L54 94 L28 108 L2 94 L2 66 Z' fill='none' stroke='%23c7651614' stroke-width='1.2'/%3E%3C/svg%3E");
  color: var(--ink-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface-warm); }
::-webkit-scrollbar-thumb { background: var(--hive-bark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--hive-terra); }

/* ============================================================ */
/*  HEADER                                                      */
/* ============================================================ */

.main-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 68px;
  background-image: linear-gradient(160deg, #723006, #8d482a, #b46940);
  box-shadow:
    0 1px 0 var(--gold-antique),
    0 2px 0 rgba(154,116,16,0.15),
    0 6px 32px var(--shadow-deep);
}

.main-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-antique) 20%, var(--gold-bright) 50%, var(--gold-antique) 80%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.logo-section { display: flex; align-items: center; gap: 14px; }

.logo-img {
  width: 44px; height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(240,192,64,0.7)) drop-shadow(0 0 14px rgba(240,192,64,0.35));
}

.logo-section h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(160deg, var(--gold-pale) 0%, var(--gold-bright) 40%, var(--gold-pure) 70%, var(--gold-rich) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  display: block;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.header-right { display: flex; align-items: center; gap: 14px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 10px;
  border-radius: 99px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.status::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.connected {
  background: rgba(61,170,104,0.12);
  color: #6ddba0;
  border: 1px solid rgba(61,170,104,0.28);
}
.connected::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61,170,104,0.22);
  animation: blink 2.2s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { box-shadow: 0 0 0 3px rgba(61,170,104,0.22); }
  50%     { box-shadow: 0 0 0 5px rgba(61,170,104,0.08); }
}
.disconnected {
  background: rgba(255,255,255,0.04);
  color: #787878;
  border: 1px solid rgba(255,255,255,0.08);
}
.disconnected::before { background: #555; }

#logoutBtn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid rgba(198,144,42,0.25);
  border-radius: var(--r-sm);
  padding: 7px 16px;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
#logoutBtn:hover {
  color: var(--gold-bright);
  border-color: var(--gold-rich);
  background: rgba(221,184,48,0.07);
}

/* ============================================================ */
/*  SELECTOR BAR                                                */
/* ============================================================ */

.selector {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 32px;
  background: linear-gradient(90deg, rgba(59,26,8,0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(154,116,16,0.16);
}

.selector label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--hive-bark);
  white-space: nowrap;
}

#hiveSelect {
  color: var(--ink-light);
  border: 1px solid rgba(198,144,42,0.45);
  padding: 8px 38px 8px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(135deg, #1e0d04, #2e1508),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='none' stroke='%23ddb830' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 13px center;
  box-shadow: 0 2px 10px var(--shadow-mid);
  transition: border-color var(--ease), box-shadow var(--ease);
}
#hiveSelect:focus {
  outline: none;
  border-color: var(--gold-pure);
  box-shadow: 0 2px 10px var(--shadow-mid), 0 0 0 3px var(--glow-gold);
}
#hiveSelect option { background: #1e0d04; color: var(--ink-light); }

/* ============================================================ */
/*  GRID                                                        */
/* ============================================================ */

.grid,
#hiveContainer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 24px 28px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ============================================================ */
/*  CARD                                                        */
/* ============================================================ */

.card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(170deg, #7c3b10 0%, #8e4614 40%, #a05018 70%, #7a3a0e 100%);
  border-radius: var(--r-lg);
  border: 1px solid rgba(221,184,48,0.28);
  padding: 20px;
  color: var(--ink-light);
  position: relative;
  box-shadow:
    0 1px 0 rgba(250,233,154,0.15) inset,
    0 -1px 0 rgba(0,0,0,0.35) inset,
    0 4px 16px var(--shadow-mid),
    0 12px 40px rgba(26,12,2,0.22);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
  animation: riseIn 0.5s ease both;
  cursor: default;
  /* ลบ overflow:hidden ออก เพื่อไม่ตัด chart */
}

.card:nth-child(1) { animation-delay: 0.04s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.16s; }
.card:nth-child(5) { animation-delay: 0.20s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(250,233,154,0.80) 50%, transparent);
}

.card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(240,208,96,0.14) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: rgba(221,184,48,0.55);
  box-shadow:
    0 1px 0 rgba(250,233,154,0.20) inset,
    0 -1px 0 rgba(0,0,0,0.35) inset,
    0 8px 28px var(--shadow-mid),
    0 20px 56px rgba(26,12,2,0.28),
    0 0 0 1px rgba(221,184,48,0.30);
}

.card h2,
.card h3 {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-pale);
  opacity: 0.75;
  margin: 0 0 10px;
}

.card p {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.55;
  color: var(--ink-light);
  letter-spacing: 0em;
  text-shadow: 0 2px 12px rgba(26,12,2,0.4);
}

/* ============================================================ */
/*  CARD INNER LAYOUT — data left, chart right                 */
/* ============================================================ */

.card-inner {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  margin-top: 8px;
}

.card-data {
  flex: 0 0 145px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.card-chart {
  flex: 1 1 0;
  min-width: 0;
}

/* ชัดเจนกว่า fallback canvas ด้านล่าง */
.card .card-chart canvas {
  display: block;
  width: 100% !important;
  height: 160px !important;
  margin: 0 !important;
  border-radius: var(--r-sm);
  opacity: 0.92;
}

/* fallback: canvas ที่ไม่ได้อยู่ใน .card-chart */
canvas {
  width: 100% !important;
  height: 180px !important;
  margin-top: 14px;
  border-radius: var(--r-sm);
  opacity: 0.92;
}

/* ============================================================ */
/*  ADMIN PANEL                                                 */
/* ============================================================ */

.admin-panel,
#adminPanel {
  max-width: 700px;
  margin: 32px auto 60px;
  padding: 0 24px;
}

.admin-panel > h2,
#adminPanel > h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--ink-deep);
  margin-bottom: 2px;
}

.admin-panel > h2::after,
#adminPanel > h2::after {
  content: '';
  display: block;
  margin-top: 6px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--gold-rich), var(--gold-bright), transparent);
  border-radius: 2px;
}

.admin-section {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, transparent 50%),
    linear-gradient(170deg, #7c3b10, #8e4614, #a05018);
  border-radius: var(--r-lg);
  border: 1px solid rgba(221,184,48,0.28);
  padding: 22px 26px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(250,233,154,0.12) inset,
    0 -1px 0 rgba(0,0,0,0.28) inset,
    0 8px 32px var(--shadow-mid);
  animation: riseIn 0.5s ease both;
}

.admin-section::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(250,233,154,0.60), transparent);
}

.admin-section::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -30px;
  width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(199,101,34,0.09) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.admin-section h3,
.admin-panel > h3,
#adminPanel > h3 {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1a0c02;
  opacity: 1;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-panel > h3,
#adminPanel > h3 { margin: 22px 0 14px; }

.admin-section h3::after,
.admin-panel > h3::after,
#adminPanel > h3::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(221,184,48,0.30), transparent);
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.form-row input { flex: 1; min-width: 110px; }

.admin-panel input,
#adminPanel input {
  background: rgba(255,250,240,0.92);
  border: 1px solid rgba(221,184,48,0.40);
  color: #1a0c02;
  padding: 11px 15px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
  width: auto;
}
.admin-panel input::placeholder,
#adminPanel input::placeholder { color: rgba(90,50,20,0.40); }
.admin-panel input:focus,
#adminPanel input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--gold-pure);
  box-shadow: 0 0 0 3px var(--glow-gold), 0 2px 10px var(--shadow-mid);
}

.admin-panel button,
#adminPanel button {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--hive-terra) 0%, var(--hive-flame) 50%, var(--gold-pure) 100%);
  color: var(--hive-void);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(224,135,46,0.40), 0 1px 0 rgba(255,255,255,0.15) inset;
  transition: transform var(--ease), box-shadow var(--ease);
}
.admin-panel button::before,
#adminPanel button::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.4s ease;
}
.admin-panel button:hover::before,
#adminPanel button:hover::before { left: 160%; }
.admin-panel button:hover,
#adminPanel button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(224,135,46,0.50);
}
.admin-panel button:active,
#adminPanel button:active { transform: translateY(0); }

/* ============================================================ */
/*  LOGIN                                                       */
/* ============================================================ */

.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, #723006, #8d482a, #f9f0eb);
  border: 1px solid rgba(221,184,48,0.30);
  border-radius: var(--r-lg);
  padding: 48px 44px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(250,233,154,0.14) inset,
    0 -1px 0 rgba(0,0,0,0.4) inset,
    0 24px 64px rgba(26,12,2,0.55),
    0 8px 24px rgba(26,12,2,0.30);
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(250,233,154,0.65), transparent);
}

.login-box h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  font-style: italic;
  text-align: center;
  letter-spacing: 0.04em;
  background: linear-gradient(160deg, var(--gold-pale), var(--gold-bright), var(--gold-pure));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.login-box .tagline {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 34px;
}

.login-box input {
  display: block;
  width: 100%;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(221,184,48,0.22);
  color: var(--ink-light);
  padding: 13px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  margin-bottom: 14px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.login-box input::placeholder { color: rgba(220,190,140,0.35); }
.login-box input:focus {
  outline: none;
  border-color: var(--gold-pure);
  box-shadow: 0 0 0 3px var(--glow-gold);
}

.login-box button,
.login-box input[type="submit"] {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  background: linear-gradient(135deg, var(--hive-terra), var(--hive-flame), var(--gold-pure));
  color: var(--hive-void);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(224,135,46,0.45), 0 1px 0 rgba(255,255,255,0.15) inset;
  transition: transform var(--ease), box-shadow var(--ease);
}
.login-box button:hover,
.login-box input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(224,135,46,0.55);
}
.login-box button:active,
.login-box input[type="submit"]:active { transform: translateY(0); }

/* ============================================================ */
/*  RESPONSIVE                                                  */
/* ============================================================ */

/* ── Tablet (768px) ── */
@media (max-width: 768px) {
  .main-header { padding: 0 16px; height: 58px; }
  .logo-section h1 { font-size: 17px; }
  .logo-img { width: 38px; height: 38px; }
  .selector { padding: 10px 16px; gap: 10px; }
  .selector label { font-size: 9px; }
  #hiveSelect { font-size: 13px; padding: 7px 32px 7px 12px; }

  .grid,
  #hiveContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 14px;
  }

  /* Stack chart below data on tablet */
  .card-inner { flex-direction: column; gap: 10px; }
  .card-data   { flex: none; width: 100%; }
  .card-chart canvas { height: 150px !important; }

  .card { padding: 16px 14px; border-radius: 12px; }
  .card h2 { font-size: 9px; margin-bottom: 8px; }
  .card p  { font-size: 15px; line-height: 1.5; }

  canvas { height: 180px !important; }

  .admin-panel,
  #adminPanel { padding: 0 16px; margin: 20px auto 40px; }
  .admin-panel > h2,
  #adminPanel > h2 { font-size: 26px; }
  .admin-section { padding: 18px 18px; }
  .login-box { padding: 40px 32px; }
  .login-box h2 { font-size: 26px; }
}

/* ── Large phone (480px) ── */
@media (max-width: 480px) {
  .subtitle { display: none; }
  .logo-section h1 { font-size: 15px; }
  .logo-img { width: 34px; height: 34px; }
  .status { padding: 5px 8px; letter-spacing: 0; font-size: 0; gap: 0; }
  .status::before { width: 8px; height: 8px; }
  #logoutBtn { padding: 6px 12px; font-size: 9px; }
  .selector { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }

  .grid,
  #hiveContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }

  /* Stack chart below data on mobile */
  .card-inner { flex-direction: column; gap: 8px; }
  .card-data   { flex: none; width: 100%; }
  .card-chart canvas { height: 130px !important; }

  .card { padding: 12px 10px; border-radius: 12px; }
  .card h2 { font-size: 8px; letter-spacing: 0.14em; margin-bottom: 8px; }
  .card p  { font-size: 13px; }

  canvas { height: 160px !important; margin-top: 8px; }

  .admin-panel,
  #adminPanel { padding: 0 12px; margin: 16px auto 32px; }
  .admin-panel > h2,
  #adminPanel > h2 { font-size: 22px; }
  .admin-section { padding: 16px 14px; border-radius: 12px; margin-top: 14px; }
  .admin-section h3,
  .admin-panel > h3,
  #adminPanel > h3 { font-size: 9px; letter-spacing: 0.16em; margin-bottom: 14px; }

  .form-row { flex-direction: column; gap: 8px; }
  .form-row input,
  .form-row button,
  .admin-panel input,
  .admin-panel button,
  #adminPanel input,
  #adminPanel button { width: 100%; font-size: 15px; }
  .admin-panel button,
  #adminPanel button { padding: 12px; font-size: 11px; text-align: center; }

  .login-box { padding: 32px 20px; border-radius: 16px; }
  .login-box h2 { font-size: 24px; }
  .login-box input { font-size: 16px; padding: 12px 14px; }
  .login-box button,
  .login-box input[type="submit"] { font-size: 11px; padding: 13px; }
}

/* ── Small phone (360px) ── */
@media (max-width: 360px) {
  .main-header { height: 52px; padding: 0 12px; }
  .logo-section h1 { font-size: 13px; }
  .logo-img { width: 28px; height: 28px; }
  .logo-section { gap: 8px; }
  #logoutBtn { display: none; }
  .selector label { display: none; }
  #hiveSelect { width: 100%; }
  .card p { font-size: 12px; }
  canvas { height: 140px !important; }
  .card-chart canvas { height: 120px !important; }
  .login-box { padding: 28px 16px; }
  .login-box h2 { font-size: 22px; }
}

/* ── Desktop (1100px+) ── */
@media (min-width: 1100px) {
  #hiveContainer { grid-template-columns: repeat(3, 1fr); }
  .card-data { min-width: 150px; max-width: 170px; }
  .card-chart canvas { height: 200px !important; }
}

/* ── Wide desktop (1400px+) ── */
@media (min-width: 1400px) {
  #hiveContainer { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(4, 1fr); }
}