/* ==========================================================================
   TIPSTECH SAAS — application styles (loaded after the legacy brand sheet)
   ========================================================================== */

:root {
  --app-navy: #1e2a78;
  --app-navy-deep: #141c55;
  --app-orange: #d9541e;
  --app-line: #e4e7f0;
  --app-muted: #6b7390;
  --app-bg: #f6f7fb;
}

body { font-size: 15px; }
body.app-body { background: var(--app-bg); }

a { text-decoration: none; }

/* ---------------- Public landing extras ---------------- */
.hero-panel {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
}
.hero-panel-head {
  display: flex; align-items: center; gap: 6px;
  padding: 0.8rem 1rem;
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hero-panel-head span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.28); }
.hero-panel-head small { margin-left: auto; color: rgba(255,255,255,0.5); font-size: 0.7rem; }
.hero-panel-body { padding: 1.25rem; }
.mini-stat {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex; flex-direction: column;
}
.mini-stat small { color: rgba(255,255,255,0.6); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.mini-stat strong { color: #fff; font-family: var(--font-display); font-size: 1.7rem; }
.bar-chart { height: 110px; display: flex; align-items: flex-end; gap: 8px; }
.bar-chart span { flex: 1; background: linear-gradient(180deg, var(--app-orange), #f08a4b); border-radius: 4px 4px 0 0; opacity: 0.85; }

.feature-tile {
  height: 100%;
  padding: 1.7rem;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(30,42,120,0.28); }
.feature-tile i { font-size: 1.8rem; color: var(--app-orange); }
.feature-tile h3 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }
.feature-tile p { color: var(--app-muted); margin: 0; font-size: 0.92rem; }

.app-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--app-line);
  background: #fff;
  color: var(--app-muted);
  font-size: 0.85rem;
}
.app-footer a { color: var(--app-navy); }

.app-alert { margin-bottom: 1rem; border-radius: 10px; font-size: 0.9rem; }

/* ---------------- Pricing ---------------- */
.price-card {
  position: relative;
  padding: 2rem 1.6rem;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: #fff;
  display: flex; flex-direction: column;
}
.price-card.featured { border: 2px solid var(--app-orange); box-shadow: 0 20px 44px -22px rgba(217,84,30,0.4); }
.price-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--app-orange); color: #fff;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem; border-radius: 999px; white-space: nowrap;
}
.price-card h3 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.price-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--app-navy); line-height: 1.1; }
.price-value small { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--app-muted); }
.price-features { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.price-features li { padding: 0.3rem 0; font-size: 0.9rem; }
.price-features i { color: var(--app-orange); margin-right: 0.4rem; }

/* ---------------- Forms / auth ---------------- */
.form-panel, .panel {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  padding: 1.6rem;
}
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
  background: radial-gradient(circle at 15% 20%, rgba(217,84,30,0.12), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(30,42,120,0.14), transparent 42%),
              var(--app-bg);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  padding: 2.2rem;
  box-shadow: 0 24px 60px -30px rgba(30,42,120,0.35);
}
.auth-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; color: var(--app-navy); letter-spacing: 0.05em; }
.auth-brand small { color: var(--app-orange); font-size: 0.6rem; letter-spacing: 0.2em; }
.auth-title { font-size: 1.8rem; margin: 1.5rem 0 0.2rem; }
.auth-foot { text-align: center; margin: 1.4rem 0 0; font-size: 0.9rem; }
.auth-foot a { color: var(--app-navy); font-weight: 600; }
.demo-hint { margin-top: 1.3rem; padding: 0.9rem; border-radius: 10px; background: var(--app-bg); font-size: 0.78rem; color: var(--app-muted); }

.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, var(--app-navy), var(--app-navy-deep));
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
}

/* ---------------- App shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, #1e2a78 0%, #141c55 100%);
  color: rgba(255,255,255,0.7);
  padding: 1.4rem 1rem;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; color: #fff; padding: 0.2rem 0.5rem 1.6rem; }
.sidebar-brand strong { display: block; font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.08em; }
.sidebar-brand small { display: block; font-size: 0.58rem; letter-spacing: 0.22em; color: #f08a4b; }
.sidebar-section { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.4); padding: 1.1rem 0.8rem 0.5rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.14); color: #fff; font-weight: 600; }
.sidebar-nav i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 1rem 0.8rem 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem; }
.sidebar-foot a { color: rgba(255,255,255,0.65); }
.sidebar-foot a:hover { color: #fff; }

.app-content { flex: 1; min-width: 0; }
.app-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--app-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
}
.topbar-title { font-weight: 600; color: var(--app-navy); font-size: 0.95rem; }
.topbar-user { display: flex; align-items: center; gap: 0.7rem; }
.topbar-user strong { display: block; font-size: 0.85rem; line-height: 1.2; }
.topbar-user small { display: block; font-size: 0.7rem; color: var(--app-muted); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(217,84,30,0.14); color: var(--app-orange);
  display: grid; place-items: center; font-weight: 700;
}
.app-main { padding: 2rem; max-width: 1500px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-title { font-size: 1.65rem; margin: 0 0 0.2rem; }
.page-sub { color: var(--app-muted); margin: 0; font-size: 0.9rem; }

.panel { padding: 1.4rem 1.5rem; }
.panel-narrow { max-width: 620px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.panel-head h2 { font-size: 1rem; margin: 0; }
.panel-head a { font-size: 0.8rem; color: var(--app-navy); font-weight: 600; }

.stat-card {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--app-line);
  border-radius: 14px; padding: 1.2rem;
  height: 100%;
}
.stat-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-icon.navy { background: rgba(30,42,120,0.09); color: var(--app-navy); }
.stat-icon.orange { background: rgba(217,84,30,0.11); color: var(--app-orange); }
.stat-card small { display: block; color: var(--app-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ink-900); line-height: 1.2; }

.app-table thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--app-muted); border-bottom: 1px solid var(--app-line); font-weight: 600; }
.app-table tbody td { border-bottom: 1px solid #f0f1f6; font-size: 0.88rem; padding: 0.85rem 0.75rem; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table a { color: var(--app-navy); font-weight: 600; }

.status-pill {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; text-transform: capitalize;
  background: #eef0f6; color: #5b6380;
}
.status-active, .status-completed, .status-paid, .status-qualified, .status-admin { background: #e6f6ec; color: #1a7f43; }
.status-trialing, .status-in_progress, .status-contacted, .status-review { background: #fff2df; color: #a25c00; }
.status-canceled, .status-archived, .status-closed, .status-void, .status-refunded { background: #f1f1f4; color: #777d92; }
.status-partially_refunded { background: #fff2df; color: #a25c00; }
.status-planning, .status-new, .status-draft { background: #eaf0ff; color: #3346a8; }
.status-pending, .status-open, .status-sent, .status-trialing { background: #fff2df; color: #a25c00; }
.status-suspended, .status-expired, .status-failed { background: #fdeaea; color: #b42318; }
.status-accepted, .status-converted, .status-simulated { background: #e7f3ff; color: #175fa8; }
.status-declined { background: #f1f1f4; color: #777d92; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--app-muted); }
.empty-state i { font-size: 2rem; color: #c8cddc; display: block; margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 0.8rem; font-size: 0.9rem; }

.subscription-box { border: 1px solid var(--app-line); border-radius: 12px; padding: 1.1rem; background: var(--app-bg); }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; gap: 0.8rem; padding: 0.65rem 0; border-bottom: 1px solid #f0f1f6; font-size: 0.85rem; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list i { color: var(--app-orange); margin-top: 0.2rem; }
.activity-list small { display: block; color: var(--app-muted); font-size: 0.72rem; }

.plan-switch { border: 1px solid var(--app-line); border-radius: 12px; padding: 1rem; height: 100%; }
.plan-switch h4 { font-size: 1rem; margin: 0; }

.filter-tabs { border-bottom: 1px solid var(--app-line); }
.filter-tabs .nav-link { color: var(--app-muted); font-size: 0.85rem; padding: 0.5rem 0.9rem; }
.filter-tabs .nav-link.active { color: var(--app-navy); font-weight: 600; border-bottom: 2px solid var(--app-orange); }

.new-key-box code { font-size: 0.85rem; word-break: break-all; cursor: pointer; }
.api-example {
  background: #141c55; color: #e7eafb;
  padding: 0.9rem; border-radius: 10px; font-size: 0.75rem;
  white-space: pre-wrap; word-break: break-word;
}

.error-code { font-family: var(--font-display); font-size: 6rem; font-weight: 700; color: rgba(30,42,120,0.12); line-height: 1; }

/* ---------------- Central settings ---------------- */
.settings-tabs { flex-wrap: wrap; overflow-x: visible; gap: 0.35rem; padding-bottom: 0.35rem; }
.settings-tabs .nav-link { white-space: nowrap; color: var(--app-navy); border-radius: 8px; font-size: 0.9rem; }
.settings-tabs .nav-link.active { background: var(--app-navy); color: #fff; }
.settings-quick {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.75rem 0.9rem; margin-bottom: 1rem;
  border: 1px solid var(--app-line); border-radius: 12px; background: #fff;
}
.settings-quick strong { margin-right: 0.25rem; font-size: 0.9rem; }
.settings-quick .btn { font-size: 0.8rem; }
.integration-card {
  height: 100%; padding: 1.1rem;
  border: 1px solid var(--app-line); border-radius: 12px; background: #fff;
}
.form-control-color { width: 100%; height: 38px; padding: 0.2rem; }

/* ---------------- Billing / products ---------------- */
.invoice-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; color: var(--app-navy); letter-spacing: 0.06em; }
.invoice-brand small { color: var(--app-orange); font-size: 0.6rem; letter-spacing: 0.18em; }
.invoice-panel { padding: 2rem; }
.invoice-bill-to { padding-left: 0.9rem; border-left: 3px solid var(--app-orange); }
.invoice-total td { font-size: 1.05rem; color: var(--app-navy); font-weight: 700; }
.panel-narrow-wide { max-width: 900px; }

.invoice-public-wrap { padding: 2rem 1rem 4rem; background: var(--app-bg); min-height: 100vh; }
.invoice-public-actions { max-width: 900px; margin: 0 auto 1rem; display: flex; justify-content: space-between; gap: 1rem; }
.invoice-public-page {
  max-width: 900px; margin: 0 auto;
  background: #fff; border: 1px solid var(--app-line);
  border-radius: 14px; padding: 3rem;
  box-shadow: 0 20px 50px -30px rgba(30,42,120,0.3);
}
.invoice-pay-actions {
  border: 1px solid var(--app-line); border-left: 3px solid var(--app-orange);
  border-radius: 10px; padding: 1rem 1.2rem; background: #fff;
}
.invoice-pay-actions > strong { display: block; margin-bottom: 0.35rem; color: var(--app-navy); }
.invoice-pay-note { border-top: 1px solid var(--app-line); padding-top: 1.2rem; }
.invoice-thanks { border-top: 1px solid var(--app-line); padding-top: 1.5rem; }

.price-icon { font-size: 1.6rem; color: var(--app-orange); display: block; margin-bottom: 0.6rem; }
.product-tile {
  height: 100%; padding: 1.6rem;
  border: 1px solid var(--app-line); border-radius: 14px; background: #fff;
}
.product-tile.featured { border: 2px solid var(--app-orange); }
.product-tile i { font-size: 1.8rem; color: var(--app-orange); }
.product-tile h3 { margin: 0.8rem 0 0.3rem; font-size: 1.15rem; }
.product-tile .status-pill { margin-bottom: 0.5rem; }
.product-price { font-family: var(--font-display); font-size: 1.4rem; color: var(--app-navy); font-weight: 700; margin: 0.8rem 0 1rem; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .invoice-public-wrap { padding: 0; background: #fff; }
  .invoice-public-page { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

@media (max-width: 991.98px) {
  .app-sidebar { width: 210px; }
  .app-main { padding: 1.3rem; }
}
@media (max-width: 767.98px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-section, .sidebar-foot { display: none; }
  .app-topbar { padding: 0 1rem; }
}

/* Cart + multi-term pricing ---------------------------------------------- */
.cart-link { position: relative; }
.cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin-left: 4px;
  border-radius: 999px; background: var(--app-orange); color: #fff;
  font-size: 0.68rem; font-weight: 700; line-height: 1;
}
.term-prices {
  border: 1px solid var(--app-line); border-radius: 8px;
  padding: 0.55rem 0.8rem; background: #fafbfc;
}
.term-price-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.2rem 0; font-size: 0.78rem; color: var(--app-muted);
}
.term-price-row strong { color: var(--app-navy); }
.cart-list { display: grid; gap: 1rem; }
.cart-item {
  border: 1px solid var(--app-line); border-radius: 12px; background: #fff;
  padding: 1.1rem 1.2rem;
}
.cart-item-main { display: flex; align-items: flex-start; gap: 0.9rem; }
.cart-item-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: rgba(30,42,120,0.07); color: var(--app-navy); font-size: 1.2rem;
}
.cart-item-main h3 { font-size: 1.05rem; margin: 0 0 0.15rem; }
.cart-item-price { margin-left: auto; white-space: nowrap; color: var(--app-navy); }
.cart-item-controls {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-top: 1rem;
  padding-top: 1rem; border-top: 1px solid var(--app-line);
}
.cart-update-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.6rem; }
.cart-update-form > label { display: block; width: 100%; }
.cart-update-form select { width: auto; min-width: 200px; }
.cart-update-form input[type="number"] { width: 80px; }
.cart-summary {
  border: 1px solid var(--app-line); border-radius: 12px; background: #fff;
  padding: 1.4rem; position: sticky; top: 90px;
}
.cart-summary h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.cart-summary-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0; font-size: 0.9rem;
}
.cart-summary-total {
  border-top: 1px solid var(--app-line); margin-top: 0.5rem; padding-top: 0.9rem;
  font-size: 1.05rem;
}
.subscription-tile {
  border: 1px solid var(--app-line); border-radius: 10px;
  padding: 1.1rem 1.2rem; background: #fff;
}
