:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe3ef;
  --text: #172033;
  --muted: #667085;
  --brand: #4d148c;
  --brand-dark: #35105f;
  --accent: #ff8a00;
  --success: #138a4d;
  --danger: #c2413b;
  --warning: #b7791f;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0 !important;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(77, 20, 140, 0.06), rgba(255, 255, 255, 0) 320px),
    var(--bg) !important;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
  padding: 0 24px 40px !important;
}

body > h1,
body > h2,
body > form,
body > table,
body > p,
body > .card,
body > .cards-container,
body > .filter-box,
body > .max-w-6xl,
body > .dashboard-page {
  max-width: 1220px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.dashboard-shell {
  max-width: 1240px;
  margin: 18px auto 28px;
  padding: 0;
}

.dashboard-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  color: var(--text);
  text-decoration: none;
}

.dashboard-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(77, 20, 140, 0.22);
}

.dashboard-brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.dashboard-brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.dashboard-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-logout {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand) !important;
  padding: 6px 10px;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-logout:hover {
  border-color: var(--brand);
  background: rgba(77, 20, 140, 0.08);
}

.dashboard-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(19, 138, 77, 0.12);
}

.dashboard-nav {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.dashboard-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 12px;
  color: #344054 !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.dashboard-nav a:hover {
  background: #f0f3f8;
  color: var(--brand) !important;
}

.dashboard-nav a.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(77, 20, 140, 0.2);
}

h1,
h2 {
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  margin-top: 28px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

h2 {
  margin-top: 24px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  color: var(--text);
}

.card,
.filter-box,
.box,
body > form,
body > table,
.max-w-6xl.bg-white,
.dashboard-panel {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
}

.card,
.dashboard-panel {
  padding: 24px !important;
  margin-bottom: 24px !important;
}

.filter-box {
  padding: 16px !important;
  align-items: center;
}

label {
  display: inline-block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8e6 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--text) !important;
  padding: 9px 11px !important;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  accent-color: var(--brand);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px rgba(77, 20, 140, 0.12) !important;
}

button,
.btn,
a.btn,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--brand) !important;
  color: #fff !important;
  padding: 9px 14px !important;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(77, 20, 140, 0.16);
}

button:hover,
.btn:hover,
a.btn:hover,
input[type="submit"]:hover {
  background: var(--brand-dark) !important;
}

.btn-danger,
.danger,
a[href*="delete"] {
  color: #fff !important;
  background: var(--danger) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  text-decoration: none !important;
}

a {
  color: var(--brand);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line) !important;
  padding: 13px 14px !important;
  vertical-align: middle;
}

th {
  background: #f5f7fb !important;
  color: #475467;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

tr:hover td {
  background: #fbfcff;
}

img {
  max-width: 100%;
  border-radius: 10px;
}

.row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px !important;
}

.cards-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 18px !important;
  justify-content: stretch !important;
}

.cards-container .card {
  width: auto !important;
  margin: 0 !important;
  text-align: left !important;
}

.status,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.active,
.badge-success {
  background: rgba(19, 138, 77, 0.12) !important;
  color: var(--success) !important;
}

.inactive,
.badge-danger {
  background: rgba(194, 65, 59, 0.12) !important;
  color: var(--danger) !important;
}

.badge-warning {
  background: rgba(183, 121, 31, 0.14) !important;
  color: var(--warning) !important;
}

.badge-info {
  background: rgba(77, 20, 140, 0.1) !important;
  color: var(--brand) !important;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 22px auto;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.table-wrap {
  max-width: 1220px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  body {
    padding: 0 12px 28px !important;
  }

  .dashboard-shell {
    margin-top: 10px;
  }

  .dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-nav {
    padding: 10px;
  }

  .card,
  .dashboard-panel {
    padding: 16px !important;
  }
}
