/* ── PALLETS STYLES: LINE ── build 1001 */

.line-module {
  display: flex; flex-direction: column; height: 100%;
  background: var(--ws-bg); color: var(--text-on-ws);
}

/* Top sheet */
.line-topsheet {
  background: var(--shell-bg); color: var(--text-on-shell);
  padding: 1rem 1.5rem; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.line-topsheet-stats {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.line-stat {
  flex: 1; min-width: 120px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.line-stat-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-on-shell-2);
  margin-bottom: 0.25rem;
}
.line-stat-value {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  color: var(--text-on-shell);
}
.line-stat-value.over { color: #e74c3c; }
.line-stat-value.under { color: #2ecc71; }
.line-atl-btl {
  display: flex; gap: 1.5rem; font-size: 11px; color: var(--text-on-shell-2);
}
.line-atl-btl strong { color: var(--text-on-shell); }

/* Tabs */
.line-tabs {
  display: flex; border-bottom: 1px solid var(--ws-border);
  background: var(--ws-surface); flex-shrink: 0;
}
.line-tab {
  padding: 0.75rem 1.25rem; font-size: 13px; font-weight: 500;
  color: var(--text-on-ws-2); cursor: pointer; border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}
.line-tab:hover { color: var(--text-on-ws); }
.line-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

/* Panel + scroll */
.line-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.line-scroll { flex: 1; overflow-y: auto; }
.line-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--ws-border);
  background: var(--ws-surface); flex-shrink: 0;
}

/* Budget accounts */
.line-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  padding: 1rem 1.5rem 0.375rem;
}
.line-section-rule {
  height: 1.5px; background: var(--accent); margin: 0 1.5rem 0.75rem;
}
.line-account-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1.5rem; border-bottom: 1px solid var(--ws-border);
  cursor: pointer; background: var(--ws-surface);
  transition: background var(--transition-fast);
}
.line-account-row:hover { background: var(--ws-bg); }
.line-account-row.expanded { background: var(--ws-bg); }
.line-account-code {
  font-size: 11px; font-weight: 700; color: var(--text-on-ws-2);
  min-width: 48px;
}
.line-account-name {
  font-size: 13px; font-weight: 600; color: var(--text-on-ws); flex: 1;
}
.line-account-num {
  font-size: 12px; color: var(--text-on-ws-2); min-width: 90px; text-align: right;
}
.line-account-num.over { color: #e74c3c; }
.line-account-num.under { color: #2e7d4f; }
.line-account-expand {
  font-size: 12px; color: var(--text-on-ws-2); width: 16px; text-align: center;
}

/* Line items table */
.line-items-table {
  margin: 0 1.5rem 0.75rem;
  border: 1px solid var(--ws-border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--ws-surface);
}
.line-items-header {
  display: grid;
  grid-template-columns: 2fr 60px 80px 90px 90px 90px 120px 60px;
  gap: 0; background: var(--shell-bg); color: var(--text-on-shell);
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.5rem 0.75rem;
}
.line-item-row {
  display: grid;
  grid-template-columns: 2fr 60px 80px 90px 90px 90px 120px 60px;
  gap: 0; padding: 0.5rem 0.75rem; font-size: 12px;
  border-bottom: 1px solid var(--ws-border); color: var(--text-on-ws);
  transition: background var(--transition-fast);
}
.line-item-row:last-child { border-bottom: none; }
.line-item-row:hover { background: var(--ws-bg); cursor: pointer; }
.line-item-estimated { font-weight: 600; color: var(--text-on-ws); }
.line-item-actual { color: var(--text-on-ws-2); }
.line-item-add-row {
  padding: 0.5rem 0.75rem; font-size: 11px;
  color: var(--accent-text); cursor: pointer; font-weight: 600;
}
.line-item-add-row:hover { background: rgba(240,95,0,0.04); }

/* POs table */
.line-table {
  width: 100%; border-collapse: collapse; margin: 0;
}
.line-table th {
  background: var(--shell-bg); color: var(--text-on-shell);
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.625rem 1rem; text-align: left;
}
.line-table td {
  padding: 0.625rem 1rem; font-size: 12px; color: var(--text-on-ws);
  border-bottom: 1px solid var(--ws-border);
}
.line-table tr:hover td { background: var(--ws-bg); cursor: pointer; }

/* Status badges */
.line-status {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 100px;
  white-space: nowrap;
}
.line-status.draft { background: rgba(26,23,20,0.08); color: var(--text-on-ws-2); }
.line-status.issued { background: rgba(58,95,173,0.12); color: #3a5fad; }
.line-status.received { background: rgba(240,95,0,0.1); color: #c44800; }
.line-status.paid { background: rgba(46,125,79,0.12); color: #2e7d4f; }

/* Vendor cards */
.line-vendor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 0.75rem; padding: 1.25rem;
}
.line-vendor-card {
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  border-radius: var(--radius-md); padding: 1rem; cursor: pointer;
  transition: border-color var(--transition-fast);
}
.line-vendor-card:hover { border-color: rgba(240,95,0,0.3); }
.line-vendor-name {
  font-size: 13px; font-weight: 600; color: var(--text-on-ws); margin-bottom: 0.25rem;
}
.line-vendor-category {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px; background: var(--ws-bg);
  border: 1px solid var(--ws-border); color: var(--text-on-ws-2);
  display: inline-block; margin-bottom: 0.625rem;
}
.line-vendor-contact { font-size: 11px; color: var(--text-on-ws-2); line-height: 1.6; }
.line-vendor-footer {
  margin-top: 0.625rem; padding-top: 0.625rem;
  border-top: 1px solid var(--ws-border);
  font-size: 11px; color: var(--text-on-ws-2);
}
.line-vendor-footer strong { color: var(--accent-text); }

/* Drawers — reuse shell dark modal pattern */
.line-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px;
  background: var(--shell-bg); color: var(--text-on-shell);
  border-left: 1px solid rgba(255,255,255,0.08);
  transform: translateX(100%); transition: transform 0.2s ease;
  z-index: 300; display: flex; flex-direction: column;
}
.line-drawer.open { transform: translateX(0); }
.line-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.line-drawer-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  color: var(--text-on-shell);
}
.line-drawer-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-on-shell-2); padding: 0; line-height: 1;
}
.line-drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.line-drawer-footer {
  padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; gap: 0.625rem; flex-shrink: 0;
}
.line-drawer-backdrop {
  position: fixed; inset: 0; z-index: 299; display: none;
}
.line-drawer-backdrop.open { display: block; }

/* Drawer fields */
.line-field { margin-bottom: 1rem; }
.line-field-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(245,239,230,0.45);
  margin-bottom: 0.375rem;
}
.line-input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm);
  color: var(--text-on-shell); font-family: var(--font-ui); font-size: 13px;
  padding: 0.5rem 0.75rem;
}
.line-input:focus { outline: none; border-color: var(--accent); }
.line-select {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm);
  color: var(--text-on-shell); font-family: var(--font-ui); font-size: 13px;
  padding: 0.5rem 0.75rem; color-scheme: dark;
}
.line-computed {
  font-size: 18px; font-weight: 600; color: var(--text-on-shell);
  padding: 0.5rem 0;
}

/* Buttons */
.line-btn {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  padding: 0.5rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
  color: var(--text-on-shell); cursor: pointer;
  transition: all var(--transition-fast);
}
.line-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.line-btn.accent:hover { background: #d45200; }
.line-btn.danger { border-color: rgba(192,57,43,0.3); color: #e74c3c; }
.line-btn.danger:hover { background: rgba(192,57,43,0.08); }
.line-btn.ws {
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  color: var(--text-on-ws);
}
.line-btn.ws.accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
