/* ═══════════════════════════════════════════════════════
   Int-Galva Factory  —  Custom Theme
   Primary gradient : #0f5b73 → #1581a3
   Cards / buttons  : #093442
   Font             : white
═══════════════════════════════════════════════════════ */

:root {
  --primary-dark:  #093442;
  --primary-mid:   #0f5b73;
  --primary-light: #1581a3;
  --accent:        #20a8d0;
  --sidebar-w:     240px;
  --topbar-h:      56px;
}

/* ── Body ─────────────────────────────────────────────────────────── */
body {
  background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-light) 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--primary-dark);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 18px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-section {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  padding: 16px 20px 4px;
  text-transform: uppercase;
}

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .88rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}

.sidebar-nav .nav-link i,
.sidebar-footer .nav-link i { font-size: 1.05rem; }

.sidebar-nav .nav-link:hover,
.sidebar-footer .nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--accent);
}

.sidebar-nav .nav-link.active {
  background: rgba(32,168,208,.18);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ── Main content ─────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .25s;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(9,52,66,.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { flex: 1; font-weight: 600; font-size: 1rem; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.content-body { padding: 24px; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--primary-dark) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 12px !important;
  color: #fff !important;
}

.card-header {
  background: rgba(255,255,255,.06) !important;
  border-bottom: 1px solid rgba(255,255,255,.1) !important;
  font-weight: 600;
}

/* KPI cards */
.kpi-card {
  background: var(--primary-dark);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 20px 22px;
  transition: transform .15s, box-shadow .15s;
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.3); }

.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.kpi-card .kpi-label {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 4px;
}

.kpi-card .kpi-trend {
  font-size: .8rem;
  margin-top: 6px;
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

.kpi-icon-blue   { background: rgba(21,129,163,.3); color: var(--accent); }
.kpi-icon-green  { background: rgba(40,167,69,.25); color: #4ccc6e; }
.kpi-icon-yellow { background: rgba(255,193,7,.2);  color: #ffc107; }
.kpi-icon-red    { background: rgba(220,53,69,.25); color: #f36c7a; }
.kpi-icon-purple { background: rgba(111,66,193,.25); color: #c084fc; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary-mid) !important;
  border-color: var(--primary-mid) !important;
}
.btn-primary:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary-light) !important;
}

.btn-dark-galva {
  background: var(--primary-dark);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
}
.btn-dark-galva:hover { background: var(--primary-mid); color: #fff; }

/* ── Tables ───────────────────────────────────────────────────────── */
.table {
  color: rgba(255,255,255,.85) !important;
  border-color: rgba(255,255,255,.1) !important;
}

.table thead th {
  background: rgba(9,52,66,.8) !important;
  color: rgba(255,255,255,.65) !important;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,.15) !important;
}

.table tbody tr { border-color: rgba(255,255,255,.06) !important; }
.table tbody tr:hover { background: rgba(255,255,255,.04) !important; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: #fff !important;
  border-radius: 8px !important;
}

.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,.12) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(32,168,208,.2) !important;
  color: #fff !important;
}

.form-control::placeholder { color: rgba(255,255,255,.35) !important; }

.form-select option { background: var(--primary-dark); color: #fff; }

.form-label { color: rgba(255,255,255,.8); font-size: .85rem; font-weight: 500; }

.form-check-input {
  background-color: rgba(255,255,255,.15) !important;
  border-color: rgba(255,255,255,.3) !important;
}

.form-check-input:checked {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ── Badges ───────────────────────────────────────────────────────── */
.badge-draft   { background: rgba(255,193,7,.2);  color: #ffc107;  padding: 4px 10px; border-radius: 20px; }
.badge-final   { background: rgba(40,167,69,.2);  color: #4ccc6e;  padding: 4px 10px; border-radius: 20px; }
.badge-in-range   { background: rgba(40,167,69,.2);  color: #4ccc6e;  }
.badge-out-range  { background: rgba(220,53,69,.25); color: #f36c7a; }

/* ── Alert panel ─────────────────────────────────────────────────── */
.alert-panel .alert-item {
  background: rgba(255,255,255,.06);
  border-left: 3px solid;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: .85rem;
}

.alert-item.danger  { border-color: #dc3545; }
.alert-item.warning { border-color: #ffc107; }
.alert-item.info    { border-color: var(--accent); }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination .page-link {
  background: var(--primary-dark);
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.75);
}

.pagination .page-link:hover { background: var(--primary-mid); color: #fff; }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); }

/* ── Auth page ───────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--primary-dark);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.auth-logo { font-size: 2rem; font-weight: 800; letter-spacing: 1px; }

/* ── Chart containers ────────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }

/* ── Trend indicators ────────────────────────────────────────────── */
.trend-up   { color: #4ccc6e; }
.trend-down { color: #f36c7a; }
.trend-flat { color: rgba(255,255,255,.45); }
