@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --bg-dark: #05080e;
  --card-bg: #0d1626;
  --card-border: rgba(255, 255, 255, 0.08);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --exofresh-blue: #0284c7;
  --glow-green: #00e676;
  --glow-cyan: #38bdf8;
  --glow-yellow: #facc15;
  
  --glow-red: #ff3b30;
  --glow-red-bg: rgba(255, 59, 48, 0.15);
  --glow-red-border: rgba(255, 59, 48, 0.5);
  
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 9999px;
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #05080e !important;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.1) 0%, transparent 45%);
  color: #f8fafc !important;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: #38bdf8 !important;
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
  padding: 1.5rem;
  gap: 1.5rem;
}

.side {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  bottom: 1.5rem;
  width: 270px;
  background: #0d1626 !important;
  border-radius: var(--radius-xl);
  padding: 2rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--card-border) !important;
  z-index: 100;
}

.brand-ci {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.2rem;
}

.ci-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7, #00e676) !important;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
}

.ci-text {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  color: #ffffff !important;
}

.ci-sub {
  font-size: 0.72rem;
  color: #38bdf8 !important;
  font-weight: 700;
}

/* Left Navigation Buttons */
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8 !important;
  padding: 13px 18px;
  margin: 6px 0;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.25s ease;
}

.nav a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.nav a.active {
  background: #060b14 !important;
  color: #facc15 !important;
  font-weight: 800 !important;
  border: 1.5px solid #facc15 !important;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(250, 204, 21, 0.3) !important;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.content {
  margin-left: 290px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.top {
  background: #0d1626 !important;
  border-radius: var(--radius-xl);
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--card-border) !important;
}

.top h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff !important;
}

.muted {
  font-size: 0.85rem;
  color: #94a3b8 !important;
}

.top-actions a {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
  border: 1px solid var(--card-border) !important;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

/* CARDS & FILTER CARD */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.card, .filter-card {
  background-color: #0d1626 !important;
  background: #0d1626 !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
  border: 1px solid var(--card-border) !important;
  color: #f8fafc !important;
}

.filter-card {
  padding: 1.2rem 1.8rem !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8 !important;
}

.site-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------- */
/* CENTER FILTER BUTTONS (OVERRIDE ALL BROWSER WHITE DEFAULTS) */
/* ---------------------------------------------------- */
button.site-btn, .site-btn {
  background-color: #111c2e !important;
  background: #111c2e !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
  padding: 9px 20px !important;
  border-radius: 9999px !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.15s ease-in-out !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
}

button.site-btn:hover, .site-btn:hover {
  background-color: #1a2840 !important;
  background: #1a2840 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* PRESSED INSET BUTTON + YELLOW TEXT FOR ACTIVE FILTER */
button.site-btn.active, .site-btn.active {
  background-color: #060b14 !important;
  background: #060b14 !important;
  color: #facc15 !important; /* Bright Yellow Text */
  font-weight: 900 !important;
  border: 1.5px solid #facc15 !important; /* Yellow Border Accent */
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.95), inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 0 18px rgba(250, 204, 21, 0.4) !important;
  transform: translateY(2px) !important;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.7) !important;
}

.kpi span {
  font-size: 0.85rem;
  color: #94a3b8 !important;
}

.kpi b {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 8px;
  color: #38bdf8 !important;
}

/* FORM INPUTS & SELECT DROPDOWNS */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #94a3b8 !important;
}

input, select {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius-md);
  background-color: #142035 !important;
  background: #142035 !important;
  color: #f8fafc !important;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
}

select option {
  background-color: #0d1626 !important;
  color: #f8fafc !important;
  padding: 10px;
}

input:focus, select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3) !important;
}

button.primary {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  font-weight: 800;
  border: none !important;
  box-shadow: 0 0 18px rgba(2, 132, 199, 0.4) !important;
}

button.danger {
  background: rgba(255, 59, 48, 0.15) !important;
  color: #ff6b6b !important;
  border: 1px solid rgba(255, 59, 48, 0.5) !important;
}

/* TABLES */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

th {
  text-align: left;
  color: #64748b !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 14px 8px 14px;
}

td {
  background-color: #111a2d !important;
  background: #111a2d !important;
  padding: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc !important;
  border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-left: 1px solid rgba(255, 255, 255, 0.04) !important;
}

tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.08) !important;
  padding: 4px 10px;
  border-radius: 8px;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.badge.ok {
  background: rgba(0, 230, 118, 0.12) !important;
  color: #00e676 !important;
  border: 1px solid rgba(0, 230, 118, 0.3) !important;
}

.badge.off {
  background: rgba(255, 59, 48, 0.15) !important;
  color: #ff6b6b !important;
  border: 1px solid rgba(255, 59, 48, 0.5) !important;
}

.badge.blue {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}
