/* Billing portal: sidebar layout, RTL. Brand colours from the public site (public.css). */

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWebFaNum_Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --pt-primary: #7C1012;
    --pt-primary-dark: #5A0B0D;
    --pt-primary-soft: #FBEDED;
    --pt-gold: #D4A853;
    --pt-bg: #F4F5F8;
    --pt-surface: #FFFFFF;
    --pt-border: #E4E7EC;
    --pt-text: #1B1F2A;
    --pt-muted: #667085;
    --pt-success: #067647;
    --pt-success-soft: #ECFDF3;
    --pt-warning: #B54708;
    --pt-warning-soft: #FFFAEB;
    --pt-danger: #B42318;
    --pt-danger-soft: #FEF3F2;
    --pt-info: #175CD3;
    --pt-info-soft: #EFF8FF;
    --pt-radius: 14px;
    --pt-side: 264px;
    --pt-shadow: 0 1px 2px rgba(16, 24, 40, .05);

    /* Not --bs-body-bg: Bootstrap paints inputs and tables with it, and they stay white. */
    --bs-body-font-family: 'IRANSans', Tahoma, 'Segoe UI', sans-serif;
    --bs-body-color: var(--pt-text);
    --bs-link-color: var(--pt-primary);
    --bs-link-color-rgb: 124, 16, 18;
    --bs-link-hover-color: var(--pt-primary-dark);
    --bs-link-hover-color-rgb: 90, 11, 13;
    --bs-border-color: var(--pt-border);
}

body { background: var(--pt-bg); color: var(--pt-text); line-height: 1.8; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* Buttons in the brand colour. */
.btn { border-radius: 10px; }
.btn-primary {
    --bs-btn-bg: var(--pt-primary); --bs-btn-border-color: var(--pt-primary);
    --bs-btn-hover-bg: var(--pt-primary-dark); --bs-btn-hover-border-color: var(--pt-primary-dark);
    --bs-btn-active-bg: var(--pt-primary-dark); --bs-btn-active-border-color: var(--pt-primary-dark);
    --bs-btn-disabled-bg: var(--pt-primary); --bs-btn-disabled-border-color: var(--pt-primary);
    --bs-btn-focus-shadow-rgb: 124, 16, 18;
}
.btn-outline-primary {
    --bs-btn-color: var(--pt-primary); --bs-btn-border-color: var(--pt-primary);
    --bs-btn-hover-bg: var(--pt-primary); --bs-btn-hover-border-color: var(--pt-primary);
    --bs-btn-active-bg: var(--pt-primary-dark); --bs-btn-active-border-color: var(--pt-primary-dark);
    --bs-btn-focus-shadow-rgb: 124, 16, 18;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #C9696B; box-shadow: 0 0 0 .2rem rgba(124, 16, 18, .15);
}
.form-check-input:checked { background-color: var(--pt-primary); border-color: var(--pt-primary); }

/* ── shell ─────────────────────────────────────────────────────────────────── */

.pt-side {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    width: var(--pt-side); z-index: 1040;
    background: var(--pt-surface); border-inline-end: 1px solid var(--pt-border);
    display: flex; flex-direction: column; overflow-y: auto;
    transition: transform .25s ease;
}
.pt-main { margin-inline-start: var(--pt-side); min-height: 100vh; display: flex; flex-direction: column; }
.pt-content { padding: 28px 32px 48px; width: 100%; max-width: 1080px; }
.pt-backdrop { display: none; }

.pt-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; text-decoration: none; color: inherit; }
.pt-brand img { width: 40px; height: 40px; border-radius: 10px; }
.pt-brand b { display: block; font-size: 1.05rem; color: var(--pt-primary); }
.pt-brand small { display: block; color: var(--pt-muted); font-size: .78rem; line-height: 1.4; }

.pt-user {
    margin: 0 14px 12px; padding: 12px; border-radius: 12px; background: var(--pt-bg);
    display: flex; align-items: center; gap: 10px;
}
.pt-avatar {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    background: var(--pt-primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.pt-user .who { min-width: 0; }
.pt-user .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.pt-user .who span { display: block; color: var(--pt-muted); font-size: .78rem; }

.pt-nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.pt-nav-label { color: var(--pt-muted); font-size: .72rem; padding: 14px 12px 4px; }
.pt-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
    color: var(--pt-text); text-decoration: none; font-size: .93rem; position: relative;
    background: none; border: 0; width: 100%; text-align: start;
}
.pt-link i { font-size: 1.1rem; color: var(--pt-muted); width: 22px; text-align: center; }
.pt-link:hover { background: var(--pt-bg); color: var(--pt-text); }
.pt-link.active { background: var(--pt-primary-soft); color: var(--pt-primary); font-weight: 700; }
.pt-link.active i { color: var(--pt-primary); }
.pt-link.active::before {
    content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px;
    width: 4px; border-radius: 4px; background: var(--pt-primary);
}
.pt-count {
    margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700;
    background: var(--pt-border); color: var(--pt-text);
}
.pt-count.danger { background: var(--pt-danger); color: #fff; }
.pt-count.warn { background: var(--pt-gold); color: #3B2A06; }

.pt-side-foot { margin-top: auto; padding: 12px 10px 18px; border-top: 1px solid var(--pt-border); }

.pt-topbar {
    display: none; position: sticky; top: 0; z-index: 1030;
    background: var(--pt-primary); color: #fff; padding: 10px 16px; align-items: center; gap: 12px;
}
.pt-topbar button { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; padding: 2px 4px; }
.pt-topbar img { width: 30px; height: 30px; border-radius: 8px; }
.pt-topbar b { font-size: 1rem; }

@media (max-width: 991.98px) {
    .pt-side { transform: translateX(100%); box-shadow: none; }
    .pt-side.open { transform: none; box-shadow: -8px 0 32px rgba(16, 24, 40, .18); }
    .pt-main { margin-inline-start: 0; }
    .pt-topbar { display: flex; }
    .pt-content { padding: 20px 16px 40px; }
    .pt-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 1035; }
}

/* ── page pieces ───────────────────────────────────────────────────────────── */

.pt-head { margin-bottom: 22px; }
.pt-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }
.pt-head p { color: var(--pt-muted); margin: 0; font-size: .92rem; }
.pt-head .pt-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-head .pt-head-row .btn { margin-inline-start: auto; }

.pt-card {
    background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: var(--pt-radius);
    box-shadow: var(--pt-shadow); margin-bottom: 20px;
}
.pt-card-head {
    padding: 14px 18px; border-bottom: 1px solid var(--pt-border);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pt-card-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.pt-card-head .sub { color: var(--pt-muted); font-size: .82rem; }
.pt-card-head .end { margin-inline-start: auto; }
.pt-card-body { padding: 18px; }
.pt-card-foot { padding: 12px 18px; border-top: 1px solid var(--pt-border); background: #FCFCFD; border-radius: 0 0 var(--pt-radius) var(--pt-radius); }

/* Numbers at the top of the dashboard. */
.pt-stat { display: flex; gap: 14px; align-items: flex-start; padding: 16px; height: 100%; }
.pt-stat .ico {
    width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
    background: var(--pt-primary-soft); color: var(--pt-primary);
}
.pt-stat .ico.ok { background: var(--pt-success-soft); color: var(--pt-success); }
.pt-stat .ico.warn { background: var(--pt-warning-soft); color: var(--pt-warning); }
.pt-stat .ico.info { background: var(--pt-info-soft); color: var(--pt-info); }
.pt-stat .label { color: var(--pt-muted); font-size: .82rem; }
.pt-stat .value { font-size: 1.15rem; font-weight: 700; line-height: 1.5; }
.pt-stat .hint { color: var(--pt-muted); font-size: .8rem; }
a.pt-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
a.pt-card:hover { border-color: #D0A3A4; }

/* Label above value, for agency details. */
.pt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; }
.pt-facts .k { color: var(--pt-muted); font-size: .8rem; }
.pt-facts .v { font-weight: 700; }

/* Status chips. */
.pt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pt-chip.ok { background: var(--pt-success-soft); color: var(--pt-success); }
.pt-chip.warn { background: var(--pt-warning-soft); color: var(--pt-warning); }
.pt-chip.danger { background: var(--pt-danger-soft); color: var(--pt-danger); }
.pt-chip.info { background: var(--pt-info-soft); color: var(--pt-info); }
.pt-chip.muted { background: #F2F4F7; color: var(--pt-muted); }

/* Tables inside cards. */
.pt-table { margin: 0; font-size: .9rem; }
.pt-table th { color: var(--pt-muted); font-weight: 400; font-size: .8rem; background: #FCFCFD; white-space: nowrap; }
.pt-table td, .pt-table th { padding: 10px 14px; vertical-align: middle; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table .sub { color: var(--pt-muted); font-size: .8rem; }
.pt-table tfoot td { font-weight: 700; background: #FCFCFD; }

/* Empty state. */
.pt-empty { text-align: center; padding: 34px 18px; color: var(--pt-muted); }
.pt-empty i { font-size: 2.2rem; display: block; margin-bottom: 8px; color: #98A2B3; }
.pt-empty b { display: block; color: var(--pt-text); margin-bottom: 4px; }

/* Numbered steps: how buying works, and where an order is. */
.pt-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.pt-steps li {
    flex: 1 1 140px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    background: var(--pt-surface); border: 1px solid var(--pt-border); color: var(--pt-muted); font-size: .86rem;
}
.pt-steps li .n {
    width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: #F2F4F7; font-weight: 700; font-size: .8rem;
}
.pt-steps li.current { border-color: var(--pt-primary); color: var(--pt-text); font-weight: 700; }
.pt-steps li.current .n { background: var(--pt-primary); color: #fff; }
.pt-steps li.done { color: var(--pt-success); }
.pt-steps li.done .n { background: var(--pt-success-soft); color: var(--pt-success); }
.pt-steps.compact { margin: 0; }
.pt-steps.compact li { flex-basis: 110px; padding: 6px 10px; font-size: .8rem; }
.pt-steps.compact li .n { width: 22px; height: 22px; }

/* Plan cards. */
.pt-plan { display: flex; flex-direction: column; height: 100%; padding: 22px; }
.pt-plan h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.pt-plan .price { font-size: 1.35rem; font-weight: 700; color: var(--pt-primary); line-height: 1.4; }
.pt-plan .per { color: var(--pt-muted); font-size: .82rem; }
.pt-plan ul { list-style: none; padding: 0; margin: 16px 0; font-size: .9rem; }
.pt-plan li { display: flex; gap: 8px; padding: 3px 0; }
.pt-plan li i { color: var(--pt-success); }

/* Choice cards (billing cycle). */
.pt-choice { display: block; cursor: pointer; position: relative; }
.pt-choice input { position: absolute; opacity: 0; }
.pt-choice span {
    display: block; padding: 12px 14px; border: 1px solid var(--pt-border); border-radius: 12px; background: var(--pt-surface);
}
.pt-choice span small { display: block; color: var(--pt-muted); }
.pt-choice input:checked + span { border-color: var(--pt-primary); background: var(--pt-primary-soft); }
.pt-choice input:focus-visible + span { box-shadow: 0 0 0 .2rem rgba(124, 16, 18, .2); }

.pt-form-section { font-size: .95rem; font-weight: 700; margin: 4px 0 12px; }
.form-text { color: var(--pt-muted); }

/* Sign-in pages, without the sidebar. */
.pt-bare { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.pt-bare .pt-brand { justify-content: center; padding: 0 0 18px; }
.pt-bare .pt-brand img { width: 52px; height: 52px; border-radius: 14px; }
.pt-bare .pt-brand b { font-size: 1.25rem; }
.pt-bare-card { width: 100%; max-width: 440px; }
.pt-bare-foot { color: var(--pt-muted); font-size: .8rem; margin-top: 18px; text-align: center; }
.pt-features { list-style: none; padding: 0; margin: 0 0 18px; font-size: .88rem; }
.pt-features li { display: flex; gap: 10px; padding: 4px 0; }
.pt-features li i { color: var(--pt-primary); }

.alert { border-radius: 12px; }
