/* BUILD_MARKER: UI_PACK_V7 */

body {
  font-family: Arial, sans-serif;
  background-color: #1e1e1e;
  color: #f0f0f0;
  padding: 20px;
  text-align: center;
}
.page-wrapper {
  position: relative;
  width: 900px;
  margin: 0 auto;
  text-align: center;
}
h2 {
  color: #ffd700;
  margin-bottom: 5px;
  font-size: 24px;
}
.note {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 4px;
}
.refresh-status {
  font-size: 11px;
  color: #55ff55;
  margin-bottom: 10px;
}
.header-center {
  margin-bottom: 4px;
}

/* Login area (kept from original idea) */
.login-area {
  position: absolute;
  top: 6px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.login-main-btn {
  padding: 6px 14px;
  background-color: #333;
  color: #f0f0f0;
  border: 1px solid #777;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  min-width: 90px;
  margin-right: 0;
}
.login-main-btn:hover { background-color: #444; }
.login-dropdown {
  position: absolute;
  right: 0;
  margin-top: 4px;
  background-color: #2a2a2a;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px;
  display: none;
  min-width: 190px;
  z-index: 5;
}
.login-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background-color: transparent;
  color: #f0f0f0;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.login-option:hover { background-color: #3a3a3a; }
.google-login { border-left: 2px solid #ffd700; }
.bnet-login   { border-left: 2px solid #4da3ff; }

a { color:#ffd700; text-decoration:none; }
a:visited { color:#ffd700; }
a:hover { color:#ffe680; }

/* Global buttons under Last refresh */
.buttons-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.top-button {
  padding: 6px 14px;
  background-color: #333;
  color: #ffffff;
  border: 1px solid #555;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  min-width: 90px;
}
.top-button:hover { background-color:#444; }
.top-button.active {
  border-color: #ffd700;
  box-shadow: 0 0 5px rgba(255,215,0,0.7);
}

/* Tabs */
.tab-content {
  display: none;
  text-align: left;
}
.tab-content.active {
  display: block;
}

/* Toolbar with offline + filters */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 6px;
  font-size: 12px;
}
.toolbar-left {
  display: flex;
  align-items: center;
}
.toolbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.offline-mode {
  font-size: 12px;
  color: #ff5555;
  font-weight: bold;
}

.filters-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.filters-row label {
  font-size: 12px;
  margin-right: 4px;
}
select {
  padding: 5px;
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  font-size: 12px;
  min-width: 110px;
}

/* Table frame with title + subtitle */
.table-frame {
  border: 2px solid #555;
  border-radius: 6px;
  padding: 8px 10px 10px 10px;
  margin-top: 6px;
  background-color: #202020;
}
.table-header {
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.table-title {
  font-size: 14px;
  color: #ffd700;
  margin-bottom: 2px;
}
.table-subtitle {
  font-size: 11px;
  color: #bbbbbb;
}

/* Tables */
.table-container {
  max-height: 500px;
  overflow-y: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 12px;
}
th, td {
  border: 1px solid #444;
  padding: 4px 6px;
  text-align: center;
}
th {
  background-color: #333;
  color: #ffd700;
}
tr:nth-child(even) { background-color:#282828; }
tr:nth-child(odd)  { background-color:#242424; }
td.name { text-align: left; }
td.quality { text-align:center; }

/* File section (kept simple placeholder for now) */
.file-section {
  width: 900px;
  margin: 10px auto 0 auto;
  text-align: left;
  font-size: 12px;
}
.file-section-top { margin-bottom: 6px; }
.file-section label { margin-right:6px; }
.file-section input[type="file"] { font-size:11px; }
.file-help { color:#aaa; line-height:1.4; }
.file-help code { font-size:11px; color:#ddd; }

/* Popup for item farming breakdown */
.item-popup-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.item-popup {
  background-color: #1e1e1e;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 420px;
  color: #f0f0f0;
  font-size: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.7);
}

.item-popup-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
}

.item-popup-subtitle {
  font-size: 11px;
  color: #bbbbbb;
  margin-bottom: 6px;
}

.item-popup-list {
  max-height: 240px;
  overflow-y: auto;
}

.item-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid #333;
}

.item-popup-row:last-child {
  border-bottom: none;
}

.item-popup-area {
  flex: 1;
}

.item-popup-qty {
  white-space: nowrap;
  text-align: right;
}

.item-popup-gph {
  white-space: nowrap;
  text-align: right;
  min-width: 70px;
}

.item-popup-footer {
  margin-top: 6px;
  font-size: 10px;
  color: #888;
  text-align: right;
}

.item-popup-close {
  text-align: right;
  margin-bottom: 4px;
  font-size: 12px;
}

.item-popup-close button {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
}

.item-popup-close button:hover {
  color: #fff;
}

/* Clickable item name (no underline, just pointer + subtle hover) */
td.name span.item-name-clickable {
  cursor: pointer;
}

td.name span.item-name-clickable:hover {
  filter: brightness(1.15);
}



/* --- Auth status (Google login) --- */
.login-dropdown .auth-status{
  padding: 10px 12px;
  font-size: 12px;
  opacity: 0.85;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.login-option[disabled]{
  opacity: 0.55;
  cursor: not-allowed;
}
.login-option.logout{
  background: rgba(255,255,255,0.08);
}


/* Online/Offline indicator under Login */
.mode-indicator{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #555;
}
.mode-indicator.offline{
  background: rgba(180, 40, 40, 0.25);
  color: #ffb3b3;
}
.mode-indicator.online{
  background: rgba(40, 160, 80, 0.25);
  color: #b9ffd2;
}

/* Last refresh color coding */
.refresh-status.green{ color: #b9ffd2; }
.refresh-status.yellow{ color: #ffe6a6; }
.refresh-status.red{ color: #ffb3b3; }


/* --- UI adjustments: keep filters right, hide Farming View, keep upload only in Action House --- */
.toolbar{
  display:flex;
  align-items:center;
}
.toolbar-right{
  margin-left:auto;
}
#farmingTab .toolbar-left{
  display:none !important;
}
#farmingTab .toolbar{
  justify-content:flex-end;
}

#farmingTab #fileSection{display:none !important;}


/* --- UI fix v6: correct core layout selectors (keep consistent width across tabs) --- */
.page-wrapper{
  position: relative;
  width: 900px;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  text-align: center;
}

.tab-content{
  text-align: left;
}

.toolbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 6px;
  font-size: 12px;
}

.table-container{
  max-height: 500px;
  overflow-y: auto;
}

.table-frame{
  width: 100%;
  box-sizing: border-box;
}


/* --- UI fix v7: force consistent table width on both tabs --- */
#salesTab, #farmingTab{
  max-width: 900px !important;
  width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
#salesTab .table-frame, #farmingTab .table-frame,
#salesTab table, #farmingTab table{
  max-width: 900px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}
#salesTab .table-container, #farmingTab .table-container{
  max-width: 900px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
}
