/* ---------------------------------------------------------
   COFFEE BACKGROUND
--------------------------------------------------------- */
.coffee-bg {
  background:
    radial-gradient(circle at 20% 30%, rgba(85, 60, 40, 0.35) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(180, 140, 100, 0.30) 0%, transparent 65%),
    radial-gradient(circle at 60% 80%, rgba(230, 210, 190, 0.45) 0%, transparent 70%),
    linear-gradient(135deg, #f5eee7 0%, #e8d8c8 50%, #d4b8a0 100%);
}

/* ---------------------------------------------------------
   THEME VARIABLES
--------------------------------------------------------- */
:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --border: #e2e6ea;
  --accent: #0d6efd;
}

[data-theme="dark"] {
  --bg: #1c1f24;
  --card-bg: #2a2e35;
  --text: #e9ecef;
  --border: #3a3f47;
  --accent: #4da3ff;
}

/* ---------------------------------------------------------
   BODY
--------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  padding: 40px 0;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

.login-logo {
  max-width: 243px;
  width: 75%;
  height: auto;
}

/* ---------------------------------------------------------
   LAYOUT
--------------------------------------------------------- */
.container-main {
  max-width: 1100px;
  margin: 0 auto;
}

.container-results {
  width: 98%;
  max-width: 98%;
  margin: 0 auto 40px;
}

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 1050;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.app-footer .btn {
  pointer-events: auto;
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.admin-sync-status {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.65;
}

[data-theme="dark"] .admin-sync-status {
  background: rgba(255, 255, 255, 0.06);
}

.admin-switch {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header-title {
  font-size: 1.9rem;
  font-weight: 700;
}

.theme-toggle {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text);
}

.customer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  border-color: var(--border);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.875rem;
  line-height: 1.2;
  cursor: default;
  user-select: none;
}

.api-status-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.api-status-pending {
  background: #adb5bd;
}

.api-status-ok {
  background: #198754;
}

.api-status-error {
  background: #dc3545;
}

/* ---------------------------------------------------------
   CARDS
--------------------------------------------------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: background 0.3s, border 0.3s;
}

/* ---------------------------------------------------------
   FILTER ROW
--------------------------------------------------------- */
.filter-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* ---------------------------------------------------------
   AUTOCOMPLETE
--------------------------------------------------------- */
.autocomplete-list {
  position: absolute;
  z-index: 1000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
}

.autocomplete-item:hover {
  background: rgba(13, 110, 253, 0.12);
}

.autocomplete-close {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  color: #0d6efd;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(13, 110, 253, 0.06);
}

.autocomplete-close:hover {
  background: rgba(13, 110, 253, 0.14);
}

/* Dark Mode Autocomplete */
[data-theme="dark"] .autocomplete-list {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .autocomplete-item:hover {
  background: rgba(77, 163, 255, 0.15);
}

[data-theme="dark"] .autocomplete-close {
  color: #4da3ff;
  background: rgba(77, 163, 255, 0.08);
}

/* ---------------------------------------------------------
   TABLES
--------------------------------------------------------- */
table {
  color: var(--text);
  min-width: 1450px;
}

table th,
table td {
  white-space: nowrap;
  vertical-align: middle;
}

table td:nth-child(2),
table td:nth-child(5) {
  white-space: normal;
  min-width: 220px;
}

table thead tr {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] table thead tr {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
.btn {
  transition: 0.2s;
}

.btn:hover {
  opacity: 0.85;
}
