/* ===== CASHIER FRONTEND — MAIN STYLESHEET ===== */

:root {
  --bg:           #8B0000;
  --bg-darker:    #6b0000;
  --navbar-bg:    #7a0000;
  --toolbar-bg:   #6b0000;
  --white:        #ffffff;
  --blue:         #007bff;
  --green:        #28a745;
  --red:          #dc3545;
  --yellow:       #ffc107;
  --tbl-header:   #000000;
  --tbl-row-alt:  #f8f8f8;
  --tbl-row-alarm:#8B0000;
  --summary-bar:  #1a3c6b;
  --credits-cell: #1a6b1a;
  --log-bg:       #ffffff;
  --log-text:     #000000;
  --log-error:    #dc3545;
  --log-user:     #007bff;
  --log-date:     #dc3545;
  --input-bg:     #ffffff;
  --input-text:   #000000;
  --border:       #cc0000;
  --breadcrumb-bg:#f0f0f0;
  --breadcrumb-fg:#007bff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--navbar-bg);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--bg-darker);
  height: 44px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand .flag {
  font-size: 18px;
}

.navbar-center {
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  letter-spacing: 1px;
}

.navbar-center a {
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
}

.navbar-center a:hover { text-decoration: underline; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover { background: rgba(255,255,255,0.1); }

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 3px;
}

.nav-dropdown-toggle:hover { background: rgba(255,255,255,0.1); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 140px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 8px 14px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}

.nav-dropdown-menu a:hover { background: #f0f0f0; }

.nav-dropdown-menu hr { margin: 4px 0; border-color: #ddd; }

/* ===== TOOLBAR ===== */
.toolbar {
  background: var(--toolbar-bg);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--bg-darker);
  flex-wrap: wrap;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-bar {
  background: var(--breadcrumb-bg);
  padding: 6px 14px;
  font-size: 13px;
  color: #333;
}

.breadcrumb-bar a {
  color: var(--breadcrumb-fg);
  text-decoration: none;
}

.breadcrumb-bar a:hover { text-decoration: underline; }

.breadcrumb-bar span { margin: 0 6px; color: #888; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: filter 0.15s;
  text-decoration: none;
}

.btn:hover { filter: brightness(0.88); }
.btn:active { filter: brightness(0.75); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary  { background: var(--blue);   color: #fff; }
.btn-success  { background: var(--green);  color: #fff; }
.btn-danger   { background: var(--red);    color: #fff; }
.btn-warning  { background: var(--yellow); color: #000; }
.btn-dark     { background: #333;          color: #fff; }
.btn-sm       { padding: 4px 8px; font-size: 12px; }
.btn-icon     { padding: 4px 7px; min-width: 30px; min-height: 28px; }
.btn-block    { width: 100%; font-size: 16px; padding: 12px; }

/* ===== SEARCH ===== */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.search-input {
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  padding: 5px 10px;
  font-size: 13px;
  outline: none;
  width: 200px;
  background: #fff;
  color: #000;
}

.search-btn {
  background: var(--blue);
  border: none;
  color: #fff;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
}

.nav-arrows {
  display: flex;
  gap: 2px;
}

.nav-arrows button {
  background: var(--blue);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: flex;
  height: calc(100vh - 88px);
  overflow: hidden;
}

.table-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.log-panel {
  width: 300px;
  min-width: 260px;
  background: var(--log-bg);
  color: var(--log-text);
  border-left: 2px solid var(--bg-darker);
  overflow-y: auto;
  padding: 8px;
  font-size: 12px;
}

.log-panel .log-entry {
  margin-bottom: 8px;
  line-height: 1.4;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

.log-entry .log-user  { color: var(--log-user);  font-weight: 600; }
.log-entry .log-date  { color: var(--log-date);  font-weight: 600; }
.log-entry .log-msg   { color: var(--log-error); }

/* ===== DATA TABLE ===== */
.data-table-wrap {
  flex: 1;
  overflow: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #000;
}

table.data-table thead th {
  background: var(--tbl-header);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid #333;
}

table.data-table thead th:last-child { border-right: none; }

table.data-table tbody tr { border-bottom: 1px solid #ddd; }

table.data-table tbody tr:hover { background: #f5f5f5; }

table.data-table tbody tr.alarm-row {
  background: var(--tbl-row-alarm) !important;
  color: #fff;
}

table.data-table tbody tr.alarm-row td { color: #fff; }

table.data-table tbody tr.selected-row {
  background: #8B0000 !important;
  color: #fff;
}

table.data-table tbody tr.selected-row td { color: #fff; }

table.data-table td {
  padding: 7px 12px;
  font-size: 13px;
  vertical-align: middle;
  color: #000;
  border-right: 1px solid #e0e0e0;
}

table.data-table td:last-child { border-right: none; }

.username-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}

.username-cell a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.username-cell a:hover { text-decoration: underline; }

.username-icons {
  display: flex;
  gap: 2px;
  align-items: center;
}

.icon-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
}

.icon-circle.green-icon  { color: var(--green); }
.icon-circle.red-icon    { color: var(--red); }

.credits-cell { font-weight: 600; text-align: right; }

.actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ===== SUMMARY BAR ===== */
.summary-bar {
  background: var(--summary-bar);
  color: #fff;
  display: flex;
  border-top: 2px solid #0d2240;
}

.summary-cell {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-right: 1px solid #0d2240;
}

.summary-cell:last-child { border-right: none; }

.summary-cell .label {
  font-weight: 700;
  font-size: 12px;
  display: block;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.summary-cell .value {
  font-size: 14px;
  font-weight: 600;
}

.summary-cell.credits-summary {
  background: var(--credits-cell);
}

/* ===== PAGINATION ===== */
.pagination-bar {
  background: var(--summary-bar);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 12px;
  border-top: 1px solid #0d2240;
}

.pagination-bar .show-entries {
  display: flex;
  align-items: center;
  gap: 6px;
}

.entries-select {
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid #ccc;
  font-size: 12px;
  background: #fff;
  color: #000;
}

.pagination-btns {
  display: flex;
  gap: 4px;
}

.page-btn {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.page-btn:hover   { background: #e8e8e8; }
.page-btn.active  { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 340px;
}

.login-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.lock-icon {
  width: 70px;
  height: 70px;
  background: #444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--bg);
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  color: #fff;
  font-size: 14px;
  margin-bottom: 5px;
}

.login-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  background: #fff;
  color: #000;
  outline: none;
}

.login-input:focus { box-shadow: 0 0 0 2px var(--blue); }

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ddd;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-footer {
  position: fixed;
  bottom: 12px;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
}

.login-footer a { color: rgba(255,255,255,0.4); }

.alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-danger  { background: #f8d7da; color: #721c24; }
.alert-success { background: #d4edda; color: #155724; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info    { background: #d1ecf1; color: #0c5460; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  color: #000;
  border-radius: 6px;
  width: 460px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-header {
  background: var(--navbar-bg);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 18px 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  color: #000;
}

.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,123,255,0.2); }

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group { flex: 1; }

/* ===== INFO CARD (user detail) ===== */
.info-card {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}

.info-row:last-child { border-bottom: none; }

.info-row .label { color: #666; }
.info-row .value { font-weight: 600; color: #000; }

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--bg);
  margin-bottom: 0;
}

.tab-btn {
  padding: 9px 18px;
  background: #e8e8e8;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  border-right: 1px solid #ccc;
}

.tab-btn.active {
  background: #fff;
  color: #000;
  font-weight: 600;
  border-bottom: 2px solid #fff;
  position: relative;
  top: 2px;
}

.tab-btn:hover:not(.active) { background: #d8d8d8; }

.tab-panel { display: none; padding: 16px 0; }
.tab-panel.active { display: block; }

/* ===== CONTENT PAGE ===== */
.page-content {
  padding: 16px;
  max-width: 1100px;
}

.card {
  background: #fff;
  color: #000;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  overflow: hidden;
}

.card-body { padding: 18px; }

.pin-warning {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 14px 18px;
  text-align: center;
  margin-bottom: 16px;
}

.pin-warning h4 { font-size: 16px; margin-bottom: 4px; }
.pin-warning a  { color: var(--blue); font-weight: 600; }

.close-btn-bar {
  text-align: right;
  margin-bottom: 10px;
}

.close-btn-bar a {
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-bar input, .filter-bar select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  color: #000;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.5); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .log-panel { display: none; }
  .main-layout { height: calc(100vh - 88px); }
  .search-input { width: 130px; }
}
