/* =====================================================
   GPIO ALERT — assets/style.css
   Accent: orange/amber (#f59e0b)
   ===================================================== */

:root {
  --sidebar-width:  240px;
  --sidebar-bg:     #1a1f2e;
  --sidebar-text:   #c5cde6;
  --sidebar-hover:  #2d3553;
  --sidebar-active: #f59e0b;
  --topbar-height:  52px;
  --card-radius:    10px;
  --accent:         #f59e0b;
  --accent-dark:    #b45309;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f2f8; color: #1e2235; }

/* ---- LOGIN ---- */
.login-body { background: linear-gradient(135deg, #1a1f2e 0%, #2d3553 100%); }
.login-card { border-radius: 16px; border: none; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-brand {
  padding: 1.2rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(245,158,11,.12);
}

.sidebar-nav { list-style: none; padding: .5rem 0; margin: 0; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.2rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  transition: background .15s, color .15s;
  font-size: .93rem;
}
.sidebar-nav li a i { font-size: 1rem; opacity: .8; }
.sidebar-nav li a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav li.active a { background: var(--sidebar-active); color: #1a1a1a; font-weight: 600; }

.sidebar-sep {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #4a5380;
  padding: .6rem 1.2rem .2rem;
}

.sidebar-footer {
  padding: .8rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .83rem;
}
.user-info { color: #a0aec0; }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ---- CONTENT ---- */
.main-content { min-height: 100vh; overflow-x: hidden; }
.content-area { min-height: calc(100vh - var(--topbar-height)); }

/* ---- CARDS ---- */
.card { border: none; border-radius: var(--card-radius); box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f5; border-radius: var(--card-radius) var(--card-radius) 0 0 !important; padding: .8rem 1.2rem; }
.card-footer { background: #fafbff; border-top: 1px solid #eef0f5; }

/* ---- STAT CARDS ---- */
.stat-card { border-top: 3px solid var(--accent) !important; }
.stat-icon  { font-size: 1.8rem; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: #1e2235; margin-top: .15rem; }

/* ---- TABLE ---- */
.table { font-size: .88rem; }
.table thead th { background: #f8faff; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; border-bottom: 2px solid #eef0f5; }
.table-hover tbody tr:hover { background: #fffbf0; }

/* ---- GPIO STATE BADGES ---- */
.gpio-low    { color: #ef4444; font-weight: 700; }
.gpio-high   { color: #10b981; font-weight: 700; }
.gpio-unkn   { color: #94a3b8; font-weight: 700; }

/* ---- ALERT STATUS ---- */
.badge-sent    { background: #d1fae5; color: #065f46; }
.badge-failed  { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }

/* Online indicator */
.dot-online  { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.dot-offline { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }

/* Pin number chip */
.pin-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(245,158,11,.12);
  color: var(--accent);
  font-weight: 700;
  font-size: .8rem;
}

/* ---- MOBILE ---- */
@media (max-width: 991px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
}

@media (min-width: 992px) {
  #app-body { flex-direction: row; }
}

/* ---- ANIMATIONS ---- */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.loading-row td { text-align: center; padding: 2rem; color: #94a3b8; }

/* ---- ACCENT BUTTON ---- */
.btn-accent { background: var(--accent); color: #1a1a1a; border: none; font-weight: 600; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
