/* ============ GLOBAL ============ */
* {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10pt;
}

/* ---------- SIDEBAR (setFixedWidth 400) ---------- */
QWidget#SidebarWidget {
    background-color: #34495e;
}

/* QWidget#SidebarWidget {
    background-color: qlineargradient(
        x1: 0, y1: 0, x2: 0, y2: 1,
        stop: 0 #196F3D,
        stop: 1 #145A32
    );
} */

QPushButton[menuButton="true"] {
    color: #ecf0f1;
    background: transparent;
    padding: 10px 20px;
    text-align: left;
    border: none;
}

QPushButton[menuButton="true"]:hover {
    background-color: #2c3e50;             /* hover sama seperti HTML */
}

QPushButton[menuButton="true"].active {     /* bisa di-toggle pakai setProperty("active", true) */
    background-color: #3498db;
    border-left: 4px solid #2980b9;
}

/* ---------- MAIN CONTENT ---------- */
QStackedWidget {
    background-color: #ecf0f1;
}

/* Kartu / panel putih */
QFrame[card="true"], QWidget[card="true"] {
    background: #ffffff;
    border-radius: 5px;
    padding: 15px;
    /* bayangan ringan simulasi */
    border: 1px solid rgba(0,0,0,0.05);
}

/* Card header */
QLabel[cardHeader="true"] {
    color: #2c3e50;
    font-weight: bold;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 6px;
}

/* ---------- BUTTON GENERIC ---------- */
QPushButton {
    min-height: 28px;
    min-width: 90px;
    border-radius: 4px;
    font-weight: 600;
}

/* edited by glg */
/* Tombol compact (contoh: Show/Hide password di login) tidak dipaksa min-width global. */
QPushButton[compactButton="true"] {
    min-width: 1px;
}

QPushButton[class~="primary"] {
    background: #3498db;
    color: #ffffff;
}

QPushButton[class~="danger"] {
    background: #e74c3c;
    color: #ffffff;
}

QPushButton[class~="success"] {
    background: #27ae60;
    color: #ffffff;
}

QPushButton:pressed {
    padding-left: 11px;                     /* kesan ditekan */
    padding-top: 1px;
}

/* ---------- TABLE ---------- */
QHeaderView::section {
    background: #2c3e50;
    color: #ffffff;
    padding: 6px;
    border: none;
}

QTableWidget QTableCornerButton::section {
    background: #2c3e50;
}

/* Row hover */
/* // edited by glg (05:22 WIB, 2026-02-06) */
/* // change: Ubah warna hover tabel agar tidak menjadi putih polos. */
/* // technical rationale: Warna hover #f5f5f5 menimpa warna baris dan terlihat putih mencolok. */
QTableWidget::item:hover {
    background: rgba(44, 62, 80, 0.08);
}

/* ---------- STATUS BADGE ---------- */
QLabel[status="completed"]  { background:#d4edda; color:#155724; padding:3px 6px; border-radius:3px; }
QLabel[status="pending"]    { background:#fff3cd; color:#856404; }
QLabel[status="cancelled"]  { background:#f8d7da; color:#721c24; }

/* ---------- LOGIN WINDOW (opsional) ---------- */
QWidget#LoginContainer {
    background: #ffffff;
    border-radius: 5px;
    padding: 30px;
    border: 1px solid rgba(0,0,0,0.08);
}

img.logo {
  display:block;
  margin:0 auto 6px auto;
  max-height:80px;
  max-width:200px;
}

QPushButton.barang-action {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 10px;
}
QPushButton.barang-action:hover {
    background-color: #218838;
}


QTableWidget.load-transaksi::item:selected {
    background: #d0d0d0;
    color: black;
}
QPushButton.load-toggle {
    background-color: #17a2b8;
    color: white;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 8pt;
}
QPushButton.load-toggle:hover { background-color: #138496; }
QLabel.load-info {
    background-color: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 6px;
    padding: 12px;
    font-size: 10pt;
    line-height: 1.4;
    min-height: 180px;
}
/* // edited by glg (18:10 WIB, 2026-01-16) */
/* // change: Tambahkan style tombol load/hapus agar berbentuk blok dengan border seperti tombol close. */
/* // technical rationale: Menegaskan perbedaan aksi load dan hapus pada dialog pre order. */
QPushButton.load-action {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 8px;
    border: 1px solid #1e7e34;
    font-size: 10pt;
}
QPushButton.load-action:hover { background-color: #218838; }
QPushButton.load-delete {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 8px;
    border: 1px solid #b02a37;
    font-size: 10pt;
}
QPushButton.load-delete:hover { background-color: #c82333; }
QPushButton.load-close {
    background-color: #6c757d;
    color: white;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 8px;
    font-size: 10pt;
}
QPushButton.load-close:hover { background-color: #5a6268; }


QTableWidget.pembayaran::item:selected {
    background: #d0d0d0;
    color: black;
}
QPushButton.pembayaran-batal {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 10px;
}
QPushButton.pembayaran-batal:hover { background-color: #218838; }
QPushButton.pembayaran-ok {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 10px;
}
QPushButton.pembayaran-ok:hover { background-color: #218838; }


QPushButton.return-btn {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 6px;
}
QPushButton.return-btn:hover { background-color: #c82333; }
QCheckBox.return-header {
    font-weight: bold;
}


/* // edited by glg (16:50 WIB, 2026-04-13) */
/* // change: Perkuat hierarki visual POS untuk alur kasir (input -> tabel -> total -> aksi). */
/* // technical rationale: Menurunkan cognitive load saat transaksi cepat dan mengurangi salah klik. */
QLabel.tpv-section-label {
    font-weight: 700;
    color: #1f2d3d;
    font-size: 10pt;
}

QComboBox.tpv-customer-input,
QLineEdit.tpv-cart-sku-input,
QLineEdit.tpv-barang-input,
QSpinBox.tpv-cart-qty-input {
    margin: 0px;
    padding: 6px 8px;
    border: 1px solid #b8c2cc;
    border-radius: 4px;
    background: #ffffff;
    font-size: 10pt;
}
QLineEdit.tpv-cart-sku-input:focus,
QLineEdit.tpv-barang-input:focus,
QSpinBox.tpv-cart-qty-input:focus,
QComboBox.tpv-customer-input:focus {
    border: 2px solid #0d6efd;
}
QCheckBox.tpv-popup-checkbox {
    margin: 0px;
    padding: 0px;
    font-weight: 600;
    color: #2c3e50;
}
QLabel.tpv-cart-header-label {
    color: #2f4459;
    font-weight: 700;
    font-size: 9pt;
}

QTableWidget.tpv-barang-table {
    background: #ffffff;
    alternate-background-color: #f8fbff;
    gridline-color: #dfe6ee;
    selection-background-color: #d6ecff;
    selection-color: #0a2239;
}
QTableWidget.tpv-barang-table QHeaderView::section {
    background: #2f4459;
    color: #ffffff;
    font-weight: 700;
    border: 1px solid #3a5169;
    padding: 4px;
}

QGroupBox.tpv-critical-action-group {
    border: 2px solid #0f5132;
    border-radius: 8px;
    background: #f1fbf4;
    font-weight: 800;
    /* edited by glg: beri ruang title agar tidak bertumpuk dengan konten */
    margin-top: 8px;
    padding-top: 6px;
}
QGroupBox.tpv-critical-action-group::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    color: #0f5132;
    padding: 0 6px;
    font-size: 10.5pt;
}
QPushButton.tpv-critical-primary {
    /* edited by glg: turunkan densitas tombol aksi */
    background: #198754;
    color: white;
    border: 1px solid #146c43;
    border-radius: 8px;
    font-weight: 800;
    font-size: 10pt;
    padding: 4px 10px;
}
QPushButton.tpv-critical-primary:hover { background: #157347; }
QPushButton.tpv-critical-primary:disabled {
    background: #9db6a6;
    color: #f1f3f5;
    border-color: #9db6a6;
}
QPushButton.tpv-critical-secondary {
    /* edited by glg: turunkan densitas tombol aksi */
    background: #e9f5ff;
    color: #0d6efd;
    border: 1px solid #79b0ff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 9.5pt;
    padding: 4px 10px;
}
QPushButton.tpv-critical-secondary:hover { background: #dceeff; }
QPushButton.tpv-critical-secondary:disabled {
    color: #8ca5c4;
    border-color: #c6d8ee;
    background: #f4f7fb;
}

QGroupBox.tpv-info-diskon {
    font-weight: 800;
    border: 1px solid #cdd7e1;
    border-radius: 8px;
    background: #f9fbfd;
}
QGroupBox.tpv-info-diskon::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding: 0 6px;
    color: #2c3e50;
}
QLabel.tpv-diskon-summary {
    color: #0d6efd;
    font-weight: 700;
    font-size: 9.3pt;
    padding: 2px 2px 4px 2px;
}
QLabel.tpv-diskon-empty {
    color: #64748b;
    font-style: italic;
    padding: 2px;
}

QGroupBox.tpv-info-pembayaran {
    background: #eef7f1;
    border: 2px solid #1b5e20;
    border-radius: 8px;
    padding: 8px;
}
QGroupBox.tpv-info-pembayaran::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding: 0 6px;
    color: #1b5e20;
    font-weight: 800;
    font-size: 10.5pt;
}
QLabel.tpv-info-pembayaran-title {
    /* edited by glg: judul ikut menempel ke bawah bersama konten */
    color: #1b5e20;
    font-weight: 800;
    font-size: 10.5pt;
    padding: 0 0 2px 0;
}
QLabel.tpv-info-label {
    color: #2f3d4a;
    font-weight: 600;
}
QLabel.tpv-info-value {
    color: #12263a;
    font-weight: 700;
}
QLabel.tpv-info-total-label {
    color: #1b5e20;
    font-weight: 900;
    font-size: 10.5pt;
}
QLabel.tpv-info-total-value {
    /* edited by glg: optimasi keterbacaan nominal pada resolusi kecil */
    color: #0b3d1a;
    font-weight: 900;
    font-size: 13pt;
    background: #dff2e5;
    border: 2px solid #8cc8a0;
    border-radius: 6px;
    padding: 3px 8px;
}
QFrame.tpv-info-divider {
    background: #8cc8a0;
    min-height: 2px;
    max-height: 2px;
}

QPushButton.tpv-simpan-btn {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 10px;
}
QPushButton.tpv-simpan-btn:hover { background-color: #218838; }

QPushButton.tpv-shortcut-btn {
    background-color: #2c3e50;
    color: white;
    border: 1px solid #34495e;
    border-radius: 4px;
    padding: 6px 10px;
    text-align: left;
    font-size: 9pt;
    font-weight: 500;
}
QPushButton.tpv-shortcut-btn[critical="true"] {
    /* edited by glg: samakan warna shortcut kritikal dengan shortcut lain */
    border: 1px solid #34495e;
    background-color: #2c3e50;
    color: #ffffff;
}
QPushButton.tpv-shortcut-btn:hover {
    background-color: #34495e;
    border: 1px solid #3498db;
}
QPushButton.tpv-shortcut-btn:pressed {
    background-color: #1abc9c;
    border: 1px solid #16a085;
}

QGroupBox.tpv-diskon-group {
    font-weight: 700;
    border: 1px solid #c8d3df;
    border-radius: 6px;
    margin-top: 0px;
    padding: 4px;
    background: #ffffff;
}
QGroupBox.tpv-diskon-group::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding: 0 4px;
    color: #334155;
}
QGroupBox.tpv-diskon-group QLabel,
QGroupBox.tpv-diskon-group QRadioButton {
    padding-left: 2px;
    color: #263645;
}

QPushButton.tpv-hapus-btn {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
}
QPushButton.tpv-hapus-btn:hover { background-color: #218838; }

