﻿:root {
  --app-bg: #f4ecdc;
  --surface: #fffdf8;
  --surface-alt: #fdf4e3;
  --gold-soft: #f5e3b2;
  --gold-main: #d3a84d;
  --gold-deep: #9a7127;
  --gold-dark: #4d3813;
  --ink: #2f2413;
  --muted: #7f6a43;
  --border: #ead7b0;
  --ring: rgba(211, 168, 77, 0.26);
  --shadow-soft: 0 14px 28px -20px rgba(66, 48, 17, 0.45);
  --shadow-strong: 0 22px 46px -26px rgba(55, 39, 13, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cairo', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 225, 154, 0.46) 0%, rgba(255, 225, 154, 0) 38%),
    radial-gradient(circle at 86% 18%, rgba(221, 174, 73, 0.18) 0%, rgba(221, 174, 73, 0) 36%),
    linear-gradient(145deg, #fbf4e8 0%, #f4ead9 45%, #f0e5d2 100%);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand h5 {
  font-family: 'El Messiri', 'Cairo', sans-serif;
  letter-spacing: 0.15px;
}

.auth-body {
  min-height: 100vh;
}

.auth-body .card {
  border: 1px solid rgba(196, 151, 63, 0.28) !important;
  background: linear-gradient(160deg, #fffefb 0%, #fff8e8 100%);
  box-shadow: var(--shadow-strong);
}

a {
  color: var(--gold-deep);
}

a:hover {
  color: #7b591e;
}

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

.sidebar {
  width: 280px;
  background:
    linear-gradient(170deg, #1f170c 0%, #2c210f 38%, #6c5020 100%);
  border-left: 1px solid rgba(249, 220, 156, 0.28);
  box-shadow: 8px 0 24px -18px rgba(0, 0, 0, 0.6);
  padding: 1.1rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 15;
}

.brand {
  padding: 0.65rem 0.8rem;
  border-radius: 0.9rem;
  background: linear-gradient(140deg, rgba(243, 206, 129, 0.2) 0%, rgba(255, 255, 255, 0.06) 100%);
  border: 1px solid rgba(244, 207, 128, 0.28);
}

.brand h5 {
  color: #f8e8bf;
  font-weight: 700;
}

.brand small {
  color: #ead9a8 !important;
}

.sidebar .small.text-muted,
.sidebar .fw-bold {
  color: #f8eac9 !important;
}

.sidebar .nav-link {
  color: #f6ebcf;
  border-radius: 0.75rem;
  padding: 0.7rem 0.78rem;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar .nav-link i {
  font-size: 1.03rem;
}

.sidebar .nav-link:hover {
  transform: translateY(-1px);
  background-color: rgba(245, 221, 166, 0.17);
  color: #fff4d6;
}

.sidebar .nav-link.active {
  background: linear-gradient(120deg, #f1d79e 0%, #d9ab51 100%);
  color: #2f220f;
  font-weight: 800;
  box-shadow: 0 10px 22px -14px rgba(244, 189, 83, 0.75);
}

.content-wrap {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.3rem;
  border-bottom: 1px solid rgba(192, 146, 60, 0.2);
  background: rgba(255, 251, 243, 0.78);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.topbar h1 {
  color: #3a2c14;
  font-weight: 700;
}

.content-area {
  padding: 1.35rem;
}

.card,
.stat-card,
.mini-info,
.alert {
  border-radius: 1rem;
  animation: rise-in 0.4s ease;
}

.card {
  border: 1px solid rgba(219, 179, 98, 0.28) !important;
  background:
    linear-gradient(180deg, #fffefb 0%, #fff9ee 100%);
  box-shadow: var(--shadow-soft);
}

.card-header {
  border-bottom: 1px solid rgba(205, 160, 73, 0.22) !important;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.9), rgba(255, 246, 229, 0.65)) !important;
}

.stat-card {
  background:
    linear-gradient(155deg, #fffdf8 0%, #fff4dc 100%);
  border: 1px solid rgba(205, 160, 73, 0.28);
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.stat-label {
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 600;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-dark);
}

.stat-value-sm {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.mini-info {
  background: linear-gradient(135deg, #fffdf8 0%, #fff5df 100%);
  border: 1px dashed rgba(193, 149, 65, 0.45);
  padding: 0.82rem;
  font-size: 0.95rem;
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
  border-color: rgba(208, 165, 84, 0.19);
}

.table thead th {
  color: #5f471d;
  font-weight: 700;
  background: linear-gradient(180deg, #fff5dc 0%, #fce9bf 100%);
  border-bottom-width: 1px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(255, 234, 186, 0.35);
}

.form-label {
  color: #6e5528;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-radius: 0.72rem;
  border: 1px solid rgba(199, 156, 72, 0.36);
  background-color: #fffcf6;
  color: #3a2d16;
}

.form-control::placeholder {
  color: #aa9160;
}

.form-control:focus,
.form-select:focus {
  border-color: #c7963e;
  box-shadow: 0 0 0 0.22rem var(--ring);
  background-color: #fffdfa;
}

.form-check-input:checked {
  background-color: #b8872f;
  border-color: #b8872f;
}

.badge {
  padding: 0.5em 0.7em;
  border-radius: 0.55rem;
  font-weight: 700;
}

.thumb-preview {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 0.7rem;
  border: 1px solid rgba(202, 160, 80, 0.45);
  box-shadow: 0 10px 18px -14px rgba(94, 71, 26, 0.5);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.timeline-item {
  padding: 0.8rem;
  border: 1px solid rgba(205, 162, 79, 0.28);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #fffdf8 0%, #fff6e3 100%);
}

.btn {
  border-radius: 0.72rem;
  font-weight: 700;
  padding-inline: 0.95rem;
}

.btn-primary {
  --bs-btn-color: #2f2413;
  --bs-btn-bg: linear-gradient(140deg, #f2d38f 0%, #d3a84d 100%);
  --bs-btn-border-color: #c69840;
  --bs-btn-hover-color: #1f180d;
  --bs-btn-hover-bg: linear-gradient(140deg, #f6dfaa 0%, #dfb55e 100%);
  --bs-btn-hover-border-color: #b88934;
  --bs-btn-active-bg: #c6963b;
  --bs-btn-active-border-color: #b6842f;
  background-image: linear-gradient(140deg, #f2d38f 0%, #d3a84d 100%);
  box-shadow: 0 12px 24px -14px rgba(177, 124, 22, 0.75);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-outline-primary {
  --bs-btn-color: #8d6724;
  --bs-btn-border-color: #be9040;
  --bs-btn-hover-bg: #f7e2b2;
  --bs-btn-hover-border-color: #be9040;
  --bs-btn-hover-color: #5d4316;
}

.btn-light {
  --bs-btn-bg: #fff9ee;
  --bs-btn-border-color: #edd8b0;
  --bs-btn-hover-bg: #fff2d9;
  --bs-btn-hover-border-color: #dfc28a;
}

.btn-outline-danger,
.btn-outline-secondary,
.btn-outline-success {
  border-width: 1px;
}

.pagination .page-link {
  color: #7c5b22;
  border-color: rgba(200, 157, 75, 0.34);
  background-color: #fff8ea;
}

.pagination .page-item.active .page-link {
  color: #2d220f;
  border-color: #cd9c45;
  background: linear-gradient(140deg, #f3d797, #d2a74d);
}

.alert-success {
  background-color: #f8f3e4;
  border-color: #e6d1a4;
  color: #5c481f;
}

.alert-danger {
  background-color: #fff0ec;
}

.alert-warning {
  background-color: #fff7df;
}

canvas {
  max-height: 340px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    inset-inline-start: -292px;
    top: 0;
    transition: inset-inline-start 0.28s ease;
  }

  .sidebar.open {
    inset-inline-start: 0;
  }

  .content-wrap {
    width: 100%;
  }

  .content-area {
    padding: 1rem;
  }

  .topbar {
    padding: 0.75rem 0.95rem;
  }
}
