/* =========================================================
   SCB BONUS DOUBLE & NOT YET BY CAH ALI
   SIGNATURE THEME — FOREST / CHAMPAGNE / COPPER
   Responsive dashboard
   ========================================================= */

:root {
  --bg: #111714;
  --surface: #1c2620;
  --surface-2: #26342b;
  --text: #f3efdf;
  --muted: #b1b9a8;
  --border: rgba(202, 192, 151, .19);
  --accent: #d7c69b;
  --jade: #9ebba2;
  --copper: #c48d6c;
  --cream: #f1e5c5;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse at 5% 0%, rgba(92, 131, 100, .19), transparent 34%),
    radial-gradient(ellipse at 96% 12%, rgba(176, 111, 75, .12), transparent 30%),
    radial-gradient(ellipse at 52% 100%, rgba(175, 161, 112, .07), transparent 40%),
    linear-gradient(135deg, #111714, #19221c 48%, #111613);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(213, 202, 165, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213, 202, 165, .025) 1px, transparent 1px);
  background-size: 48px 48px;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   HEADER — CENTERED
   ========================================================= */

.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 158px;
  margin: 0;
  padding: 30px 20px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(138, 159, 112, .19), transparent 65%),
    linear-gradient(110deg, #1b2a22 0%, #29372b 32%, #342f24 68%, #1a241e 100%);
  border-bottom: 1px solid rgba(210, 190, 139, .28);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .16);
}

.header::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
  background: linear-gradient(
    90deg,
    #66846d,
    #c0b181 24%,
    #eadbb2 50%,
    #bb8464 76%,
    #66846d
  );
}

.header::after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(520px, 75%);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(224, 205, 157, .65), transparent);
  transform: translateX(-50%);
}

.header-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.header h1 {
  margin: 0;
  color: #f4e9ce;
  font-size: clamp(21px, 2.4vw, 31px);
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: 1px;
  text-align: center;
  text-shadow: 0 2px 20px rgba(215, 198, 155, .12);
}

.header p {
  max-width: 720px;
  margin: 12px auto 0;
  color: #c3cbbb;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .55px;
  text-align: center;
}

.header-glow {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 50%;
  width: 170px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d7c69b, transparent);
  transform: translateX(-50%);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.container {
  width: 100%;
  max-width: 1900px;
  margin: 0 auto;
  padding: 24px clamp(15px, 2.4vw, 36px) 36px;
}

/* =========================================================
   GENERAL PANELS
   ========================================================= */

.panel {
  position: relative;
  margin: 0 0 20px;
  padding: 21px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(34, 48, 39, .97), rgba(24, 33, 27, .98) 58%, rgba(42, 39, 30, .95));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  color: #e9e2cf;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.panel-title::before {
  width: 4px;
  height: 19px;
  flex-shrink: 0;
  content: "";
  background: linear-gradient(180deg, #e1d0a5, #9ebba2, #c48d6c);
  border-radius: 4px;
}

.panel-title::after {
  flex: 1;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(202, 192, 151, .28), transparent);
}

/* =========================================================
   INPUT AREA
   ========================================================= */

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.input-card {
  min-width: 0;
  padding: 16px;
  background: rgba(13, 20, 16, .48);
  border: 1px solid rgba(178, 190, 157, .16);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input-card:focus-within {
  border-color: rgba(201, 194, 151, .52);
  box-shadow: 0 0 0 3px rgba(201, 194, 151, .04);
}

.input-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 13px;
  color: #e3e2cf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
}

.input-card h3::before {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  content: "";
  background: linear-gradient(135deg, #a9c4a2, #e0d0a5);
  border-radius: 50%;
}

.input-card:nth-child(2) h3::before {
  background: linear-gradient(135deg, #c48d6c, #e5d2a3);
}

.input-card textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  height: 180px;
  padding: 14px;
  resize: vertical;
  color: #e4e8d9;
  background: #101713;
  border: 1px solid rgba(174, 187, 154, .18);
  border-radius: 9px;
  outline: none;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input-card textarea::placeholder {
  color: #788579;
}

.input-card textarea:focus {
  border-color: rgba(190, 194, 151, .6);
  box-shadow: 0 0 14px rgba(190, 194, 151, .05);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.btn-primary,
.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 11px 22px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn-primary {
  color: #20271e;
  background: linear-gradient(115deg, #e2d2a7, #b8c7a4 48%, #c99a78);
  border: 1px solid rgba(235, 218, 173, .4);
  box-shadow: 0 5px 18px rgba(174, 157, 111, .10);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(174, 157, 111, .18);
}

.btn-secondary {
  color: #d7dacb;
  background: linear-gradient(120deg, #2a3a30, #343126);
  border: 1px solid rgba(185, 185, 146, .22);
}

.btn-secondary:hover {
  color: #fff2d5;
  background: linear-gradient(120deg, #384b3b, #453b2d);
  border-color: rgba(208, 190, 141, .42);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(.98);
}

/* =========================================================
   KPI CARDS
   ========================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 21px;
}

.kpi-card {
  --accent: #a9c4a2;
  position: relative;
  min-width: 0;
  min-height: 125px;
  padding: 19px 17px;
  overflow: hidden;
  background: linear-gradient(145deg, #293d30, #1d2b23 68%, #272d24);
  border: 1px solid rgba(169, 196, 162, .25);
  border-radius: 13px;
  box-shadow: inset 0 0 25px rgba(190, 177, 131, .025);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.kpi-card:nth-child(1) {
  --accent: #a9c4a2;
  background: linear-gradient(140deg, #2d4434, #1d2d24 72%, #253329);
}

.kpi-card:nth-child(2) {
  --accent: #ddc99a;
  background: linear-gradient(140deg, #453b2d, #2b2c24 72%, #393126);
}

.kpi-card:nth-child(3) {
  --accent: #d0a087;
  background: linear-gradient(140deg, #45362e, #2d2923 72%, #382e27);
}

.kpi-card:nth-child(4) {
  --accent: #b6c8a5;
  background: linear-gradient(140deg, #304438, #202f28 72%, #29332a);
}

.kpi-card:nth-child(5) {
  --accent: #d9cba6;
  background: linear-gradient(140deg, #433e2e, #292d25 72%, #363126);
}

.kpi-card::before {
  position: absolute;
  top: 0;
  left: 13px;
  right: 13px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.kpi-card::after {
  position: absolute;
  right: -35px;
  bottom: -45px;
  width: 110px;
  height: 110px;
  content: "";
  pointer-events: none;
  background: var(--accent);
  opacity: .055;
  filter: blur(34px);
  border-radius: 50%;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .14);
}

.kpi-card span {
  position: relative;
  z-index: 1;
  display: block;
  color: #c4cbbb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: .65px;
}

.kpi-card h2 {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: #f3eddb;
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -.7px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   RESULTS GRID
   ========================================================= */

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding-bottom: 12px;
}

.result-card {
  --accent: #a9c4a2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 300px;
  max-height: 480px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #24342a, #19231d 65%, #292b23);
  border: 1px solid rgba(174, 184, 146, .18);
  border-radius: 13px;
  box-shadow: 0 9px 25px rgba(0, 0, 0, .12);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.result-card:nth-child(1) {
  --accent: #a9c4a2;
}

.result-card:nth-child(2) {
  --accent: #d9bd83;
}

.result-card:nth-child(3) {
  --accent: #c99a78;
}

.result-card:nth-child(4) {
  --accent: #b8c7a4;
}

.result-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .15);
}

.result-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 54px;
  margin: 0;
  padding: 15px 18px;
  color: #e9e2cf;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 85%);
  border-bottom: 1px solid rgba(177, 184, 145, .14);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .65px;
}

.result-title::before {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  content: "";
  background: var(--accent);
  border-radius: 3px;
}

.result-title::after {
  flex: 1;
  max-width: 70px;
  height: 1px;
  margin-left: auto;
  content: "";
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
}

.result-list {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* =========================================================
   RESULT ITEMS
   ========================================================= */

.result-item,
.user-item {
  display: block;
  margin: 0 0 7px;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  color: #e0e5d7;
  background: rgba(180, 192, 160, .045);
  border: 1px solid rgba(180, 192, 160, .10);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
  transition: background .18s ease, border-color .18s ease;
}

.result-item:last-child,
.user-item:last-child {
  margin-bottom: 0;
}

.result-item:hover,
.user-item:hover {
  background: color-mix(in srgb, var(--accent, #a9c4a2) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent, #a9c4a2) 30%, transparent);
}

/* =========================================================
   TABLE SUPPORT
   ========================================================= */

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.table-container {
  max-width: 100%;
  max-height: 500px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

th {
  padding: 12px;
  color: #f0e6ce;
  background: linear-gradient(110deg, #394532, #493a2d);
  text-align: left;
  font-size: 12px;
}

td {
  padding: 11px 12px;
  color: #dce2d5;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  font-size: 12px;
}

tbody tr:nth-child(even) {
  background: rgba(180, 192, 160, .035);
}

/* =========================================================
   SCROLLBARS
   ========================================================= */

* {
  scrollbar-width: thin;
  scrollbar-color: #71806b #151d18;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #151d18;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8d9b7a, #a78969);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c7c49a, #c48d6c);
}

::selection {
  color: #fff;
  background: rgba(131, 153, 112, .5);
}

/* =========================================================
   COUNTER ANIMATION
   ========================================================= */

.counter-finish {
  animation: counterFinish .7s ease;
}

@keyframes counterFinish {
  0%, 100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
    text-shadow: 0 0 18px rgba(217, 198, 145, .35);
  }
}

/* =========================================================
   RESPONSIVE — LAPTOP
   ========================================================= */

@media (max-width: 1250px) {
  .container {
    padding: 20px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-card {
    min-height: 112px;
  }
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 800px) {
  .header {
    min-height: 135px;
    padding: 24px 18px;
  }

  .header h1 {
    font-size: 23px;
  }

  .container {
    padding: 15px;
  }

  .panel {
    padding: 15px;
  }

  .input-grid {
    gap: 12px;
  }

  .input-card {
    padding: 12px;
  }

  .input-card textarea {
    height: 165px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .kpi-card {
    min-height: 105px;
    padding: 15px;
  }

  .kpi-card h2 {
    font-size: 26px;
  }

  .result-grid {
    gap: 12px;
  }

  .result-card {
    min-height: 270px;
    max-height: 420px;
  }
}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 560px) {
  .header {
    min-height: 120px;
    padding: 23px 14px;
  }

  .header h1 {
    font-size: 19px;
    letter-spacing: .45px;
  }

  .header p {
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: .2px;
  }

  .container {
    padding: 12px 10px 22px;
  }

  .panel {
    margin-bottom: 13px;
    padding: 12px;
    border-radius: 11px;
  }

  .panel-title {
    margin-bottom: 13px;
    font-size: 11px;
  }

  .input-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .input-card textarea {
    height: 150px;
    min-height: 120px;
    font-size: 11px;
  }

  .button-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 41px;
    padding: 10px 13px;
    font-size: 11px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 13px;
  }

  .kpi-card {
    min-height: 98px;
    padding: 13px 11px;
    border-radius: 10px;
  }

  .kpi-card span {
    font-size: 9px;
    letter-spacing: .35px;
  }

  .kpi-card h2 {
    margin-top: 9px;
    font-size: clamp(20px, 6vw, 26px);
  }

  .result-grid,
  .preview-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .result-card {
    min-height: 245px;
    max-height: 360px;
  }

  .result-title {
    min-height: 48px;
    padding: 13px;
    font-size: 11px;
  }

  .result-list {
    padding: 10px;
  }

  .result-item,
  .user-item {
    padding: 10px;
    font-size: 11px;
  }
}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 350px) {
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .button-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .header h1 {
    font-size: 17px;
  }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}