:root {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --primary: #1d4ed8;
  --primary-soft: #e0ecff;
  --danger: #dc2626;
  --warning: #f97316;
  --success: #16a34a;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-soft: #e5e7eb;
  --radius: 12px;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, #e0ecff 0, #f4f6fb 40%, #f4f6fb 100%);
  color: var(--text-main);
  min-height: 100vh;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: #0f172a;
  color: #e5e7eb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo span {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 4px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover { background: rgba(148, 163, 184, 0.2); }

.sidebar-nav a.active {
  background: #1d4ed8;
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: #9ca3af;
}

.main {
  flex: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.main-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.main-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.8rem;
}

.chip-dot { width: 8px; height: 8px; border-radius: 999px; }
.chip-dot.red { background: var(--danger); }
.chip-dot.green { background: var(--success); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.card {
  --bs-card-bg: #d3dce8;
  background-color: #d3dce8 !important;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title { font-size: 0.9rem; font-weight: 600; }
.card-value { font-size: 1.1rem; font-weight: 700; }

.card-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.card-tag.red { background: rgba(248, 113, 113, 0.15); color: #b91c1c; }
.card-tag.green { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.card-tag.orange { background: rgba(251, 146, 60, 0.16); color: #c2410c; }

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }

label { font-size: 0.78rem; color: var(--text-muted); }

select, input[type="date"], input[type="text"], input[type="number"] {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #f9fafb;
  font-size: 0.85rem;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}

.table-card { margin-top: 8px; }

.table-wrapper { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

thead { background: #f3f4f6; }

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

tbody tr:hover { background: #f9fafb; }

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
}

.badge-red { background: rgba(248, 113, 113, 0.16); color: #b91c1c; }
.badge-green { background: rgba(34, 197, 94, 0.16); color: #15803d; }
.badge-gray { background: rgba(148, 163, 184, 0.18); color: #4b5563; }

.form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.4);
}

.login-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.login-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 18px;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.login-form-group label {
  font-size: 0.8rem;
  color: #cbd5f5;
}

.login-form-group input {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 0.85rem;
}

.login-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border: none;
  border-radius: 999px;
  padding: 9px 0;
  color: #f9fafb;
  font-size: 0.9rem;
  cursor: pointer;
}

.login-footer {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    gap: 12px;
  }
  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }
  .sidebar-footer { display: none; }
}