:root {
  --bg-deep: #07080b;
  --bg-card: rgba(17, 19, 24, 0.75);
  --bg-card-hover: rgba(25, 28, 36, 0.85);
  --border-glass: rgba(226, 183, 85, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --gold: #e2b755;
  --gold-glow: rgba(226, 183, 85, 0.25);
  --cyan: #00f2fe;
  --green: #10b981;
  --purple: #a855f7;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(226, 183, 85, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.04) 0%, transparent 40%);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* GLASS PANEL UTILITY */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
}

/* PIN OVERLAY */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 11, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pin-card {
  width: 100%;
  max-width: 380px;
  padding: 35px 25px;
  text-align: center;
  border: 1px solid rgba(226, 183, 85, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px var(--gold-glow);
}

.pin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.pin-icon {
  margin-bottom: 12px;
}

.pin-card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}

.pin-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 25px;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 25px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(226, 183, 85, 0.4);
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 20px;
  font-weight: 600;
  padding: 16px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-btn:hover {
  background: rgba(226, 183, 85, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.pin-btn:active {
  transform: scale(0.95);
}

.pin-func {
  font-size: 16px;
  color: var(--text-muted);
}

.pin-error {
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  margin-top: 15px;
  min-height: 20px;
}

/* TOP NAVBAR */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  margin: 15px 20px 0 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-crest {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #e2b755 0%, #b8860b 100%);
  color: #07080b;
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(226, 183, 85, 0.35);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tag-gold {
  background: rgba(226, 183, 85, 0.15);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(226, 183, 85, 0.3);
  margin-left: 6px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.metric-label {
  color: var(--text-muted);
  font-weight: 600;
}

.metric-val {
  color: var(--text-main);
  font-weight: 700;
  font-family: var(--font-mono);
}

.dot-green { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-cyan { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot-gold { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.btn-lock {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 15px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-lock:hover {
  border-color: var(--gold);
  background: rgba(226, 183, 85, 0.1);
}

/* NAVIGATION TABS */
.sub-nav {
  display: flex;
  gap: 8px;
  padding: 10px 20px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: rgba(226, 183, 85, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(226, 183, 85, 0.15);
}

/* MAIN CONTENT */
.main-content {
  padding: 15px 20px 40px 20px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* HERO SUMMARY */
.hero-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 24px;
  margin-bottom: 20px;
}

.summary-col {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-val {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.summary-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }
.text-purple { color: var(--purple); }

/* GRID & CARDS */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  padding: 22px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, #e2b755 0%, #c49533 100%);
  color: #07080b;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(226, 183, 85, 0.25);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(226, 183, 85, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, #00f2fe 0%, #00a8b5 100%);
  color: #07080b;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
}

.btn-cyan:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  transition: all 0.2s;
}

.btn-sm:hover {
  border-color: var(--gold);
  background: rgba(226, 183, 85, 0.1);
  color: var(--gold);
}

.btn-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.quick-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.client-highlight-box {
  background: rgba(226, 183, 85, 0.06);
  border: 1px solid rgba(226, 183, 85, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
}

.client-hl-title {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 6px;
}

/* DATA TABLES */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.status-ready { background: rgba(0, 242, 254, 0.15); color: var(--cyan); border: 1px solid rgba(0, 242, 254, 0.3); }
.status-issued { background: rgba(226, 183, 85, 0.15); color: var(--gold); border: 1px solid rgba(226, 183, 85, 0.3); }
.status-paid { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }

/* ACCOUNTS & CONTRACTORS GRID */
.accounts-grid, .contractors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.account-card, .contractor-card {
  padding: 20px;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: var(--bg-card);
  transition: all 0.2s;
}

.account-card:hover, .contractor-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.acc-card-header, .con-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.acc-card-title, .con-card-title {
  font-size: 15px;
  font-weight: 700;
}

.currency-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(226, 183, 85, 0.15);
  color: var(--gold);
}

.acc-detail-row, .con-detail-row {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.acc-detail-val {
  color: var(--text-main);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* COMPLIANCE CARDS */
.compliance-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.compliance-card {
  padding: 22px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.compliance-card.critical {
  border-color: rgba(226, 183, 85, 0.4);
}

.compliance-card.critical::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
}

.compliance-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.compliance-authority {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.compliance-countdown {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--gold);
  margin-bottom: 10px;
}

.compliance-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* FORMS & MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 11, 0.85);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-box {
  width: 100%;
  max-width: 550px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  margin: auto;
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 950px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.btn-close:hover {
  color: #ef4444;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--gold);
  background: rgba(226, 183, 85, 0.05);
  box-shadow: 0 0 10px rgba(226, 183, 85, 0.2);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* ITEMS SECTION */
.items-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1.5fr 1.5fr 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.invoice-summary-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 15px;
}

.invoice-summary-box strong {
  font-size: 20px;
  font-family: var(--font-mono);
  color: var(--gold);
}

.code-preview {
  background: #030406;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* PRINTABLE INVOICE STYLING (A4 STANDARD) */
.print-wrapper {
  background: #ffffff;
  color: #111827;
  padding: 40px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.invoice-doc {
  max-width: 800px;
  margin: 0 auto;
}

.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #e2b755;
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.inv-brand-name {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.5px;
}

.inv-badge-llc {
  font-size: 12px;
  font-weight: 700;
  color: #b8860b;
  text-transform: uppercase;
}

.inv-seller-address {
  font-size: 12px;
  color: #4b5563;
  margin-top: 6px;
  line-height: 1.4;
}

.inv-title-box {
  text-align: right;
}

.inv-doc-title {
  font-size: 26px;
  font-weight: 900;
  color: #111827;
  letter-spacing: 1px;
}

.inv-doc-number {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #b8860b;
  margin-top: 4px;
}

.inv-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 25px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.inv-party-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.inv-party-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.inv-dates-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
  font-size: 12px;
}

.inv-date-item span {
  display: block;
  color: #6b7280;
  font-weight: 600;
}

.inv-date-item strong {
  color: #111827;
  font-size: 13px;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
}

.inv-table th {
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid #d1d5db;
  text-align: left;
}

.inv-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}

.inv-table .text-right { text-align: right; }

.inv-totals-box {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 25px;
}

.inv-totals-table {
  width: 280px;
}

.inv-totals-table tr td {
  padding: 6px 10px;
  font-size: 13px;
}

.inv-totals-table tr.total-row td {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  border-top: 2px solid #111827;
  padding-top: 10px;
}

.inv-payment-box {
  background: #fdfaf3;
  border: 1px solid #f3e8cb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 25px;
}

.inv-payment-title {
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.inv-bank-detail {
  font-size: 12px;
  color: #451a03;
  line-height: 1.5;
}

.inv-tax-box {
  font-size: 11px;
  color: #4b5563;
  line-height: 1.5;
  border-top: 1px solid #e5e7eb;
  padding-top: 15px;
  margin-top: 20px;
}

.inv-signature-row {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
}

.inv-sig-box {
  width: 220px;
  border-top: 1px dashed #9ca3af;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  padding-top: 6px;
}

/* PRINT MEDIA */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-layout, .no-print, .top-nav, .sub-nav, .modal-header {
    display: none !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-box {
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }
  .print-wrapper {
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-summary {
    grid-template-columns: 1fr 1fr;
  }
  .grid-2col, .compliance-cards-grid, .form-grid, .form-row {
    grid-template-columns: 1fr;
  }
  .hide-mobile {
    display: none;
  }
  .item-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
