/*
 * ╔══════════════════════════════════════════════════════════╗
 * ║  ui-upgrade.css — Papa'Oy POS Premium UI Layer v3      ║
 * ║  RULE: Zero color overrides. Layout + Font + Animation  ║
 * ╚══════════════════════════════════════════════════════════╝
 */

/* ════════════════════════════════════════
   FONT — Inter upgrade
   ════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

body,
input, select, textarea, button,
.btn, .fi, .fsel, .si-inp, .fl, .ct, .mt,
.tb-pt, .tb-pb, .sc-lb, .sc-v, .dt {
  font-family: 'Inter', 'Nunito', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ════════════════════════════════════════
   LAYOUT — Fix gap sidebar & konten
   ════════════════════════════════════════ */

/* INTI: main content tidak double-offset */
.main {
  margin-left: var(--nav-w) !important;
  width: calc(100% - var(--nav-w)) !important;
  max-width: calc(100% - var(--nav-w)) !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

body {
  overflow-x: hidden !important;
}

.con, .content {
  padding: 18px 22px !important;
  box-sizing: border-box !important;
}

.topbar {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Tablet 769–1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --nav-w: 190px !important; }
  .main {
    margin-left: 190px !important;
    width: calc(100% - 190px) !important;
    max-width: calc(100% - 190px) !important;
  }
  .con, .content { padding: 14px 16px !important; }
  .sg, .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .topbar { padding: 0 16px !important; }
}

/* Mobile ≤768px */
@media (max-width: 768px) {
  :root { --nav-w: 0px !important; }
  .sb {
    width: 240px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 400 !important;
  }
  .sb.open { transform: translateX(0) !important; }
  .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .con, .content { padding: 12px 14px !important; }
  .sg, .stats-row { grid-template-columns: 1fr 1fr !important; }
  .topbar { padding: 0 14px !important; height: 50px !important; }
}

/* Small mobile ≤480px */
@media (max-width: 480px) {
  .sg, .stats-row { grid-template-columns: 1fr 1fr !important; }
  .con, .content { padding: 10px 12px !important; }
}

/* Large desktop ≥1440px */
@media (min-width: 1440px) {
  :root { --nav-w: 220px !important; }
  .main {
    margin-left: 220px !important;
    width: calc(100% - 220px) !important;
    max-width: calc(100% - 220px) !important;
  }
  .sg, .stats-row { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ════════════════════════════════════════
   VISUAL — Border radius & shadow premium
   (tidak menyentuh warna sama sekali)
   ════════════════════════════════════════ */

.sc, .card, .menu-card, .stat-card {
  border-radius: 12px !important;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.2s cubic-bezier(0.4,0,0.2,1) !important;
}

.sc:hover, .card:hover, .menu-card:hover, .stat-card:hover {
  transform: translateY(-2px) !important;
}

.btn {
  border-radius: 8px !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
}

.mod, .modal-content {
  border-radius: 14px !important;
  animation: modalIn 0.22s cubic-bezier(0.34,1.36,0.64,1) !important;
}

@keyframes modalIn {
  from { opacity:0; transform: translateY(14px) scale(0.97); }
  to   { opacity:1; transform: none; }
}

.fi, .fsel, .si-inp, .search-input, .filter-select {
  border-radius: 8px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.bd, .badge {
  border-radius: 100px !important;
}

.toast {
  border-radius: 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

/* ════════════════════════════════════════
   ANIMATION — Entrance effects
   ════════════════════════════════════════ */

.sg .sc:nth-child(1),
.stats-row .stat-card:nth-child(1) { animation: cardUp 0.35s ease both 0.05s; }
.sg .sc:nth-child(2),
.stats-row .stat-card:nth-child(2) { animation: cardUp 0.35s ease both 0.10s; }
.sg .sc:nth-child(3),
.stats-row .stat-card:nth-child(3) { animation: cardUp 0.35s ease both 0.15s; }
.sg .sc:nth-child(4),
.stats-row .stat-card:nth-child(4) { animation: cardUp 0.35s ease both 0.20s; }

@keyframes cardUp {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: none; }
}

.ni:hover { transform: translateX(2px); }

/* ════════════════════════════════════════
   SCROLLBAR — Slim style
   ════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bdr2, #93C5FD); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ind2, #2563EB); }

/* ════════════════════════════════════════
   MOBILE OVERLAY & HAMBURGER BUTTON
   ════════════════════════════════════════ */

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 399;
  backdrop-filter: blur(3px);
}
.sb-overlay.show {
  display: block;
  animation: ovlIn 0.2s ease;
}
@keyframes ovlIn {
  from { opacity:0; }
  to   { opacity:1; }
}

.mob-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .mob-toggle { display: flex !important; }
}

/* ════════════════════════════════════════
   INPUT TEXT FIX — Dark Mode
   Semua input/form field terbaca di dark mode
   ════════════════════════════════════════ */

/*
 * Masalah: beberapa file tidak punya dark mode CSS untuk input,
 * dan banyak input menggunakan background:#fff hardcoded saat focus.
 * Fix ini memastikan SEMUA input terbaca di dark mode.
 */

html[data-theme="dark"] input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #111E38 !important;
  color: #E8F0FF !important;
  border-color: #1E3050 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #4A6080 !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] input[type="tel"]:focus,
html[data-theme="dark"] input[type="search"]:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  background: #1A2840 !important;
  color: #E8F0FF !important;
  border-color: #3B82F6 !important;
  outline: none !important;
}

/* Semua class-class input yang dipakai di project */
html[data-theme="dark"] .fi,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .fsel,
html[data-theme="dark"] .si-inp,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .search-inp,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .var-input,
html[data-theme="dark"] .prefix-input,
html[data-theme="dark"] .bayar-input,
html[data-theme="dark"] .verif-input {
  background: #111E38 !important;
  color: #E8F0FF !important;
  border-color: #1E3050 !important;
}

html[data-theme="dark"] .fi::placeholder,
html[data-theme="dark"] .form-input::placeholder,
html[data-theme="dark"] .si-inp::placeholder,
html[data-theme="dark"] .search-input::placeholder,
html[data-theme="dark"] .search-inp::placeholder,
html[data-theme="dark"] .var-input::placeholder,
html[data-theme="dark"] .prefix-input::placeholder,
html[data-theme="dark"] .bayar-input::placeholder,
html[data-theme="dark"] .verif-input::placeholder {
  color: #4A6080 !important;
}

html[data-theme="dark"] .fi:focus,
html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .fsel:focus,
html[data-theme="dark"] .si-inp:focus,
html[data-theme="dark"] .search-input:focus,
html[data-theme="dark"] .search-inp:focus,
html[data-theme="dark"] .filter-select:focus,
html[data-theme="dark"] .var-input:focus,
html[data-theme="dark"] .prefix-input:focus,
html[data-theme="dark"] .bayar-input:focus,
html[data-theme="dark"] .verif-input:focus,
html[data-theme="dark"] .form-input-prefix:focus-within {
  background: #1A2840 !important;
  color: #E8F0FF !important;
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
}

/* Label form tetap terbaca */
html[data-theme="dark"] .fl,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .var-input-label {
  color: #A8BDD8 !important;
}

/* Prefix Rp tetap terbaca */
html[data-theme="dark"] .prefix {
  background: #1A2840 !important;
  color: #A8BDD8 !important;
  border-right-color: #1E3050 !important;
}

/* Variant item background */
html[data-theme="dark"] .variant-item {
  background: #111E38 !important;
  border-color: #1E3050 !important;
  color: #E8F0FF !important;
}

/* Modal form fields */
html[data-theme="dark"] .mb input,
html[data-theme="dark"] .mb select,
html[data-theme="dark"] .mb textarea,
html[data-theme="dark"] .modal-body input,
html[data-theme="dark"] .modal-body select,
html[data-theme="dark"] .modal-body textarea {
  background: #111E38 !important;
  color: #E8F0FF !important;
  border-color: #1E3050 !important;
}

/* Table dalam dark mode tetap terbaca */
html[data-theme="dark"] table,
html[data-theme="dark"] .dt tbody td,
html[data-theme="dark"] .dt tbody tr {
  color: #C8D8F0 !important;
}

html[data-theme="dark"] .dt thead th {
  color: #8890CC !important;
  background: #13133A !important;
}

html[data-theme="dark"] .dt tbody tr:hover {
  background: #111E38 !important;
}
