/* ============================================================
   99Verify Portal Stylesheet
   ============================================================ */

:root {
  --pv-accent:    #5c91a1;
  --pv-accent-d:  #4a7a89;
  --pv-dark:      #1a2332;
  --pv-sidebar-w: 250px;
  --pv-topbar-h:  64px;
  --pv-bg:        #f0f4f8;
  --pv-card:      #ffffff;
  --pv-border:    #dde6ed;
  --pv-text:      #2c3e50;
  --pv-muted:     #6b7c8d;
  --pv-success:   #22a623;
  --pv-warning:   #e6a817;
  --pv-danger:    #d94040;
}

/* ---- Reset / Base ---- */
* { box-sizing: border-box; }

body.portal-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--pv-bg);
  color: var(--pv-text);
  font-size: 14px;
}

/* ---- Layout ---- */
.pv-wrapper { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.pv-sidebar {
  width: var(--pv-sidebar-w);
  min-height: 100vh;
  background: var(--pv-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform 0.25s ease;
}

.pv-sidebar-brand {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pv-sidebar-brand img { height: 32px; }
.pv-sidebar-brand span {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pv-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.pv-nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 24px 6px;
}

.pv-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.pv-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.pv-nav a.active {
  color: #fff;
  background: rgba(92,145,161,0.18);
  border-left-color: var(--pv-accent);
}
.pv-nav a.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.pv-nav a svg { flex-shrink: 0; width: 18px; height: 18px; }
.pv-nav .badge-disabled {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.pv-sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pv-sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--pv-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
  flex-shrink: 0;
}
.pv-sidebar-user .info { min-width: 0; }
.pv-sidebar-user .name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-sidebar-user .plan {
  font-size: 11px; color: var(--pv-accent);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.pv-sidebar-user .logout-link {
  margin-left: auto;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  flex-shrink: 0;
}
.pv-sidebar-user .logout-link:hover { color: rgba(255,255,255,0.8); }

/* ---- Main area ---- */
.pv-main {
  margin-left: var(--pv-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top bar ---- */
.pv-topbar {
  height: var(--pv-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--pv-border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky; top: 0;
  z-index: 100;
  gap: 16px;
}
.pv-topbar .pv-page-title {
  font-size: 18px; font-weight: 700; color: var(--pv-dark); flex: 1;
}
.pv-topbar .topbar-actions { display: flex; align-items: center; gap: 12px; }
.pv-topbar .credits-chip {
  background: var(--pv-bg);
  border: 1px solid var(--pv-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pv-text);
  display: flex; align-items: center; gap: 6px;
}
.pv-topbar .credits-chip span { color: var(--pv-accent); }

/* ---- Content ---- */
.pv-content { padding: 32px; flex: 1; }

/* ---- Cards ---- */
.pv-card {
  background: var(--pv-card);
  border: 1px solid var(--pv-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.pv-card-title {
  font-size: 16px; font-weight: 700; color: var(--pv-dark);
  margin: 0 0 20px;
  display: flex; align-items: center; gap: 8px;
}
.pv-card-title small {
  font-size: 12px; font-weight: 400; color: var(--pv-muted); margin-left: auto;
}

/* ---- Stat cards ---- */
.pv-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 20px; margin-bottom: 28px; }
.pv-stat {
  background: var(--pv-card);
  border: 1px solid var(--pv-border);
  border-radius: 16px;
  padding: 22px 24px;
  position: relative; overflow: hidden;
}
.pv-stat .stat-label { font-size: 12px; font-weight: 600; color: var(--pv-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pv-stat .stat-value { font-size: 34px; font-weight: 800; color: var(--pv-dark); margin: 8px 0 4px; line-height: 1; }
.pv-stat .stat-sub { font-size: 12px; color: var(--pv-muted); }
.pv-stat .stat-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.15;
}
.pv-stat.accent .stat-icon { background: var(--pv-accent); }
.pv-stat.success .stat-icon { background: var(--pv-success); }
.pv-stat.warning .stat-icon { background: var(--pv-warning); }
.pv-stat.info   .stat-icon { background: #6b5caa; }
.pv-stat.accent { border-top: 3px solid var(--pv-accent); }
.pv-stat.success { border-top: 3px solid var(--pv-success); }
.pv-stat.warning { border-top: 3px solid var(--pv-warning); }
.pv-stat.info   { border-top: 3px solid #6b5caa; }

/* ---- Tables ---- */
.pv-table { width: 100%; border-collapse: collapse; }
.pv-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--pv-muted); padding: 10px 16px; text-align: left;
  border-bottom: 2px solid var(--pv-border);
}
.pv-table td { padding: 13px 16px; border-bottom: 1px solid var(--pv-border); color: var(--pv-text); vertical-align: middle; }
.pv-table tr:last-child td { border-bottom: none; }
.pv-table tr:hover td { background: #f8fbfc; }
.pv-table .mono { font-family: 'Courier New', monospace; font-size: 13px; }

/* ---- Badges ---- */
.pv-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.pv-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pv-badge.verified  { background: #e8f7e8; color: #22a623; }
.pv-badge.pending   { background: #fff4e0; color: #c98a00; }
.pv-badge.failed    { background: #fdeaea; color: #d94040; }
.pv-badge.expired   { background: #f0f0f0; color: #888; }
.pv-badge.active    { background: #e8f7e8; color: #22a623; }
.pv-badge.paused    { background: #fff4e0; color: #c98a00; }
.pv-badge.draft     { background: #f0f0f0; color: #888; }
.pv-badge.completed { background: #e6f0ff; color: #3870c8; }

/* ---- Buttons ---- */
.pv-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.pv-btn-primary { background: var(--pv-accent); color: #fff; }
.pv-btn-primary:hover { background: var(--pv-accent-d); color: #fff; }
.pv-btn-outline { background: transparent; color: var(--pv-accent); border: 1.5px solid var(--pv-accent); }
.pv-btn-outline:hover { background: var(--pv-accent); color: #fff; }
.pv-btn-ghost { background: var(--pv-bg); color: var(--pv-text); border: 1px solid var(--pv-border); }
.pv-btn-ghost:hover { background: #e4ecf1; }
.pv-btn-danger { background: var(--pv-danger); color: #fff; }
.pv-btn-danger:hover { background: #b83030; color: #fff; }
.pv-btn-sm { padding: 5px 14px; font-size: 12px; }
.pv-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms ---- */
.pv-form-group { margin-bottom: 20px; }
.pv-label { display: block; font-size: 13px; font-weight: 600; color: var(--pv-text); margin-bottom: 6px; }
.pv-input, .pv-select, .pv-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--pv-border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--pv-text);
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
  font-family: inherit;
}
.pv-input:focus, .pv-select:focus, .pv-textarea:focus {
  border-color: var(--pv-accent);
  box-shadow: 0 0 0 3px rgba(92,145,161,0.12);
}
.pv-textarea { resize: vertical; min-height: 90px; }
.pv-input-hint { font-size: 12px; color: var(--pv-muted); margin-top: 4px; }

/* ---- Alert ---- */
.pv-alert {
  padding: 14px 18px; border-radius: 10px; font-size: 14px;
  margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px;
}
.pv-alert.success { background: #e8f7e8; color: #1a6e1b; border: 1px solid #b8e2b8; }
.pv-alert.error   { background: #fdeaea; color: #8b1a1a; border: 1px solid #f0b8b8; }
.pv-alert.info    { background: #e6f0ff; color: #1a3a8b; border: 1px solid #b8ccf0; }
.pv-alert.warning { background: #fff4e0; color: #7a4e00; border: 1px solid #f0d8b0; }

/* ---- Disabled overlay ---- */
.pv-disabled-notice {
  background: var(--pv-dark);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  color: #fff;
  margin-bottom: 32px;
}
.pv-disabled-notice .notice-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.pv-disabled-notice h3 { font-size: 22px; font-weight: 800; margin: 0 0 10px; }
.pv-disabled-notice p { color: rgba(255,255,255,0.6); font-size: 15px; max-width: 480px; margin: 0 auto 24px; }
.pv-disabled-notice .phone-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--pv-accent); color: #fff;
  padding: 13px 28px; border-radius: 50px;
  font-size: 16px; font-weight: 700; text-decoration: none;
}
.pv-disabled-notice .phone-cta:hover { background: var(--pv-accent-d); color: #fff; }
.pv-api-section-disabled {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  filter: blur(1px);
}

/* ---- Progress bar ---- */
.pv-progress { background: var(--pv-bg); border-radius: 10px; height: 8px; overflow: hidden; }
.pv-progress-bar { height: 100%; background: var(--pv-accent); border-radius: 10px; transition: width 0.4s; }

/* ---- Empty state ---- */
.pv-empty {
  text-align: center; padding: 48px 24px; color: var(--pv-muted);
}
.pv-empty svg { opacity: 0.3; margin-bottom: 16px; }
.pv-empty h4 { font-size: 16px; font-weight: 700; color: var(--pv-text); margin-bottom: 6px; }
.pv-empty p { font-size: 14px; margin-bottom: 20px; }

/* ---- Modal ---- */
.pv-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  align-items: center; justify-content: center;
}
.pv-modal-backdrop.open { display: flex; }
.pv-modal {
  background: #fff; border-radius: 16px;
  padding: 32px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh; overflow-y: auto;
}
.pv-modal-title { font-size: 18px; font-weight: 800; margin: 0 0 24px; }
.pv-modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ---- Tabs ---- */
.pv-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--pv-border); margin-bottom: 24px; }
.pv-tab {
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  color: var(--pv-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.pv-tab.active { color: var(--pv-accent); border-bottom-color: var(--pv-accent); }
.pv-tab:hover { color: var(--pv-text); }

/* ---- Auth pages ---- */
.pv-auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2332 0%, #2c3e50 60%, #3a5a6a 100%);
  padding: 32px 16px;
}
.pv-auth-box {
  background: #fff; border-radius: 20px;
  padding: 40px 40px; width: 100%; max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.pv-auth-logo { text-align: center; margin-bottom: 28px; }
.pv-auth-logo img { height: 40px; }
.pv-auth-title { font-size: 22px; font-weight: 800; color: var(--pv-dark); margin: 0 0 4px; }
.pv-auth-sub { font-size: 14px; color: var(--pv-muted); margin: 0 0 28px; }
.pv-auth-foot { text-align: center; margin-top: 24px; font-size: 13px; color: var(--pv-muted); }
.pv-auth-foot a { color: var(--pv-accent); font-weight: 600; text-decoration: none; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pv-sidebar { transform: translateX(-100%); }
  .pv-sidebar.open { transform: translateX(0); }
  .pv-main { margin-left: 0; }
  .pv-content { padding: 20px 16px; }
  .pv-topbar { padding: 0 16px; }
  .pv-stats { grid-template-columns: 1fr 1fr; }
  .pv-auth-box { padding: 28px 20px; }
}
@media (max-width: 480px) {
  .pv-stats { grid-template-columns: 1fr; }
}
