/* P7 Nexus — customer portal (login, home, apps). Standalone: shares nothing with the admin console CSS. */
:root {
  --pt-blue: #1D6DB5; --pt-blue-dark: #155a99; --pt-blue-soft: #e8f1fa;
  --pt-ink: #1a2433; --pt-muted: #6b7686; --pt-line: #e6eaf0; --pt-bg: #f4f7fb;
  --pt-green: #1A8C5B; --pt-red: #c0392b; --pt-orange: #F79420;
  --pt-radius: 16px; --pt-shadow: 0 10px 30px rgba(24, 44, 78, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--pt-ink); background: var(--pt-bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ── Top progress bar (page transitions) ── */
.pt-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--pt-blue), #3b8fd4); z-index: 9999; opacity: 0; transition: width .6s ease, opacity .2s; }
.pt-progress.on { opacity: 1; width: 80%; }

/* ── Login ── */
.pt-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 10% -10%, #dcebfa 0%, transparent 60%), radial-gradient(900px 500px at 100% 110%, #fde9d2 0%, transparent 55%), #f4f7fb; }
.pt-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; }
.pt-blob.b1 { width: 380px; height: 380px; background: #b9d6f2; top: -90px; left: -80px; }
.pt-blob.b2 { width: 320px; height: 320px; background: #fbd9ae; bottom: -80px; right: -60px; }
.pt-blob.b3 { width: 220px; height: 220px; background: #c9ecd9; top: 55%; left: 62%; opacity: .35; }
.pt-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(29,109,181,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(29,109,181,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); pointer-events: none; }
.pt-card { position: relative; width: 100%; max-width: 420px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.7); border-radius: 20px; padding: 38px 34px 28px; box-shadow: 0 24px 60px rgba(24,44,78,.14), 0 2px 6px rgba(24,44,78,.06); }
.pt-brand { text-align: center; margin-bottom: 26px; }
.pt-brand .p7-logo { margin: 0 auto; }
.pt-brand .pt-product { margin-top: 10px; font-size: 12px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--pt-blue); }
.pt-card h1 { margin: 0; text-align: center; font-size: 24px; font-weight: 700; }
.pt-card .pt-sub { text-align: center; margin: 6px 0 24px; color: var(--pt-muted); font-size: 14px; }
.pt-field { margin-bottom: 16px; }
.pt-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3d4858; }
.pt-input { position: relative; }
.pt-input > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #97a3b4; font-size: 14px; pointer-events: none; transition: color .15s; }
.pt-input input { width: 100%; height: 46px; padding: 0 44px 0 40px; border: 1px solid #d9e0ea; border-radius: 12px; font: inherit; font-size: 14.5px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.pt-input input:focus { border-color: var(--pt-blue); box-shadow: 0 0 0 4px rgba(29,109,181,.12); }
.pt-input:focus-within > i.lead { color: var(--pt-blue); }
.pt-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; background: none; color: #8793a5; cursor: pointer; border-radius: 8px; }
.pt-eye:hover { background: #f0f3f7; color: var(--pt-ink); }
.pt-error { display: flex; gap: 10px; align-items: flex-start; background: #fdecec; color: var(--pt-red); border: 1px solid #f6caca; border-radius: 12px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px; }
.pt-btn { width: 100%; height: 48px; margin-top: 6px; border: none; border-radius: 12px; font: inherit; font-weight: 600; font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(180deg, #2a7fcb, var(--pt-blue)); box-shadow: 0 6px 16px rgba(29,109,181,.28); display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .15s, box-shadow .15s, filter .15s; }
.pt-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(29,109,181,.34); }
.pt-btn:active:not(:disabled) { transform: translateY(0); }
.pt-btn:disabled { cursor: progress; filter: saturate(.8) brightness(.97); }
.pt-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: pt-rot .7s linear infinite; display: none; }
.pt-btn.loading .pt-spin { display: inline-block; }
@keyframes pt-rot { to { transform: rotate(360deg); } }
.pt-foot { text-align: center; margin: 22px 0 0; font-size: 12px; color: #a3adbb; }

/* ── Usage page extras ── */
.pt-note { margin: -4px 0 20px; font-size: 12.5px; color: var(--pt-muted); }
.pt-note i { margin-right: 6px; color: var(--pt-blue); }
.pt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-search { position: relative; width: 100%; max-width: 320px; margin: 0; }
.pt-search > i.fa-magnifying-glass { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #97a3b4; font-size: 13px; pointer-events: none; }
.pt-search input[type=search] { width: 100%; height: 38px; padding: 0 34px 0 34px; border: 1px solid #d9e0ea; border-radius: 10px; font: inherit; font-size: 13.5px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s; }
.pt-search input[type=search]:focus { border-color: var(--pt-blue); box-shadow: 0 0 0 4px rgba(29,109,181,.12); }
.pt-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; color: #8793a5; border-radius: 6px; text-decoration: none; font-size: 12px; }
.pt-clear:hover { background: #f0f3f7; color: var(--pt-ink); }

/* ── Header ── */
.pt-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--pt-line); }
.pt-header-in { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pt-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.pt-logo img { height: 34px; width: auto; }
.pt-logo .p7-logo { height: 28px; }
.pt-user { display: flex; align-items: center; gap: 14px; }
.pt-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--pt-blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; text-transform: uppercase; }
.pt-who { line-height: 1.25; text-align: right; }
.pt-who strong { display: block; font-size: 14px; }
.pt-who small { color: var(--pt-muted); font-size: 12.5px; }
.pt-logout { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid #d9e0ea; background: #fff; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--pt-ink); transition: border-color .15s, color .15s, background .15s; }
.pt-logout:hover { border-color: var(--pt-red); color: var(--pt-red); background: #fff7f6; }

/* ── Home ── */
.pt-main { max-width: 1120px; margin: 0 auto; padding: 40px 24px 60px; }
.pt-hero h1 { margin: 0; font-size: 28px; font-weight: 700; }
.pt-hero p { margin: 6px 0 0; color: var(--pt-muted); font-size: 15px; }
.pt-section { margin: 34px 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #8793a5; }
.pt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.pt-app { position: relative; display: block; text-decoration: none; background: #fff; border: 1px solid var(--pt-line); border-radius: var(--pt-radius); padding: 28px; box-shadow: var(--pt-shadow); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.pt-app::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent, var(--pt-blue)); opacity: .9; }
.pt-app:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent, var(--pt-blue)) 45%, #fff); box-shadow: 0 18px 40px rgba(24,44,78,.14); }
.pt-app-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: var(--accent, var(--pt-blue)); background: color-mix(in srgb, var(--accent, var(--pt-blue)) 12%, #fff); margin-bottom: 18px; transition: transform .25s ease; }
.pt-app:hover .pt-app-icon { transform: scale(1.08) rotate(-4deg); }
.pt-app h3 { margin: 0; font-size: 19px; }
.pt-app .pt-tag { margin: 3px 0 10px; font-size: 13px; font-weight: 600; color: var(--accent, var(--pt-blue)); }
.pt-app p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--pt-muted); }
.pt-open { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--accent, var(--pt-blue)); }
.pt-open i { transition: transform .2s ease; }
.pt-app:hover .pt-open i { transform: translateX(6px); }
.pt-empty { background: #fff; border: 1px dashed #cfd7e3; border-radius: var(--pt-radius); padding: 36px; text-align: center; color: var(--pt-muted); }

/* ── App pages ── */
.pt-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pt-muted); margin-bottom: 18px; }
.pt-crumb a { text-decoration: none; color: var(--pt-blue); font-weight: 600; }
.pt-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pt-title h1 { margin: 0; font-size: 26px; }
.pt-title p { margin: 4px 0 0; color: var(--pt-muted); font-size: 14px; }
.pt-filter { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pt-filter label { display: block; font-size: 11.5px; font-weight: 600; color: var(--pt-muted); margin-bottom: 4px; }
.pt-filter input[type=date] { height: 38px; padding: 0 10px; border: 1px solid #d9e0ea; border-radius: 10px; font: inherit; font-size: 13.5px; background: #fff; }
.pt-btn-s { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--pt-blue); background: var(--pt-blue); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.pt-btn-s.ghost { background: #fff; color: var(--pt-ink); border-color: #d9e0ea; }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pt-stat { background: #fff; border: 1px solid var(--pt-line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--pt-shadow); }
.pt-stat small { display: block; color: var(--pt-muted); font-size: 12.5px; font-weight: 600; }
.pt-stat b { display: block; font-size: 28px; margin: 4px 0 2px; }
.pt-stat span { font-size: 12px; color: var(--pt-muted); }
.pt-panel { background: #fff; border: 1px solid var(--pt-line); border-radius: var(--pt-radius); padding: 22px; box-shadow: var(--pt-shadow); margin-bottom: 20px; }
.pt-panel h2 { margin: 0 0 14px; font-size: 15px; }
.pt-bar { height: 10px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.pt-bar > div { height: 100%; background: linear-gradient(90deg, #2a7fcb, var(--pt-blue)); border-radius: 99px; width: 0; transition: width 1s ease; }
.pt-bar.warn > div { background: linear-gradient(90deg, #f9b04e, var(--pt-orange)); }
.pt-bar.full > div { background: linear-gradient(90deg, #e1594a, var(--pt-red)); }
.pt-pack-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--pt-muted); flex-wrap: wrap; gap: 6px; }
.pt-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.pt-chart-box { position: relative; height: 260px; }
.pt-skel { position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%); background-size: 200% 100%; animation: pt-shimmer 1.2s infinite; }
@keyframes pt-shimmer { to { background-position: -200% 0; } }
.pt-chart-err { display: none; position: absolute; inset: 0; place-items: center; text-align: center; color: var(--pt-muted); font-size: 14px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-table th { text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: #8793a5; padding: 10px 12px; background: #f8fafc; }
.pt-table td { padding: 12px; border-top: 1px solid #eef2f7; }
.pt-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.pt-pill.ok { background: #e6f7ee; color: var(--pt-green); } .pt-pill.bad { background: #fde8e8; color: var(--pt-red); }
.pt-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--pt-muted); }
.pt-table-wrap { overflow-x: auto; }
.pt-forbidden { text-align: center; padding: 70px 20px; }
.pt-forbidden .ic { width: 76px; height: 76px; border-radius: 50%; background: #fdecec; color: var(--pt-red); display: grid; place-items: center; margin: 0 auto 18px; font-size: 30px; }
.pt-soon { text-align: center; padding: 60px 20px; color: var(--pt-muted); }
.pt-soon .ic { width: 76px; height: 76px; border-radius: 20px; background: #f1ecfb; color: #7c3aed; display: grid; place-items: center; margin: 0 auto 18px; font-size: 30px; }

@media (max-width: 640px) {
  .pt-card { padding: 30px 22px 22px; border-radius: 16px; }
  .pt-header-in { padding: 10px 16px; } .pt-who { display: none; }
  .pt-main { padding: 26px 16px 48px; } .pt-hero h1 { font-size: 23px; }
  .pt-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
