/* ============================================================
   Bento Costing Dashboard CSS — PT. Citra Talenta Texindo
============================================================ */

:root {
  --bg-main: #F8FAFC;
  --navy: #0F172A;
  --teal-600: #0D9488;
  --teal-700: #0F766E;
  --teal-50: #F0FDF4;
  --emerald-500: #10B981;
  --emerald-600: #059669;
  --emerald-50: #ECFDF5;
  --sky-500: #0284C7;
  --sky-50: #F0F9FF;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 1.75rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-bento: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-bento-hover: 0 20px 40px -10px rgba(15, 23, 42, 0.09), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 12px 28px -6px rgba(13, 148, 136, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--slate-800);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background Bloblets */
.bg-blob-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -10;
}

.bg-blob-1 {
  position: absolute;
  top: -8rem;
  left: -5rem;
  width: 26rem;
  height: 26rem;
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.45), rgba(204, 251, 241, 0.35));
  border-radius: 9999px;
  filter: blur(50px);
}

.bg-blob-2 {
  position: absolute;
  top: 33%;
  right: -7rem;
  width: 34rem;
  height: 34rem;
  background: linear-gradient(225deg, rgba(224, 242, 254, 0.45), rgba(240, 253, 244, 0.35));
  border-radius: 9999px;
  filter: blur(64px);
}

.bg-blob-grid {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: radial-gradient(#0f172a 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Header */
.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.03);
}

.header-wrap {
  height: 5rem;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 82rem;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .header-wrap {
    padding: 0 2.5rem;
  }
}

.brand-logo-wrap {
  height: 3.5rem;
  padding: 0.4rem 0.875rem;
  border-radius: 1rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo-wrap:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
}

.brand-logo-img {
  height: 2.5rem;
  width: auto;
  max-width: 4.5rem;
  object-fit: contain;
  display: block;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 0.875rem;
  color: var(--slate-500);
  font-weight: 600;
}

/* Layout */
main {
  width: 100%;
  padding-top: 6.5rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - 5rem);
}

.main-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 1.5rem;
  gap: 1.75rem;
  max-width: 82rem;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .main-container {
    padding: 0 2.5rem;
  }
}

/* Top Bar Card */
.topbar-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: white;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-bento);
}

@media (min-width: 1024px) {
  .topbar-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.page-headline {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subheadline {
  font-size: 0.9375rem;
  color: var(--slate-500);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 1280px) {
  .bento-grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .bento-col-left {
    grid-column: span 6 / span 6;
  }

  .bento-col-right {
    grid-column: span 6 / span 6;
  }
}

.bento-column {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Bento Card Base */
.bento-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-bento);
  border: 1px solid var(--slate-200);
  transition: all 0.25s ease;
  position: relative;
}

@media (min-width: 1024px) {
  .bento-card {
    padding: 2rem;
  }
}

.bento-card:hover {
  box-shadow: var(--shadow-bento-hover);
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--slate-100);
}

.card-step-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--teal-50);
  color: var(--teal-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
}

.card-title {
  font-size: 1.25rem;
  color: var(--slate-900);
  font-weight: 800;
}

/* Form Controls */
.input-label {
  display: block;
  font-size: 0.9375rem;
  color: var(--slate-700);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.input-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-box-wrap .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--slate-400);
  width: 1.375rem;
  height: 1.375rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  background: #F8FAFC;
  color: var(--slate-900);
  padding: 0.875rem 1rem 0.875rem 3rem;
  border-radius: var(--radius-lg);
  font-size: 1.0625rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--slate-300);
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus {
  background: white;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3.5px rgba(13, 148, 136, 0.15);
}

.input-suffix {
  position: absolute;
  right: 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--teal-700);
  background: var(--teal-50);
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid #a7f3d0;
}

/* Quick Chips */
.chip-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.chip-btn {
  flex: 1;
  min-width: 4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: white;
  color: var(--slate-700);
  font-weight: 700;
  font-size: 0.875rem;
  border: 1.5px solid var(--slate-300);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: var(--slate-100);
  border-color: var(--slate-400);
}

.chip-btn.active {
  background: var(--teal-600);
  color: white;
  border-color: var(--teal-600);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.625rem;
  background: var(--slate-200);
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--teal-600);
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Bento Hero Recommendation Card */
.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #a7f3d0 0%, #2dd4bf 50%, #0284c7 100%);
  color: var(--slate-900);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  box-shadow: 0 20px 40px -10px rgba(13, 148, 136, 0.25);
  border: 1px solid rgba(204, 251, 241, 0.8);
}

@media (min-width: 1024px) {
  .hero-card {
    padding: 2rem;
  }
}

.hero-display-box {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.hero-price-val {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.375rem 0;
}

@media (min-width: 1024px) {
  .hero-price-val {
    font-size: 3.5rem;
  }
}

/* Bottom Line Strip (No wrap & clean weight) */
.bottom-line-strip {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xl);
  background: rgba(236, 253, 245, 0.98);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1.5px solid #a7f3d0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.bottom-line-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #064e3b;
  line-height: 1.3;
}

.bottom-line-val {
  font-size: 1.375rem;
  font-weight: 800;
  color: #065f46;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* Multi Segment Bar */
.progress-bar-wrap {
  height: 1.25rem;
  width: 100%;
  background: var(--slate-200);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  padding: 2px;
}

.progress-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.progress-seg.seg-modal {
  background: #38bdf8;
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}

.progress-seg.seg-margin {
  background: #34d399;
}

.progress-seg.seg-ppn {
  background: #14b8a6;
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}

/* Financial Waterfall Table */
.waterfall-table {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--slate-200);
  background: white;
}

.waterfall-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--slate-100);
  transition: background-color 0.15s ease;
}

.waterfall-row:last-child {
  border-bottom: none;
}

.waterfall-row:hover {
  background-color: var(--slate-50);
}

.waterfall-row.hl-green {
  background-color: rgba(236, 253, 245, 0.8);
}

.waterfall-row.hl-green:hover {
  background-color: var(--emerald-50);
}

/* Action Buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-xl);
  font-size: 0.9375rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-action:active {
  transform: scale(0.97);
}

.btn-primary-teal {
  background: var(--teal-600);
  color: white;
  box-shadow: var(--shadow-pop);
}

.btn-primary-teal:hover {
  background: var(--teal-700);
}

.btn-dark {
  background: var(--slate-900);
  color: #ecfdf5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-dark:hover {
  background: #1e293b;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.7);
  color: var(--slate-900);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: white;
}

.btn-slate {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

.btn-slate:hover {
  background: var(--slate-200);
}

/* SVG Icon Helper */
.svg-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--slate-900);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(6rem);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-wrap.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* History Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 52rem;
  max-height: 90vh;
  border-radius: var(--radius-2xl);
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* History Table */
.history-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.history-table th {
  background: var(--slate-900);
  color: white;
  padding: 0.875rem 1.125rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.history-table td {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  white-space: nowrap;
}

.history-table tr:hover td {
  background: var(--slate-50);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.625rem;
  color: var(--slate-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--slate-100);
  color: var(--slate-800);
}

.icon-btn.btn-view {
  color: var(--teal-600);
}

.icon-btn.btn-view:hover {
  background: var(--teal-50);
}

.icon-btn.btn-del {
  color: #ef4444;
}

.icon-btn.btn-del:hover {
  background: #fef2f2;
}

/* ============================================================
   Mobile & Tablet Responsive Adjustments
============================================================ */
@media (max-width: 768px) {
  .header-wrap {
    height: auto;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-title {
    font-size: 1.0625rem;
  }

  .header-subtitle {
    font-size: 0.75rem;
  }

  main {
    padding-top: 5.5rem;
    padding-bottom: 2rem;
  }

  .main-container {
    padding: 0 0.875rem;
    gap: 1.25rem;
  }

  .topbar-card {
    padding: 1.125rem 1.25rem;
    border-radius: var(--radius-xl);
  }

  .page-headline {
    font-size: 1.375rem;
  }

  .bento-card {
    padding: 1.25rem;
    border-radius: var(--radius-xl);
  }

  .hero-card {
    padding: 1.25rem;
    border-radius: var(--radius-xl);
  }

  .hero-price-val {
    font-size: 2rem;
    word-break: break-all;
  }

  .hero-display-box {
    margin: 1rem 0;
    padding: 1rem;
  }

  .chip-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .chip-btn {
    min-width: unset;
    padding: 0.45rem 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .btn-action {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .waterfall-row {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .modal-card {
    margin: 0.5rem;
    max-height: 94vh;
    border-radius: var(--radius-xl);
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-price-val {
    font-size: 1.625rem;
  }

  .chip-group {
    grid-template-columns: repeat(3, 1fr);
  }

  .waterfall-row span:first-child {
    font-size: 0.75rem;
  }

  .waterfall-row span:last-child {
    font-size: 0.8125rem;
    font-weight: 800;
  }
}

