/* ===========================================================================
   AfryxISP customer portal — matches the /hotspot captive-portal design
   =========================================================================== */
:root {
    --afx-navy: #0a1e33;
    --afx-navy-2: #0f2f4d;
    --afx-blue: #1f9bcf;
    --afx-blue-dark: #1683b3;
    --afx-green: #46b649;
    --afx-green-dark: #35903f;
    --afx-ink: #102a43;
    --afx-muted: #64748b;
    --afx-line: #e6ecf4;
    --afx-radius: 16px;
    --afx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body { background: var(--afx-navy) !important; }
body { font-family: var(--afx-font); }
.web-footer, footer.web-footer, header.navbar, .navbar { display: none !important; }
.page_content { padding: 0 !important; }

/* ---- stage ---------------------------------------------------------------- */
.afryx-stage {
    min-height: 100vh;
    padding: 26px 14px 40px;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(31,155,207,.35), transparent 60%),
        radial-gradient(700px 420px at -10% 110%, rgba(63,167,63,.18), transparent 55%),
        linear-gradient(160deg, var(--afx-navy) 0%, var(--afx-navy-2) 100%);
    display: flex; justify-content: center; align-items: flex-start;
}

/* ---- portal frame ---------------------------------------------------------- */
.afryx-portal {
    display: flex;
    width: 100%; max-width: 1100px;
    min-height: 78vh;
    background: #f4f7fb;
    color: var(--afx-ink);
    border-radius: var(--afx-radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 12, 27, .45);
}

/* ---- sidebar ---------------------------------------------------------------- */
.afryx-sidebar {
    width: 224px; flex-shrink: 0;
    background: linear-gradient(180deg, #0e2740 0%, #0a1e33 100%);
    color: #b9cbdd;
    display: flex; flex-direction: column;
}
.afryx-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.afryx-brand img { height: 24px; background: #fff; border-radius: 999px; padding: 4px 10px; }
.afryx-nav { padding: 12px 10px; flex: 1; }
.afryx-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 14px; margin-bottom: 3px;
    color: #b9cbdd; text-decoration: none;
    font-size: 14px; font-weight: 600;
    border-radius: 10px;
    transition: background .15s ease, color .15s ease;
}
.afryx-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.afryx-nav a.active {
    background: linear-gradient(135deg, var(--afx-blue) 0%, var(--afx-blue-dark) 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(31,155,207,.35);
}
.afryx-ico { width: 17px; text-align: center; opacity: .85; }
.afryx-sidebar-foot {
    padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px;
}
.afryx-user { color: #7d97b3; margin-bottom: 6px; word-break: break-all; }
.afryx-logout { color: #6fc4e8; text-decoration: none; font-weight: 700; }
.afryx-logout:hover { color: #fff; }

/* ---- main / topbar ----------------------------------------------------------- */
.afryx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.afryx-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 26px;
    background: #fff;
    border-bottom: 1px solid var(--afx-line);
    position: sticky; top: 0; z-index: 5;
}
.afryx-topbar h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.02em; color: var(--afx-ink); }
.afryx-content { padding: 24px 26px 30px; }

/* ---- stat cards ----------------------------------------------------------------- */
.afryx-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.afryx-card {
    background: #fff; border: 1.5px solid var(--afx-line); border-radius: 14px;
    padding: 16px 18px; position: relative; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.afryx-card::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
    background: linear-gradient(180deg, var(--afx-blue), var(--afx-blue-dark));
    border-radius: 4px 0 0 4px;
}
.afryx-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(16,42,67,.10); }
.afryx-card-label {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--afx-muted); font-weight: 700; margin-bottom: 8px;
}
.afryx-card-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--afx-ink); }
.afryx-card-value.is-due { color: #dc2626; }
.afryx-card-sm { font-size: 16px; }
.afryx-card-value small { font-size: 13px; color: var(--afx-muted); font-weight: 600; }

/* ---- panels & tables --------------------------------------------------------------- */
.afryx-panel {
    background: #fff; border: 1.5px solid var(--afx-line); border-radius: 14px;
    margin-bottom: 22px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(16,42,67,.05);
}
.afryx-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px; border-bottom: 1px solid var(--afx-line);
}
.afryx-panel-head h2 { font-size: 15px; margin: 0; font-weight: 800; color: var(--afx-ink); }
.afryx-link { font-size: 13px; color: var(--afx-blue-dark); text-decoration: none; font-weight: 700; }
.afryx-link:hover { text-decoration: underline; }

.afryx-table { width: 100%; border-collapse: collapse; }
.afryx-table th, .afryx-table td {
    text-align: left; padding: 12px 18px; font-size: 13.5px;
    border-bottom: 1px solid var(--afx-line);
}
.afryx-table th {
    color: var(--afx-muted); font-weight: 700; background: #fafcfe;
    text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px;
}
.afryx-table tr:last-child td { border-bottom: none; }
.afryx-table tbody tr { transition: background .12s ease; }
.afryx-table-wide {
    background: #fff; border: 1.5px solid var(--afx-line); border-radius: 14px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(16,42,67,.05);
}
.afryx-table .text-right, .afryx-table th.text-right { text-align: right; }
.afryx-clickable { cursor: pointer; }
.afryx-clickable:hover { background: #f4fafd; }

/* ---- service cards ------------------------------------------------------------------- */
.afryx-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.afryx-service-card {
    background: #fff; border: 1.5px solid var(--afx-line); border-radius: 14px; padding: 18px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.afryx-service-card:hover {
    transform: translateY(-3px); border-color: #cfe6f2;
    box-shadow: 0 12px 26px rgba(16,42,67,.10);
}
.afryx-service-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.afryx-service-top h3 { font-size: 15px; margin: 0; font-weight: 800; color: var(--afx-ink); }
.afryx-speed { color: var(--afx-blue-dark); font-size: 22px; font-weight: 800; margin: 6px 0 12px; letter-spacing: -.01em; }
.afryx-speed small { font-size: 12px; color: var(--afx-muted); font-weight: 600; }
.afryx-kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; font-size: 13.5px; }
.afryx-kv dt { color: var(--afx-muted); font-weight: 600; }
.afryx-kv dd { margin: 0; text-align: right; font-weight: 700; color: var(--afx-ink); }

/* ---- badges ------------------------------------------------------------------------------ */
.afryx-badge {
    display: inline-block; padding: 3px 11px; border-radius: 999px;
    font-size: 11.5px; font-weight: 800; background: #eef2f7; color: #475569;
}
.afryx-badge-active, .afryx-badge-paid, .afryx-badge-resolved { background: #dcfce7; color: #166534; }
.afryx-badge-online, .afryx-badge-replied { background: #e0f2fe; color: #075985; }
.afryx-badge-blocked, .afryx-badge-overdue, .afryx-badge-unpaid { background: #fee2e2; color: #991b1b; }
.afryx-badge-pending, .afryx-badge-partly-paid, .afryx-badge-open, .afryx-badge-on-hold { background: #fef3c7; color: #92400e; }
.afryx-badge-stopped, .afryx-badge-closed, .afryx-badge-disabled { background: #eef2f7; color: #475569; }

/* ---- forms --------------------------------------------------------------------------------- */
.afryx-form {
    background: #fff; border: 1.5px solid var(--afx-line); border-radius: 14px;
    padding: 20px; margin-bottom: 20px;
}
.afryx-form-row { margin-bottom: 15px; display: flex; flex-direction: column; }
.afryx-form-row label {
    font-size: 12px; font-weight: 700; color: var(--afx-ink);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.afryx-form input, .afryx-form select, .afryx-form textarea {
    border: 1.5px solid var(--afx-line); border-radius: 11px;
    padding: 11px 13px; font-size: 15px; font-family: inherit; width: 100%;
    background: #fbfdff; color: var(--afx-ink); box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s; outline: none;
}
.afryx-form input:focus, .afryx-form select:focus, .afryx-form textarea:focus {
    border-color: var(--afx-blue); box-shadow: 0 0 0 3px rgba(31,155,207,.15);
}
.afryx-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.afryx-form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.afryx-bare-head { padding: 0 0 14px; border: none; }

/* ---- buttons ---------------------------------------------------------------------------------- */
.afryx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 11px; cursor: pointer;
    font-weight: 800; font-size: 14px; padding: 11px 20px;
    color: #fff; font-family: inherit;
    transition: transform .12s ease, box-shadow .15s ease, filter .15s;
}
.afryx-btn:active { transform: translateY(1px); }
.afryx-btn:disabled { opacity: .55; cursor: not-allowed; }
.afryx-btn-pay {
    background: linear-gradient(135deg, var(--afx-green) 0%, var(--afx-green-dark) 100%);
    box-shadow: 0 8px 18px rgba(63,167,63,.32);
}
.afryx-btn-pay:hover:not(:disabled) { filter: brightness(1.05); }
.afryx-btn-ghost {
    background: #fff; border: 1.5px solid var(--afx-line); color: var(--afx-ink);
    box-shadow: none;
}
.afryx-btn-ghost:hover { border-color: #cfe6f2; }
.afryx-btn-link { color: var(--afx-blue-dark); text-decoration: none; font-size: 13px; font-weight: 700; }
.afryx-row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- ticket thread ------------------------------------------------------------------------------- */
.afryx-ticket-meta { display: flex; gap: 10px; align-items: center; color: var(--afx-muted); font-size: 13px; margin: 14px 0 18px; flex-wrap: wrap; }
.afryx-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.afryx-msg { border: 1.5px solid var(--afx-line); border-radius: 14px; padding: 13px 16px; max-width: 80%; background: #fff; }
.afryx-msg-customer { align-self: flex-start; }
.afryx-msg-agent { background: #eff8fd; border-color: #c9e8f5; align-self: flex-end; }
.afryx-msg-head { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--afx-muted); margin-bottom: 6px; font-weight: 600; }
.afryx-msg-body { font-size: 14px; white-space: pre-wrap; color: var(--afx-ink); }

/* ---- misc -------------------------------------------------------------------------------------------- */
.afryx-due-banner {
    background: #fef3c7; border: 1.5px solid #fde68a; color: #92400e;
    padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600;
}
.afryx-empty { color: var(--afx-muted); padding: 26px 18px; text-align: center; font-size: 14px; }

/* ---- responsive ----------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
    .afryx-stage { padding: 0; }
    .afryx-portal { flex-direction: column; border-radius: 0; min-height: 100vh; max-width: none; }
    .afryx-sidebar { width: 100%; }
    .afryx-nav { display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
    .afryx-nav a { white-space: nowrap; padding: 9px 13px; margin-bottom: 0; }
    .afryx-sidebar-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .afryx-user { margin-bottom: 0; }
    .afryx-topbar { padding: 14px 16px; }
    .afryx-content { padding: 16px 14px 26px; }
    .afryx-msg { max-width: 100%; }
}
