/* ══════════════════════════════════════════════════════
   theme-layout.css — InvoiceFlow Pro v3
   Shell, Topbar, Nav Groups, Compliance Strip, Buttons, View System
   Lines: 672
   ══════════════════════════════════════════════════════ */


/* ══ SHELL ══ */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;

/* ══ TOPBAR ══ */
.top {
  background: var(--shell);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 52px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 20px rgba(0, 0, 0, .4);
  position: relative;
}

.top::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, .5), rgba(79, 70, 229, .5), transparent);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.lb {
  width: 30px;
  height: 30px;
  background: var(--grad-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: white;
  letter-spacing: -.5px;
  box-shadow: var(--sh-pu);
}

.ln {
  font-weight: 800;
  font-size: 15px;
  color: white;
  letter-spacing: -.3px;
}

.ln span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lv {
  font-size: 9px;
  color: rgba(255, 255, 255, .85);
  font-family: var(--mono);
  margin-left: 2px;
}

/* Nav tabs (legacy, kept for compat) */
.nav-tabs {
  display: flex;
  gap: 2px;
  margin-left: 12px;
  flex-shrink: 1;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nt {
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 1);
  transition: all .15s;
  white-space: nowrap;
  letter-spacing: -.1px;
}

.nt:hover {
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .07);
}

.nt.a {
  background: rgba(124, 58, 237, .25);
  color: #C4B5FD;
  border: 1px solid rgba(124, 58, 237, .35);
}

.nt.a-db {
  background: rgba(13, 148, 136, .25);
  color: #5EEAD4;
  border: 1px solid rgba(13, 148, 136, .3);
}

.nt.a-conn {
  background: rgba(245, 158, 11, .2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, .3);
}

/* Top right */
.top-r {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-right: 2px;
}

.view-sel {
  display: flex;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 2px;
}

.vs {
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 1);
  transition: all .15s;
}

.vs.a {
  background: rgba(124, 58, 237, .3);
  color: #C4B5FD;
}

/* ══ NAV GROUPS (dropdown tabs) ══ */
.nav-group {
  position: relative;
  flex-shrink: 0;
}

.ng-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 1);
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}

.ng-btn:hover {
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .07);
}

.ng-btn.open {
  background: rgba(124, 58, 237, .2);
  color: #C4B5FD;
}

.ng-icon {
  font-size: 12px;
}

.ng-arr {
  font-size: 9px;
  opacity: .6;
  transition: transform .15s;
}

.ng-btn.open .ng-arr {
  transform: rotate(180deg);
}

.ng-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1a1625;
  border: 1px solid rgba(124, 58, 237, .25);
  border-radius: 10px;
  padding: 5px;
  min-width: 180px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.ng-menu.open {
  display: block;
}

.ng-item {
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 1);
  transition: all .12s;
  white-space: nowrap;
}

.ng-item:hover {
  background: rgba(124, 58, 237, .2);
  color: #C4B5FD;
}

.ng-item.a {
  background: rgba(124, 58, 237, .25);
  color: #C4B5FD;
  font-weight: 600;
}

.ng-item.a-db {
  color: #5EEAD4;
}

.ng-item.a-db:hover {
  background: rgba(13, 148, 136, .2);
  color: #5EEAD4;
}

.ng-sep {
  height: 1px;
  background: rgba(255, 255, 255, .07);
  margin: 4px 6px;
}

/* ══ ACTIVE PAGE PILL ══ */
.active-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(124, 58, 237, .15);
  border: 1px solid rgba(124, 58, 237, .3);
  border-radius: 20px;
  flex-shrink: 0;
}

.active-pill-icon {
  font-size: 13px;
}

.active-pill-name {
  font-size: 11px;
  font-weight: 700;
  color: #C4B5FD;
  letter-spacing: -.1px;
}

.active-pill-id {
  font-size: 9px;
  color: rgba(196, 181, 253, .5);
  font-family: var(--mono);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══ TOP-RIGHT MORE MENU (single definition) ══ */
.top-more-wrap {
  position: relative;
}

.top-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--shell2);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 5px;
  min-width: 175px;
  z-index: 500;
  box-shadow: var(--sh3);
}

.top-more-menu.open {
  display: block;
}

.top-more-item {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 1);
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}

.top-more-item:hover {
  background: rgba(255, 255, 255, .08);
  color: white;
}

.top-more-sep {
  height: 1px;
  background: rgba(255, 255, 255, .08);
  margin: 4px 0;
}

/* ══ TOPBAR LEGACY DROPDOWNS ══ */
.nt-more {
  position: relative;
}

.nt-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--shell2);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 5px;
  min-width: 160px;
  z-index: 500;
  box-shadow: var(--sh3);
}

.nt-more-menu.open {
  display: block;
}

.nt-more-item {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 1);
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}

.nt-more-item:hover {
  background: rgba(255, 255, 255, .08);
  color: white;
}

.nt-more-item.a-db {
  color: #5EEAD4;
}

/* ── Buttons ── */
.btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: -.1px;
}

.btn-or {
  background: var(--grad-primary);
  color: white;
  box-shadow: var(--sh-pu);
}

.btn-or:hover {
  background: linear-gradient(135deg, #6D28D9, #4338CA);
  box-shadow: 0 6px 24px rgba(124, 58, 237, .4);
  transform: translateY(-1px);
}

.btn-gr {
  background: var(--gr);
  color: white;
}

.btn-gr:hover {
  background: var(--gr2);
  transform: translateY(-1px);
}

.btn-bl {
  background: var(--in);
  color: white;
}

.btn-bl:hover {
  background: var(--in2);
  transform: translateY(-1px);
}

.btn-gh {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .95);
}

.btn-gh:hover {
  background: rgba(255, 255, 255, .15);
  color: white;
}

.btn-slate {
  background: var(--s3);
  color: white;
  border: none;
}

.btn-slate:hover {
  background: var(--s2);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 7px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 6px;
}

/* ══ COMPLIANCE STRIP (single definition) ══ */
.cstrip-l {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cstrip-m {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: 8px;
  flex-shrink: 0;
}

.cstrip-r {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.cstrip-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, .1);
  margin: 0 4px;
}

/* Compliance badges */
.cb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  border: 1px solid transparent;
}

.cb-off {
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .3);
  border-color: rgba(255, 255, 255, .06);
}

.cb-on {
  background: rgba(16, 185, 129, .15);
  color: #34D399;
  border-color: rgba(16, 185, 129, .3);
}

.cb-warn {
  background: rgba(245, 158, 11, .15);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, .3);
}

.cb-err {
  background: rgba(239, 68, 68, .15);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, .3);
}

.cb .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.geo-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(255, 255, 255, .35);
}

.geo-pill strong {
  color: #C4B5FD;
}

.db-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(255, 255, 255, .3);
}

.db-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.db-dot.live {
  background: var(--gr);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1 }
  50% { opacity: .4 }
}

/* ══ COMPACT ACTION BUTTONS (cab) ══ */
.cab {
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .75);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  transition: all .2s;
  cursor: pointer;
  font-family: var(--font);
}

.cab:hover {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .95);
}

#save-doc-btn.cab-active {
  background: rgba(59, 130, 246, .2);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, .3);
}

.cab-gen {
  background: rgba(16, 185, 129, .08);
  color: rgba(52, 211, 153, .45);
  border-color: rgba(16, 185, 129, .15);
}

.cab-gen.cab-active {
  background: rgba(16, 185, 129, .25);
  color: #34D399;
  border-color: rgba(16, 185, 129, .4);
  box-shadow: 0 0 12px rgba(16, 185, 129, .2);
}

.cab-clr {
  color: rgba(252, 165, 165, .3);
}

.cab-clr:hover {
  background: rgba(239, 68, 68, .15);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, .25);
}

/* Output buttons — dimmed until doc generated */
.cab-out {
  opacity: 0.35;
  pointer-events: none;
}

.cab-out.cab-active {
  opacity: 1;
  pointer-events: auto;
}

#btn-print.cab-active {
  color: #94A3B8;
}

#btn-pdf.cab-active {
  color: #F87171;
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .2);
}

#btn-email.cab-active {
  color: #60A5FA;
  background: rgba(59, 130, 246, .15);
  border-color: rgba(59, 130, 246, .2);
}

#btn-wa.cab-active {
  color: #4ADE80;
  background: rgba(34, 197, 94, .15);
  border-color: rgba(34, 197, 94, .2);
}


/* ══ TURSO DB DASHBOARD ══ */
.db-dash {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.db-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--am);
}
.db-header-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--s2);
}
.db-header-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
