@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --page: #f3f6f7;
  --page-2: #edf3f1;
  --shell: #0d1715;
  --shell-2: #14231f;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #101817;
  --muted: #61706c;
  --line: #dce5e1;
  --line-strong: #c5d1cc;
  --green: #0e7a68;
  --green-dark: #075d50;
  --green-soft: #e4f5f1;
  --teal: #1ba394;
  --blue: #355bc2;
  --blue-soft: #eaf0ff;
  --sand: #b2782b;
  --sand-soft: #fff4df;
  --red: #b83227;
  --red-soft: #fff0ef;
  --shadow: 0 24px 60px rgba(21, 35, 31, 0.11);
  --shadow-soft: 0 10px 28px rgba(21, 35, 31, 0.08);
  --radius: 8px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 24% 0%, rgba(27, 163, 148, 0.18), transparent 28rem),
    linear-gradient(180deg, var(--page-2), var(--page) 20rem),
    var(--page);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
.wrapper { min-height: 100vh; display: flex; background: transparent; }
.content-wrapper, .main-content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  width: min(100%, 1380px);
  margin-left: 0 !important;
  padding: 34px;
  background: transparent !important;
}

.rb-sidebar {
  width: 278px;
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  color: #edf8f5;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 16rem),
    linear-gradient(160deg, var(--shell), var(--shell-2));
}
.rb-sidebar::-webkit-scrollbar { width: 8px; }
.rb-sidebar::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }
.rb-sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.rb-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 8px 22px;
  border-bottom: 0;
  margin-bottom: 0;
}
.rb-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f1d18d, #42c2ac 68%, #277d70);
  color: #0b1512;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}
.rb-brand strong { display: block; font-size: 15px; line-height: 1.1; letter-spacing: 0; }
.rb-brand small { display: block; color: #a9bbb5; font-size: 12px; margin-top: 4px; font-weight: 600; }

.rb-nav { display: grid; gap: 6px; padding: 12px 0 8px; flex: 0 0 auto; }
.rb-nav a, .rb-logout {
  min-height: 46px;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b9cac5;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
  background: transparent;
}
.rb-nav a i, .rb-logout i {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e4e0;
  text-align: center;
  line-height: 30px;
}
.rb-nav a:hover, .rb-logout:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.rb-nav a.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--green-dark);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}
.rb-nav a.active::before {
  content: "";
  position: absolute;
  left: -16px;
  width: 4px;
  height: 26px;
  border-radius: 0 999px 999px 0;
  background: #66dccb;
}
.rb-nav a.active i { background: var(--green-soft); color: var(--green); }
.rb-logout {
  margin-top: 18px;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #edf8f5;
}

.content-header {
  margin: 0 0 24px !important;
  padding: 24px !important;
  border: 1px solid rgba(220, 229, 225, 0.92);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.76)), var(--surface);
  box-shadow: var(--shadow);
}
.content-header h1, .page-title {
  margin: 0;
  max-width: 880px;
  color: var(--ink);
  font-size: clamp(30px, 3.4vw, 46px) !important;
  line-height: 1.06;
  font-weight: 900 !important;
  letter-spacing: 0;
}
.page-subtitle {
  margin: 12px 0 0;
  max-width: 790px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.card, .rb-card {
  border: 1px solid rgba(220, 229, 225, 0.96) !important;
  border-radius: var(--radius-lg) !important;
  background: rgba(255, 255, 255, 0.93) !important;
  box-shadow: var(--shadow-soft) !important;
  overflow: hidden;
}
.card-header {
  padding: 20px 22px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 249, 0.96)) !important;
}
.card-title { margin: 0; color: var(--ink); font-size: 18px !important; font-weight: 900 !important; }
.card-body { padding: 22px; }
.card-body.p-0 { padding: 0 !important; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric-card {
  min-height: 132px;
  position: relative;
  padding: 20px;
  border: 1px solid rgba(220, 229, 225, 0.96);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--green), var(--teal));
}
.metric-card:nth-child(2)::before { background: linear-gradient(180deg, var(--blue), #6b7ee8); }
.metric-card:nth-child(3)::before { background: linear-gradient(180deg, var(--sand), #e0a841); }
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}
.metric-card i {
  float: right;
  color: var(--green);
  font-size: 22px;
}

.table-responsive {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.card .table-responsive { border: 0; border-radius: 0; }
.table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  margin: 0;
}
.table thead th, th {
  padding: 14px 15px !important;
  border-bottom: 1px solid var(--line) !important;
  background: #f4f8f6;
  color: #53625e;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td, td {
  padding: 14px 15px !important;
  border-bottom: 1px solid var(--line);
  color: #33423f;
  vertical-align: middle !important;
}
.table tbody tr:hover { background: #fbfdfc; }
.table tbody tr:last-child td { border-bottom: 0; }

label {
  display: block;
  margin-bottom: 7px;
  color: #33423f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.form-control, input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  color: var(--ink) !important;
  padding: 11px 12px;
  outline: none;
  box-shadow: inset 0 1px 1px rgba(16, 24, 23, 0.03) !important;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 4px rgba(14, 122, 104, 0.12) !important;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.rb-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  align-items: end;
}
.rb-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rb-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-inline { gap: 8px; align-items: center; }
.form-inline .form-control { width: auto; min-width: 130px; }

.btn, button, .button {
  min-height: 42px;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  color: var(--ink) !important;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800 !important;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 23, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}
.btn:hover, button:hover, .button:hover {
  border-color: #9fb1aa !important;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.btn-primary, .btn-success {
  background: linear-gradient(135deg, var(--green), var(--teal)) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(14, 122, 104, 0.26);
}
.btn-info {
  background: var(--blue-soft) !important;
  border-color: #cbd7ff !important;
  color: var(--blue) !important;
  box-shadow: none;
}
.btn-danger {
  background: var(--red-soft) !important;
  border-color: #fac6c1 !important;
  color: var(--red) !important;
  box-shadow: none;
}
.btn-secondary {
  background: var(--surface-soft) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--blue-soft) !important;
  color: var(--blue) !important;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.badge-success { background: var(--green-soft) !important; color: var(--green) !important; }
.badge-warning { background: var(--sand-soft) !important; color: var(--sand) !important; }
.badge-danger { background: var(--red-soft) !important; color: var(--red) !important; }
.badge-secondary { background: #eef2f1 !important; color: var(--muted) !important; }

.rb-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.rb-muted, .text-muted { color: var(--muted) !important; }
.alert-danger {
  border: 1px solid #fac6c1;
  border-left: 5px solid var(--red);
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}

body.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 0%, rgba(27, 163, 148, 0.18), transparent 28rem),
    linear-gradient(180deg, var(--page-2), var(--page) 20rem),
    var(--page) !important;
}
.login-box { width: min(100%, 430px); }
.login-page .card {
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: var(--shadow) !important;
  padding: 0;
  overflow: hidden;
}
.login-page .card-header {
  padding: 24px 28px 10px !important;
  border-bottom: 0 !important;
  background: transparent !important;
}
.login-page .card-header .h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  text-decoration: none;
}
.login-page .card-body { padding: 18px 28px 28px; }
.login-box-msg { color: var(--muted); }
.input-group-text {
  border-color: var(--line) !important;
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  background: var(--surface-soft) !important;
  color: var(--green) !important;
}

.sidebar-overlay, .modal-backdrop {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.sidebar-open, body.sidebar-collapse { overflow: auto !important; }

@media (max-width: 1100px) {
  .rb-sidebar { width: 86px; }
  .rb-brand span:not(.rb-brand-mark), .rb-nav span, .rb-logout span { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-form-grid, .rb-form-grid.two, .rb-form-grid.three { grid-template-columns: 1fr; }
  .content-wrapper, .main-content { padding: 24px; }
}

@media (max-width: 760px) {
  .wrapper { display: block; }
  .rb-sidebar { display: none; }
  .content-wrapper, .main-content { width: 100%; padding: 16px; }
  .content-header { padding: 20px !important; }
  .metric-grid { grid-template-columns: 1fr; }
  .form-inline, .rb-actions { flex-direction: column; align-items: stretch; }
  .form-inline .form-control, .form-inline .btn, .btn, button, .button { width: 100%; }
}
