
/* =========================================================
   PRINTPEDIA POS — MODERN UI OVERRIDE
   Visual-only layer. Role / permission attributes unchanged.
   ========================================================= */

:root{
  --ui-bg:#f4f6f8;
  --ui-card:#ffffff;
  --ui-soft:#f8fafc;
  --ui-border:#e7eaf0;
  --ui-border-strong:#d7dce5;
  --ui-text:#111827;
  --ui-muted:#6b7280;
  --ui-dark:#111827;
  --ui-dark-hover:#1f2937;
  --ui-danger:#dc2626;
  --ui-success:#15803d;
  --ui-radius:14px;
  --ui-radius-sm:10px;
  --ui-shadow:0 8px 24px rgba(15,23,42,.055);
}

*{box-sizing:border-box}
html{background:var(--ui-bg)}
body{
  background:var(--ui-bg)!important;
  color:var(--ui-text)!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  -webkit-font-smoothing:antialiased;
}

.container{
  width:min(1180px,calc(100% - 36px))!important;
  max-width:1180px!important;
  margin-inline:auto!important;
}

/* ----- top area ----- */
header,.header{
  background:transparent!important;
}

header{
  padding:20px 0!important;
  margin-bottom:18px!important;
  border-bottom:1px solid var(--ui-border)!important;
}

.header{
  padding:6px 0 18px!important;
  margin-bottom:22px!important;
  border-bottom:1px solid var(--ui-border)!important;
}

.header h1,header h1{
  margin:0!important;
  color:var(--ui-text)!important;
  font-size:26px!important;
  line-height:1.15!important;
  letter-spacing:-.025em!important;
}

.header p,header p{
  color:var(--ui-muted)!important;
  margin-top:5px!important;
}

.dashboard-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.dashboard-logo{
  width:42px;
  height:42px;
  object-fit:contain;
  flex:0 0 42px;
}

.dashboard-brand-copy{
  min-width:0;
}

.header-buttons,.buttons{
  display:flex!important;
  gap:8px!important;
  align-items:center!important;
  flex-wrap:wrap!important;
}

.user-email{
  color:var(--ui-muted)!important;
  font-size:11px!important;
}

/* ----- buttons ----- */
button,.button,.save-button{
  border-radius:9px!important;
  font-family:inherit!important;
  font-weight:650!important;
  box-shadow:none!important;
  transition:background .15s ease,border-color .15s ease,transform .05s ease!important;
}

button:active,.button:active,.save-button:active{transform:translateY(1px)}

.button,
header button,
.section-header button,
.save-button{
  background:var(--ui-dark)!important;
  color:#fff!important;
  border:1px solid var(--ui-dark)!important;
}

.button:hover,
header button:hover,
.section-header button:hover,
.save-button:hover{
  background:var(--ui-dark-hover)!important;
  border-color:var(--ui-dark-hover)!important;
}

.button-logout{background:var(--ui-danger)!important;border-color:var(--ui-danger)!important}

/* ----- cards / sections ----- */
.card,.section{
  background:var(--ui-card)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:var(--ui-radius)!important;
  box-shadow:var(--ui-shadow)!important;
}

.card,.section{
  padding:22px!important;
}

.card h2,.section h2{
  color:var(--ui-text)!important;
  font-size:17px!important;
  line-height:1.25!important;
  letter-spacing:-.015em!important;
}

.cards{
  gap:14px!important;
  margin-bottom:22px!important;
}

.cards .card{
  padding:19px!important;
}

.card-title{
  color:var(--ui-muted)!important;
  font-size:11px!important;
  font-weight:650!important;
  text-transform:uppercase;
  letter-spacing:.035em;
  margin-bottom:8px!important;
}

.card-value{
  color:var(--ui-text)!important;
  font-size:25px!important;
  letter-spacing:-.03em;
}

/* ----- forms ----- */
label,.field-label{
  color:#374151!important;
  font-size:12px!important;
  font-weight:650!important;
}

input,select,textarea{
  background:#fff!important;
  border:1px solid var(--ui-border-strong)!important;
  border-radius:9px!important;
  color:var(--ui-text)!important;
  min-height:43px;
  outline:none!important;
  box-shadow:none!important;
}

input:focus,select:focus,textarea:focus{
  border-color:#9ca3af!important;
  box-shadow:0 0 0 3px rgba(156,163,175,.12)!important;
}

.form-grid,.payment-grid{
  gap:16px!important;
}

/* Customer + WhatsApp */
.whatsapp-inline{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:12px!important;
  width:100%!important;
}
.whatsapp-inline #phone{
  flex:1 1 auto!important;
  min-width:0!important;
  width:auto!important;
  margin:0!important;
}
.add-customer-inline{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:112px!important;
  height:43px!important;
  margin:0!important;
  padding:0 15px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
  background:var(--ui-dark)!important;
  color:#fff!important;
  border:1px solid var(--ui-dark)!important;
}

/* ----- tables ----- */
.table-wrapper,.product-table-wrapper{
  border:1px solid var(--ui-border)!important;
  border-radius:11px!important;
  background:#fff!important;
  overflow:auto!important;
}

table{
  background:#fff!important;
}

th{
  background:var(--ui-soft)!important;
  color:#64748b!important;
  border-bottom:1px solid var(--ui-border)!important;
  font-size:10px!important;
  font-weight:750!important;
  text-transform:uppercase;
  letter-spacing:.045em;
}

td{
  color:#374151!important;
  border-bottom:1px solid #eef1f5!important;
}

tbody tr:hover{background:#fbfcfd!important}
tbody tr:last-child td{border-bottom:none!important}

/* ----- invoice product grid ----- */
.product-table{
  min-width:0!important;
}
.product-header{
  background:var(--ui-soft)!important;
  border-bottom:1px solid var(--ui-border)!important;
}
.product-row{
  border-bottom:1px solid #eef1f5!important;
}
.product-row:last-child{border-bottom:0!important}
.delete-product{
  border-radius:8px!important;
}

/* ----- dashboard trend area ----- */
#grafikTren,.trend-container{
  margin-top:8px;
}
.trend-summary{
  border:1px solid var(--ui-border)!important;
  background:var(--ui-soft)!important;
  border-radius:11px!important;
  box-shadow:none!important;
}
.trend-table-wrap{
  border:1px solid var(--ui-border)!important;
  border-radius:11px!important;
  box-shadow:none!important;
}

/* ================= MOBILE ================= */
@media (max-width:700px){
  body{
    padding:0!important;
  }

  .container{
    width:calc(100% - 20px)!important;
  }

  header,.header{
    margin-bottom:14px!important;
    padding:14px 0!important;
    gap:10px!important;
  }

  header{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
  }

  .header{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
  }

  .header h1,header h1{
    font-size:21px!important;
  }

  .header p,header p{
    font-size:12px!important;
  }

  /* Keep nav compact: one horizontal row instead of a tall wrapped block */
  .header-buttons,.buttons{
    width:100%!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:7px!important;
    padding:2px 0 5px!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .header-buttons::-webkit-scrollbar,.buttons::-webkit-scrollbar{display:none}

  .header-buttons > *,
  .buttons > *{
    flex:0 0 auto!important;
  }

  .header-buttons .user-email,
  .buttons .user-email{
    display:none!important;
  }

  .header-buttons button,
  .buttons .button,
  .buttons button{
    width:auto!important;
    min-width:auto!important;
    padding:9px 12px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }

  .dashboard-brand{
    gap:10px;
  }
  .dashboard-logo{
    width:36px;
    height:36px;
    flex-basis:36px;
  }

  .card,.section{
    padding:16px!important;
    border-radius:12px!important;
    box-shadow:0 5px 18px rgba(15,23,42,.045)!important;
  }

  .card h2,.section h2{
    font-size:15px!important;
    margin-bottom:15px!important;
  }

  .cards{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    margin-bottom:14px!important;
  }

  .cards .card{
    padding:14px!important;
    min-width:0;
  }

  .cards .card:last-child:nth-child(odd){
    grid-column:1 / -1;
  }

  .card-title{
    font-size:9px!important;
    margin-bottom:5px!important;
  }

  .card-value{
    font-size:19px!important;
  }

  .form-grid,.payment-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  input,select,textarea{
    min-height:42px!important;
    font-size:14px!important;
  }

  /* WhatsApp remains one row, but compact */
  .whatsapp-inline{
    gap:8px!important;
  }
  .add-customer-inline{
    min-width:92px!important;
    height:42px!important;
    padding:0 10px!important;
    font-size:11px!important;
  }

  /* Product input becomes compact cards instead of a very wide table */
  .product-table-wrapper{
    border:0!important;
    overflow:visible!important;
    background:transparent!important;
  }

  .product-table{
    min-width:0!important;
  }

  .product-header{
    display:none!important;
  }

  .product-row{
    position:relative!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
    padding:14px!important;
    margin-bottom:10px!important;
    background:#fff!important;
    border:1px solid var(--ui-border)!important;
    border-radius:11px!important;
  }

  .product-row .field:first-child{
    grid-column:1 / -1!important;
  }

  .product-row .field-total{
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
  }

  .product-row .delete-product{
    position:absolute!important;
    right:8px!important;
    top:8px!important;
    width:30px!important;
    height:30px!important;
    min-height:30px!important;
    padding:0!important;
    font-size:18px!important;
  }

  .product-row .field:first-child{
    padding-right:34px!important;
  }

  .section-header{
    gap:10px!important;
  }

  .section-header button{
    padding:8px 10px!important;
    font-size:11px!important;
    white-space:nowrap;
  }

  .summary{
    margin-top:4px!important;
  }

  .summary-row{
    gap:12px!important;
    font-size:12px!important;
  }

  /* Dashboard/table pages already switch to cards. Make those cards lighter. */
  .table-wrapper{
    border:0!important;
    background:transparent!important;
  }

  .table-wrapper table tr{
    border:1px solid var(--ui-border)!important;
    border-radius:11px!important;
    box-shadow:none!important;
    margin-bottom:9px!important;
    padding:2px 11px!important;
  }

  .table-wrapper table td{
    padding:8px 0!important;
    font-size:12px!important;
  }

  .table-wrapper table td::before{
    font-size:10px!important;
    font-weight:700!important;
    text-transform:uppercase;
    letter-spacing:.035em;
  }

  .action{
    font-size:11px!important;
    padding:7px 9px!important;
    margin-bottom:4px!important;
  }

  /* Dashboard trend: don't make phone users scroll a huge chart */
  #grafikTren,.trend-container{
    overflow-x:auto!important;
    padding-bottom:2px;
  }
}

/* Very small phones */
@media (max-width:390px){
  .container{width:calc(100% - 16px)!important}
  .card,.section{padding:14px!important}
  .add-customer-inline{
    min-width:84px!important;
    padding:0 8px!important;
    font-size:10px!important;
  }
}

.invoice-page-title h1{
  margin:0;
  font-size:23px;
  line-height:1.15;
  letter-spacing:-.025em;
}
.invoice-page-title p{
  margin:4px 0 0;
  color:var(--ui-muted);
  font-size:12px;
}
@media (max-width:700px){
  .invoice-page-title h1{font-size:20px}
  .invoice-page-title p{display:none}
}


/* Discount amount / percentage selector */
.discount-input-group{
  display:grid;
  grid-template-columns:minmax(0,1fr) 64px;
  gap:7px;
  width:100%;
}
.discount-input-group input,
.discount-input-group select{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
}
.discount-input-group select{
  padding-left:9px!important;
  padding-right:7px!important;
  font-weight:700!important;
  text-align:center;
  cursor:pointer;
}

@media (max-width:700px){
  .discount-input-group{
    grid-template-columns:minmax(0,1fr) 58px;
    gap:6px;
  }
  .discount-input-group select{
    font-size:12px!important;
  }
}


/* Percentage-only discount */
.percent-input{
  position:relative;
  width:100%;
}
.percent-input input{
  width:100%!important;
  padding-right:38px!important;
  margin:0!important;
}
.percent-input span{
  position:absolute;
  right:13px;
  top:50%;
  transform:translateY(-50%);
  color:#6b7280;
  font-size:13px;
  font-weight:700;
  pointer-events:none;
}



/* ===== Dashboard header actions: original order, aligned right ===== */
body.dashboard-page .header{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:18px!important;
}

body.dashboard-page .header .buttons{
  margin-left:auto!important;
  display:flex!important;
  flex-direction:row!important;
  justify-content:flex-end!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  width:auto!important;
}

body.dashboard-page .header .buttons .button,
body.dashboard-page .header .buttons button{
  flex:0 0 auto!important;
  width:auto!important;
  min-height:38px!important;
  padding:9px 12px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}

@media (max-width:700px){
  body.dashboard-page .header{
    flex-direction:column!important;
    align-items:stretch!important;
  }

  body.dashboard-page .header .buttons{
    width:100%!important;
    margin-left:0!important;
    flex-direction:row!important;
    justify-content:flex-start!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    padding-bottom:5px!important;
  }
}

/* ===== Daftar Invoice action buttons ===== */
body.invoice-list-page .action-group,
body.invoice-list-page .actions,
body.invoice-list-page td[data-label="Aksi"]{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:6px!important;
}

body.invoice-list-page td[data-label="Aksi"] .action,
body.invoice-list-page td[data-label="Aksi"] button,
body.invoice-list-page td[data-label="Aksi"] a{
  width:auto!important;
  min-width:0!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:7px 10px!important;
  min-height:34px!important;
  border-radius:7px!important;
  font-size:11px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}

@media (max-width:700px){
  body.invoice-list-page .table-wrapper table tr{
    display:block!important;
    padding:10px 12px!important;
  }

  body.invoice-list-page td[data-label="Aksi"]{
    display:flex!important;
    flex-direction:row!important;
    justify-content:flex-start!important;
    flex-wrap:wrap!important;
    gap:6px!important;
    padding-top:10px!important;
  }

  body.invoice-list-page td[data-label="Aksi"]::before{
    width:100%!important;
    margin-bottom:2px!important;
  }

  body.invoice-list-page td[data-label="Aksi"] .action,
  body.invoice-list-page td[data-label="Aksi"] button,
  body.invoice-list-page td[data-label="Aksi"] a{
    flex:0 0 auto!important;
    width:auto!important;
    max-width:100%!important;
  }
}


/* Invoice list actions — compact and consistent */
body.invoice-list-page td[data-label="Aksi"]{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}

body.invoice-list-page td[data-label="Aksi"] > button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:0!important;
  height:32px!important;
  padding:0 9px!important;
  margin:0!important;
  border-radius:7px!important;
  font-size:10.5px!important;
  line-height:1!important;
  white-space:nowrap!important;
}

body.invoice-list-page .edit-btn{
  background:#111827!important;
  color:#fff!important;
  border:1px solid #111827!important;
}

@media (max-width:700px){
  body.invoice-list-page td[data-label="Aksi"]{
    padding-top:9px!important;
    gap:5px!important;
  }

  body.invoice-list-page td[data-label="Aksi"] > button{
    height:31px!important;
    padding:0 8px!important;
    font-size:10px!important;
  }
}
