:root {
    --primary: #0f5132; /* Hijau Gelap POS Pro Go */
    --primary-hover: #146c43;
    --bg: #f4f6f8; /* Abu-abu terang untuk background utama */
    --card: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Penyesuaian UI Modern */
.card, .card-grid div { 
    background: var(--card);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px; 
    border: none; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Desain Kartu Dashboard ala POS Pro Go */
.balance-card:nth-child(1) { background: var(--primary); color: white; }
.balance-card:nth-child(1) h3, .balance-card:nth-child(1) p { color: white; }

.balance-card h3 { font-size: 14px; color: #64748b; }
.balance-card p { font-size: 24px; font-weight: bold; margin-top: 5px; }

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

input, select { 
    width: 100%;
    padding: 12px;
    border-radius: 8px !important; 
    background: #f8fafc; 
    transition: 0.3s; 
    border: 1px solid #cbd5e1;
}

input:focus, select:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.2); 
    background: white;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
    letter-spacing: 0.5px;
}

.btn-submit:hover { background-color: var(--primary-hover); }
.btn-submit:active { transform: scale(0.98); }

.history-container ul { list-style: none; }
.history-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}
.history-item:first-child { border-radius: 12px 12px 0 0; }
.history-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }

.text-success { color: var(--success); font-weight: bold; }
.text-danger { color: var(--danger); font-weight: bold; }

/* TAMPILAN SIDEBAR & LAYOUT BARU */
.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    background: var(--bg);
}

.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 25px 20px;
    background: #ffffff;
    color: var(--primary);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 { margin: 0; font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.sidebar-header h2 .material-symbols-rounded { font-size: 28px; background: var(--primary); color: white; padding: 4px; border-radius: 8px; }

.sidebar-menu { flex: 1; list-style: none; padding-top: 10px; }

.menu-title {
    font-size: 11px;
    color: #94a3b8;
    padding: 20px 24px 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 16px;
    cursor: pointer;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 10px;
}

.menu-item .material-symbols-rounded { font-size: 20px; color: #94a3b8; transition: 0.2s; }

.menu-item:hover { background: #f8fafc; color: var(--primary); }
.menu-item:hover .material-symbols-rounded { color: var(--primary); }

.menu-item.active {
    background: rgba(15, 81, 50, 0.08);
    color: var(--primary);
}
.menu-item.active .material-symbols-rounded { color: var(--primary); font-variation-settings: 'FILL' 1; }

.has-sub .sub-menu {
    display: none;
    list-style: none;
    background: transparent;
    padding-bottom: 5px;
}

.has-sub.open .sub-menu { display: block; animation: fadeIn 0.3s ease-in; }
.has-sub.open .chevron { transform: rotate(180deg); }

.sub-menu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 45px;
    font-size: 13.5px;
    cursor: pointer;
    color: #64748b;
    transition: 0.2s;
    font-weight: 500;
    border-left: 2px solid transparent;
}
.sub-menu li .material-symbols-rounded { font-size: 16px; opacity: 0.7; }

.sub-menu li:hover { color: var(--primary); font-weight: 600; border-left: 2px solid var(--primary); background: #f8fafc; }
.sub-menu li.active { color: var(--primary); font-weight: 700; }

#btn-logout:hover { background: var(--danger) !important; color: white !important; }

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

main { padding: 0; max-width: 100%; margin: 0; }

/* --- TATA LETAK LOGIN SPLIT SCREEN POS Pro Go --- */
.login-split {
    display: flex !important;
    height: 100vh;
    width: 100vw;
    margin: 0 !important;
    max-width: 100% !important;
}
#login-sec:not(.active) { display: none !important; }

.login-left {
    flex: 1.2;
    background-color: var(--primary);
    color: white;
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.circle-bg {
    position: absolute; top: 10%; right: -20%; width: 600px; height: 600px;
    background: rgba(255,255,255,0.03); border-radius: 50%; z-index: 0;
}
.login-brand { position: relative; z-index: 1; }
.login-brand h1 { font-size: 28px; margin-bottom: 40px; font-weight: 800; }
.login-brand h2 { font-size: 42px; line-height: 1.2; margin-bottom: 20px; font-weight: 700; }
.login-brand p { font-size: 16px; opacity: 0.8; line-height: 1.6; margin-bottom: 40px; max-width: 500px; }
.login-features { display: flex; gap: 20px; font-size: 13px; font-weight: 600; opacity: 0.9; }

.login-right {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card-modern { width: 100%; max-width: 400px; padding: 40px; background: white; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
.login-card-modern h2 { font-size: 24px; margin-bottom: 5px; color: var(--text); font-weight: 800; }
.login-card-modern p { font-size: 13px; color: #64748b; margin-bottom: 30px; }

.role-toggle { display: flex; background: #f1f5f9; border-radius: 30px; padding: 5px; margin-bottom: 25px; }
.role-toggle button { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 25px; font-weight: 600; cursor: pointer; color: #64748b; transition: 0.2s;}
.role-toggle button.active { background: var(--primary); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.login-secure { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 25px; font-weight: 600; }

/* --- MODERNISASI & RESPONSIVITAS MOBILE --- */
.mobile-header {
    display: none;
    background: var(--card);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* --- TABEL & TOMBOL AKSI --- */
.btn-primary { background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-secondary:hover { background: #e2e8f0; }

.table-responsive { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #f8fafc; color: #475569; font-size: 13px; font-weight: 700; text-transform: uppercase; border-bottom: 2px solid var(--border); padding: 12px; text-align: left; }
td { padding: 15px 12px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
.btn-detail { background: #eff6ff; color: #2563eb; border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; }
.btn-detail:hover { background: #dbeafe; }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .login-left { display: none; }
    .login-split { flex-direction: column; }
    .login-right { background: var(--bg); padding: 20px; }
    
    .mobile-header { display: flex; }
    
    .sidebar {
        position: fixed;
        left: -280px; 
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show { left: 0; }
    .sidebar-overlay.show { display: block; animation: fadeIn 0.3s; }

    .main-content { padding: 0; } 
    main { padding: 15px; padding-bottom: 80px; }

    .card-grid { grid-template-columns: 1fr; } 
    .dashboard-layout { overflow-x: hidden; }
}

/* ===== POS FORM BARU ===== */
.opt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s;
  white-space: nowrap;
}
.opt-btn:hover { border-color: var(--primary); color: var(--primary); }
.opt-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.opt-btn .material-symbols-rounded { font-size: 16px; }

.pos-item-row {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.2s;
}
.pos-item-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }

.pos-summary-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 10px;
  border: 1px solid #e2e8f0;
}
.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}
.pos-total-box {
  background: var(--primary);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 10px 0;
}
.pos-total-box p { margin: 0; }
.pos-total-label { font-size: 11px; color: rgba(255,255,255,0.75); letter-spacing: 1px; text-transform: uppercase; }
.pos-total-nominal { font-size: 2em; font-weight: 800; color: white; line-height: 1.2; }

.pos-opt-section {
  display: none;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }

.item-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .item-grid-3 { grid-template-columns: 1fr 1fr; }
}
.item-grid-label {
  font-size: 11px;
  color: #64748b;
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}
.pos-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.pos-input:focus { outline: none; border-color: var(--primary); }

.pos-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .pos-layout { flex-direction: column; }
  .pos-summary-box { position: static; width: 100% !important; box-sizing: border-box; }
}

.badge-type {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.pos-small-input {
  width: 55px;
  padding: 3px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}
.btn-add-item {
  flex: 1;
  padding: 10px;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: bold;
  font-size: 14px;
  transition: opacity 0.2s;
}
.btn-add-item:hover { opacity: 0.88; }
.btn-submit-pos {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.btn-submit-pos:hover { opacity: 0.9; }
.pos-divider { border: none; border-top: 1px dashed #cbd5e1; margin: 8px 0; }
.hutang-warning {
  background: #fff0f0;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  padding: 12px;
}

/* ===== CUSTOMER SECTION ===== */
.cust-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.cust-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.cust-search-wrap .material-symbols-rounded {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: #94a3b8;
  pointer-events: none;
}
.cust-search {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.cust-search:focus { outline: none; border-color: var(--primary); }

.cust-table-wrap { overflow-x: auto; border-radius: 10px; }
.cust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.cust-table thead tr {
  background: #f1f5f9;
}
.cust-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.cust-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.cust-table tbody tr:hover { background: #f8fafc; }
.cust-table tbody tr:last-child td { border-bottom: none; }
.cust-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.cust-name-cell { display: flex; align-items: center; gap: 10px; }
.cust-badge-new {
  font-size: 10px;
  background: #dcfce7;
  color: #166534;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
  margin-left: 6px;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info { font-size: 13px; color: #64748b; }
.pagination-btns { display: flex; gap: 6px; align-items: center; }
.page-btn {
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-number { font-size: 13px; font-weight: 600; color: #475569; padding: 0 4px; }

/* Modal Customer */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { margin: 0; color: white; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 20px; }
.modal-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--primary); }
.form-field textarea { resize: vertical; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-modal-cancel {
  padding: 9px 18px;
  border: 1.5px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  font-size: 14px;
}
.btn-modal-save {
  padding: 9px 22px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-modal-save:hover { opacity: 0.9; }
.cust-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.cust-action-btn:hover { background: #f1f5f9; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.empty-state .material-symbols-rounded { font-size: 48px; display: block; margin-bottom: 10px; }
