:root {
  --ink: #14212b;
  --ink-soft: #3d4f5c;
  --paper: #f3efe6;
  --paper-2: #ebe4d6;
  --panel: #ffffff;
  --line: rgba(20, 33, 43, 0.1);
  --accent: #c45c26;
  --accent-2: #e07a3d;
  --teal: #1f6f6a;
  --ok: #2f7d4a;
  --danger: #b33a3a;
  --sidebar: #14212b;
  --shadow: 0 18px 40px rgba(20, 33, 43, 0.08);
  --radius: 18px;
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(196, 92, 38, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(31, 111, 106, 0.1), transparent 55%),
    linear-gradient(160deg, #f7f3ec 0%, #ebe4d6 100%);
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--accent); }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #172733 0%, #0f1a22 100%);
  color: #f4efe6;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0.4rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #d9783f);
  color: white;
  box-shadow: 0 10px 24px rgba(196, 92, 38, 0.35);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.78rem;
  opacity: 0.55;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  color: rgba(244, 239, 230, 0.72);
  font-weight: 600;
  transition: 0.18s ease;
}

.side-link i { font-size: 1.05rem; opacity: 0.9; }

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-link.active {
  background: rgba(196, 92, 38, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(224, 122, 61, 0.35);
}

.sidebar-foot { padding-top: 0.5rem; }

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.6rem 2rem 0.4rem;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

.page-sub {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.content {
  padding: 1.2rem 2rem 2.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-body { padding: 1.25rem 1.35rem; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #faf7f1);
}

.panel-head h2, .panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 92, 38, 0.18), transparent 70%);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-card.teal .stat-value { color: var(--teal); }
.stat-card.accent .stat-value { color: var(--accent); }

.btn {
  border-radius: 12px;
  font-weight: 700;
  padding: 0.55rem 1rem;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(196, 92, 38, 0.28);
}

.btn-accent:hover {
  filter: brightness(1.05);
  color: #fff !important;
}

.btn-ink {
  background: var(--ink);
  border: none;
  color: #fff !important;
}

.btn-ink:hover { background: #223645; color: #fff !important; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; border-radius: 10px; }

.form-control, .form-select {
  border-radius: 12px;
  border-color: rgba(20, 33, 43, 0.14);
  padding: 0.65rem 0.85rem;
  background: #fff;
}

.form-control:focus, .form-select:focus {
  border-color: rgba(31, 111, 106, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(31, 111, 106, 0.12);
}

.form-label {
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
}

.table {
  margin: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  border-color: var(--line);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(31, 111, 106, 0.12);
  color: var(--teal);
}

.badge-soft.warning {
  background: rgba(196, 92, 38, 0.14);
  color: var(--accent);
}

.badge-soft.muted {
  background: rgba(20, 33, 43, 0.08);
  color: var(--ink-soft);
}

.search-bar {
  display: flex;
  gap: 0.6rem;
  max-width: 420px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-soft);
}

.empty-state i {
  font-size: 2.4rem;
  color: var(--accent);
  opacity: 0.7;
}

.kalem-row {
  background: #faf8f3;
  border: 1px dashed rgba(20, 33, 43, 0.12);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.total-box {
  background: linear-gradient(135deg, #172733, #1f3a4a);
  color: #fff;
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-box .label { opacity: 0.75; font-weight: 600; }
.total-box .value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.meta-list li:last-child { border-bottom: 0; }
.meta-list .k { color: var(--ink-soft); font-weight: 600; }
.meta-list .v { font-weight: 700; text-align: right; }

.user-chip {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.sidebar-foot .btn-ghost {
  border-color: rgba(255, 255, 255, 0.18) !important;
}

@media (max-width: 992px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-radius: 0 0 20px 20px;
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid, .detail-grid { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 1rem; padding-right: 1rem; }
}
