/* s49-license.css — Admin → License page (hero, usage, modules, install, history).
   Theme-safe: colors come from CSS variables only (day/night mode). 8px spacing scale. */

.lic-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }

/* ── Hero ─────────────────────────────────────────────────── */
.lic-hero {
    --lic-tone: var(--success);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--lic-tone) 14%, transparent) 0%, transparent 60%),
        var(--surface);
}
.lic-hero.is-warning { --lic-tone: var(--warning); }
.lic-hero.is-danger  { --lic-tone: var(--danger); }
.lic-hero.is-none    { --lic-tone: var(--text-muted); }

.lic-eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.lic-plan-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 6px 0 4px; }
.lic-plan { font-size: 1.9rem; line-height: 1.15; font-weight: 700; margin: 0; color: var(--text); }
.lic-customer { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .95rem; }
.lic-customer svg { width: 18px; height: 18px; flex: none; }

.lic-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.lic-meta-item { min-width: 120px; }
.lic-meta-item .k { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: 2px; }
.lic-meta-item .v { font-weight: 600; color: var(--text); }
.lic-keyid { display: inline-flex; align-items: center; gap: 8px; }
.lic-keyid code { font-size: .8rem; padding: 3px 8px; border-radius: 6px; background: var(--surface-alt); border: 1px solid var(--border); }
.lic-copy {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
    transition: color .15s, border-color .15s, transform .15s;
}
.lic-copy:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.lic-copy svg { width: 15px; height: 15px; }
.lic-copy.is-done { color: var(--success); border-color: var(--success); }

/* Countdown ring */
.lic-ring { position: relative; width: 148px; height: 148px; flex: none; }
.lic-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lic-ring .track { fill: none; stroke: var(--border); stroke-width: 10; }
.lic-ring .bar   { fill: none; stroke: var(--lic-tone); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.lic-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 12px; }
.lic-ring-num { font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--text); }
.lic-ring-cap { font-size: .72rem; color: var(--text-muted); margin-top: 4px; line-height: 1.25; }

/* ── Usage tiles ──────────────────────────────────────────── */
.lic-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.lic-tile { display: grid; gap: 10px; }
.lic-tile-head { display: flex; align-items: center; gap: 12px; }
.lic-tile-ico {
    width: 40px; height: 40px; border-radius: 12px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.lic-tile-ico svg { width: 20px; height: 20px; }
.lic-tile-label { font-size: .8rem; color: var(--text-muted); }
.lic-tile-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.lic-tile-value small { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.lic-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); overflow: hidden; }
.lic-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .6s ease; }
.lic-bar.is-warning > span { background: var(--warning); }
.lic-bar.is-danger > span  { background: var(--danger); }
.lic-bar.is-unlimited > span { width: 100% !important; background: color-mix(in srgb, var(--success) 45%, transparent); }
.lic-tile-note { font-size: .78rem; color: var(--text-muted); }

/* ── Section head ─────────────────────────────────────────── */
.lic-sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-2); }
.lic-sec-head h2 { margin: 0; }
.lic-sec-sub { color: var(--text-muted); font-size: .85rem; }

/* ── Modules ──────────────────────────────────────────────── */
.lic-mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lic-mod {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
    font-weight: 500; color: var(--text); min-width: 0;
}
.lic-mod .dot {
    width: 22px; height: 22px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent);
}
.lic-mod .dot svg { width: 13px; height: 13px; }
.lic-mod.is-off { color: var(--text-muted); background: var(--surface-alt); border-style: dashed; }
.lic-mod.is-off .dot { color: var(--text-muted); background: transparent; border: 1px solid var(--border); }
.lic-mod .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lic-core-note {
    display: flex; align-items: flex-start; gap: 10px; margin-top: var(--space-2);
    font-size: .85rem; color: var(--text-muted);
}
.lic-core-note svg { width: 18px; height: 18px; flex: none; color: var(--success); margin-top: 1px; }

/* ── Install ──────────────────────────────────────────────── */
.lic-form { display: grid; gap: var(--space-3); }
.lic-step { display: grid; gap: 12px; padding: var(--space-2) var(--space-3) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); }
.lic-step-head { display: flex; align-items: center; gap: 12px; }
.lic-step-no {
    width: 28px; height: 28px; border-radius: 50%; flex: none; font-weight: 700; font-size: .85rem;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.lic-step-title { font-weight: 600; color: var(--text); }
.lic-step-sub { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.lic-form textarea {
    width: 100%; min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace;
    font-size: .8rem; line-height: 1.5; border-style: dashed; background: var(--surface);
}
/* Amount | Currency | Invoice no. — always one row on desktop */
.lic-pay-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); gap: 16px; align-items: start; }
.lic-pay-row .form-group { margin: 0; }
.lic-pay-row input, .lic-pay-row select { width: 100%; box-sizing: border-box; min-height: 42px; }
.lic-install-foot { display: flex; justify-content: flex-end; }

/* ── History ──────────────────────────────────────────────── */
.lic-table-wrap { overflow-x: auto; }
.lic-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.lic-table th {
    text-align: left; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.lic-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.lic-table tbody tr:last-child td { border-bottom: 0; }
.lic-table tbody tr:hover td { background: var(--surface-alt); }
.lic-table .num { color: var(--text-muted); width: 48px; }
.lic-plan-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: .8rem; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.lic-muted { color: var(--text-muted); }
.lic-empty { text-align: center; padding: var(--space-4) 0; color: var(--text-muted); }
.lic-empty svg { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
    .lic-hero { grid-template-columns: 1fr; justify-items: start; }
    .lic-ring { width: 128px; height: 128px; }
    .lic-pay-row { grid-template-columns: 1fr 120px; }
    .lic-pay-row .form-group:last-child { grid-column: 1 / -1; }
    .lic-plan { font-size: 1.5rem; }
}

.lic-ring-text > svg { width: 56px; height: 56px; opacity: .6; }

.lic-note-cell { white-space: normal !important; max-width: 280px; }
.lic-note-cell span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lic-table { min-width: 760px; }
.lic-table td:first-child, .lic-table th:first-child { padding-left: 18px; }

/* ── Subscription plans ───────────────────────────────────── */
.lic-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; padding-top: 8px; }
@media (max-width: 900px) { .lic-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lic-plan-grid { grid-template-columns: 1fr; } }
.lic-plan-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 18px 18px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lic-plan-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 12%, transparent); }
.lic-plan-card.is-featured { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 55%), var(--surface); }
.lic-plan-card.is-current { border-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent); }
.lic-plan-flag {
    position: absolute; top: -11px; left: 16px; padding: 3px 10px; border-radius: 999px;
    font-size: .68rem; font-weight: 700; letter-spacing: .05em; color: #fff; background: var(--primary);
}
.lic-plan-flag.is-current { background: var(--success); }
.lic-plan-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.lic-plan-dur { color: var(--text-muted); font-size: .85rem; }
.lic-plan-price { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.15; margin-top: 8px; }
.lic-plan-price.is-ask { font-size: 1rem; font-weight: 600; color: var(--text-muted); min-height: 2.2em; display: flex; align-items: center; margin-top: 8px; }
.lic-plan-sub { font-size: .8rem; color: var(--text-muted); min-height: 1.2em; }
.lic-plan-save { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.lic-plan-save.is-none { background: transparent; }
.lic-plan-feat { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 6px; font-size: .82rem; color: var(--text-muted); flex: 1; }
.lic-plan-feat li { display: flex; gap: 8px; align-items: flex-start; }
.lic-plan-feat svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--success); }
.lic-plan-card .btn { width: 100%; justify-content: center; }

.lic-req { margin-top: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); border: 1px dashed var(--primary); border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.lic-req[hidden] { display: none; }
.lic-req-head { display: flex; align-items: center; gap: 8px; }
.lic-req-head svg { width: 16px; height: 16px; color: var(--primary); }
.lic-req textarea { width: 100%; resize: vertical; background: var(--surface); font-size: .85rem; }
.lic-req-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.lic-req-contact { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: .85rem; color: var(--text); }
.lic-req-contact span { display: inline-flex; align-items: center; gap: 6px; }
.lic-req-contact svg { width: 15px; height: 15px; color: var(--primary); }

/* ── License BLOCKED page inside the app shell (views/license/blocked.php) ── */
.lb-wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.lb-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
           padding: 28px 32px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
           background:
             radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--danger) 14%, transparent), transparent 62%),
             linear-gradient(180deg, color-mix(in srgb, var(--danger) 4%, var(--bg)), var(--bg)); }
.lb-badge { margin: 0 14px; width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative;
            color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, var(--bg)); }
.lb-badge::before, .lb-badge::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--danger) 22%, transparent); }
.lb-badge::after { inset: -19px; border-color: color-mix(in srgb, var(--danger) 10%, transparent); }
.lb-badge svg { width: 34px; height: 34px; }
.lb-hero-text h1 { margin: 0 0 6px; font-size: 1.55rem; line-height: 1.3; }
.lb-hero-text p { margin: 0; color: var(--text-muted); line-height: 1.7; max-width: 62ch; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8rem;
           background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.lb-chip svg { width: 14px; height: 14px; }
.lb-chip strong { color: var(--text); font-weight: 600; }
.lb-chip.is-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--bg)); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.lb-chip.is-danger strong { color: var(--danger); }
.lb-hero-actions { display: flex; flex-direction: column; gap: 10px; min-width: 190px; }
.lb-hero-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.lb-hero-actions .btn svg { width: 16px; height: 16px; }
.lb-cta { padding-block: 12px; font-weight: 700; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }

.lb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: stretch; }
.lb-card { padding: 22px 24px; display: flex; flex-direction: column; }
.lb-h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 14px; }
.lb-h3 { font-size: .95rem; font-weight: 700; margin: 20px 0 8px; }
.lb-sub { margin: -6px 0 14px; font-size: .84rem; color: var(--text-muted); line-height: 1.65; }
.lb-provider { display: block; margin-top: 2px; }

.lb-steps { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lb-steps li { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 68px;
               border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.lb-step-n { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
             font-weight: 700; font-size: 1.05rem; color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, var(--bg)); }
.lb-steps li:last-child { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: color-mix(in srgb, var(--primary) 5%, var(--bg)); }
.lb-steps li:last-child .lb-step-n { color: #fff; background: var(--primary); }
.lb-steps strong { display: block; font-size: .98rem; line-height: 1.35; }
.lb-steps p { margin: 2px 0 0; font-size: .84rem; color: var(--text-muted); line-height: 1.5; }

.lb-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.lb-timeline li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; font-size: .86rem; border-bottom: 1px dashed var(--border); }
.lb-timeline li:last-child { border-bottom: 0; }
.lb-tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); }
.lb-timeline li.is-now .lb-tl-dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); }
.lb-tl-label { color: var(--text); }
.lb-tl-date { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lb-timeline li.is-now .lb-tl-label { font-weight: 700; color: var(--danger); }

.lb-channels { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lb-channels .lb-ch { flex: 1 1 auto; }
.lb-ch { --ch: var(--primary); display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
         transition: border-color .15s, box-shadow .15s, transform .15s; }
.lb-ch:hover, .lb-ch:focus-within { border-color: var(--ch); box-shadow: 0 6px 16px color-mix(in srgb, var(--ch) 16%, transparent); transform: translateY(-1px); }
.lb-ch[data-brand="telegram"] { --ch: #229ed9; }
.lb-ch[data-brand="facebook"] { --ch: #1877f2; }
.lb-ch[data-brand="phone"]    { --ch: #16a34a; }
.lb-ch[data-brand="email"]    { --ch: #f59e0b; }
.lb-ch[data-brand="web"]      { --ch: #7c3aed; }
.lb-ch-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; color: inherit;
              border-radius: var(--radius-sm); }
.lb-ch-main:focus-visible { outline: 2px solid var(--ch); outline-offset: -2px; }
.lb-ch-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
              color: var(--ch); background: color-mix(in srgb, var(--ch) 13%, var(--bg)); }
.lb-ch-icon svg { width: 20px; height: 20px; }
.lb-ch-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.lb-ch-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.lb-ch-value { font-weight: 600; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-ch-tip { font-size: .78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-ch-go { color: var(--text-muted); display: inline-flex; }
.lb-ch-go svg { width: 15px; height: 15px; }
.lb-ch-main:hover .lb-ch-go { color: var(--ch); }
.lb-copy { flex: 0 0 auto; width: 52px; border: 0; border-inline-start: 1px solid var(--border); background: transparent; color: var(--text-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
           cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s, background .15s; }
.lb-copy svg { width: 17px; height: 17px; }
.lb-copy:hover, .lb-copy:focus-visible { color: var(--ch); background: color-mix(in srgb, var(--ch) 8%, transparent); outline: none; }
.lb-copy.is-done { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--bg)); }

.lb-safe { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-sm); font-size: .88rem; line-height: 1.6;
           color: var(--text); background: color-mix(in srgb, var(--success) 9%, var(--bg)); border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
.lb-safe svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--success); }
.lb-foot { text-align: center; font-size: .78rem; color: var(--text-muted); padding-bottom: 8px; }

@media (max-width: 960px) {
    .lb-grid { grid-template-columns: minmax(0, 1fr); }
    .lb-hero { grid-template-columns: auto minmax(0, 1fr); }
    .lb-hero-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
    .lb-hero-actions .btn { flex: 1 1 180px; }
}
@media (max-width: 560px) {
    .lb-hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 24px 18px; justify-items: center; }
    .lb-hero-text p { margin-inline: auto; }
    .lb-chips { justify-content: center; }
    .lb-card { padding: 20px 16px; }
}
@media (prefers-reduced-motion: no-preference) {
    .lb-badge::before { animation: lb-pulse 2.8s ease-out infinite; }
    @keyframes lb-pulse { 0% { transform: scale(.92); opacity: .9; } 70% { transform: scale(1.12); opacity: 0; } 100% { opacity: 0; } }
}

/* Locked sidebar entries (layouts/main.php when $licenseLocked) */
.sidebar-link.is-locked { opacity: .45; cursor: not-allowed; user-select: none; }
.sidebar-link.is-locked:hover { background: transparent; }
.sidebar-link-lock { margin-inline-start: auto; display: inline-flex; }
.sidebar-link-lock svg { width: 14px; height: 14px; }
.sidebar.sidebar-hidden .sidebar-link-lock { display: none; }
