:root {
    --bg-dark: #0a0f1a;
    --panel: rgba(15, 20, 30, 0.78);
    --panel-solid: #121826;
    --surface: rgba(240, 245, 255, 0.94);
    --accent-cyan: #00e5ff;
    --accent-purple: #b300ff;
    --accent-green: #22c55e;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #1e293b;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }

.cyber-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(179, 0, 255, 0.08), transparent 25%),
        linear-gradient(135deg, rgba(4, 14, 30, 0.8), rgba(10, 15, 26, 0.95));
}

.cyber-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.data-line {
    position: absolute;
    width: 1px;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--accent-cyan), transparent);
    animation: dataDrop 3s linear infinite;
    opacity: 0;
}

.data-line:nth-child(1) { left: 15%; animation-duration: 4s; }
.data-line:nth-child(2) { left: 35%; animation-duration: 3s; background: linear-gradient(to bottom, transparent, var(--accent-purple), transparent); }
.data-line:nth-child(3) { left: 55%; animation-duration: 4.5s; }
.data-line:nth-child(4) { left: 75%; animation-duration: 3.5s; }
.data-line:nth-child(5) { left: 90%; animation-duration: 5s; }

@keyframes dataDrop {
    0% { top: -150px; opacity: 0; }
    10%, 90% { opacity: 1; }
    100% { top: 100vh; opacity: 0; }
}

.site-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 1220px);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 999px;
    z-index: 1000;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
}

.logo-button {
    background: none;
    border: 0;
    cursor: pointer;
}

.brand-main + span,
.logo span:last-child {
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.img-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links button,
.nav-pill {
    background: transparent;
    border: 0;
    color: #a0aec0;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    padding: 8px 10px;
}

.nav-pill {
    color: #06121f;
    background: var(--accent-cyan);
    border-radius: 999px;
}

.nav-links button:hover,
.nav-links button.active {
    color: var(--accent-cyan);
}

.view-section {
    display: none;
    width: min(1200px, 90%);
    margin: 0 auto;
    padding: 128px 0 60px;
    animation: fadeIn 0.35s ease-in-out;
}

.view-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    min-height: 58vh;
    margin-bottom: 64px;
}

.hero-logo-side {
    width: 180px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.3));
}

.hero-content-wrapper {
    max-width: 680px;
}

.hero h1,
.page-title {
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.08;
    margin: 0 0 18px;
    background: linear-gradient(to right, #fff, #a0aec0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p,
.page-intro {
    color: #cbd5e1;
    font-size: 1.12rem;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 26px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;
    margin-bottom: 72px;
}

.card-light,
.card-dark,
.product-card,
.auth-card,
.data-section,
.metric-card,
.management-form {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card-light {
    background: var(--surface);
    color: var(--text-dark);
    padding: 34px;
}

.card-dark,
.data-section,
.auth-card,
.management-form {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 34px;
}

.card-light h2 { color: var(--accent-purple); margin-top: 0; }
.card-dark h1,
.card-dark h2,
.data-section h2 { color: var(--accent-cyan); margin-top: 0; }
.centered { text-align: center; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 84px;
}

.tech-item i { font-size: 2.8rem; }
.tech-item span { font-size: 0.8rem; font-weight: 700; }

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin: 0 0 28px;
}

.testimonials,
.team-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 70px;
}

.testimo-card {
    background: var(--panel);
    border-left: 4px solid var(--accent-purple);
    padding: 26px;
    border-radius: 8px;
}

.testimo-card.accent { border-color: var(--accent-cyan); }
.testimo-card h4 { color: var(--accent-cyan); margin-bottom: 0; }
.stars { color: var(--accent-amber); margin-bottom: 12px; }

.team-member {
    text-align: center;
    background: var(--surface);
    color: var(--text-dark);
    padding: 22px;
    border-radius: 8px;
}

.team-member.dark {
    background: var(--panel);
    color: white;
    border: 1px solid var(--border);
}

.team-member h3 { margin: 10px 0 4px; }
.team-member p { color: #64748b; margin: 0; }
.team-member.dark p { color: #94a3b8; }

.avatar {
    width: 78px;
    height: 78px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-purple));
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
}

.avatar.blue { background: #3b82f6; }
.avatar.green { background: #10b981; }
.avatar.amber { background: #f59e0b; }

.feature-list {
    line-height: 1.8;
    padding-left: 20px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 22px;
    min-height: 470px;
}

.product-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
    transition: 0.2s ease;
}

.product-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #111827;
}

.product-category,
.eyebrow {
    color: var(--accent-purple);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-card h2 { margin: 7px 0 10px; }
.product-card p { color: var(--text-muted); line-height: 1.5; flex: 1; }

.price {
    color: var(--accent-cyan);
    font-size: 1.7rem;
    font-weight: 800;
    margin: 8px 0 16px;
}

.price span {
    color: #64748b;
    font-size: 0.95rem;
}

.btn-group {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.btn-pay,
.btn-submit,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 0;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.btn-submit,
.btn-pay {
    color: white;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-purple));
}

.btn-submit.compact { width: auto; }

.btn-secondary {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.btn-secondary.small {
    min-height: 36px;
    padding: 8px 12px;
}

.btn-pay.cyan {
    background: var(--accent-cyan);
    color: #06121f;
}

.btn-pay:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.side-note {
    margin: 28px 0;
    padding-left: 18px;
    border-left: 4px solid var(--accent-purple);
}

.side-note p { margin: 0; color: #475569; }

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
}

select option { color: #0f172a; }

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

label {
    display: grid;
    gap: 8px;
    color: #cbd5e1;
    font-weight: 700;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-label input {
    width: 18px;
    height: 18px;
}

footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    text-align: center;
    padding: 28px 20px;
    border-top: 1px solid var(--border);
    background: rgba(10, 15, 26, 0.82);
    color: #94a3b8;
}

footer a { color: var(--accent-cyan); text-decoration: none; }

.portal-body { min-height: 100vh; }

.portal-shell {
    width: min(1180px, 92%);
    margin: 20px auto 0;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    backdrop-filter: blur(20px);
}

.portal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-actions a {
    color: #cbd5e1;
    font-weight: 700;
    text-decoration: none;
}

.portal-main {
    width: min(1180px, 92%);
    margin: 42px auto 70px;
}

.auth-card {
    width: min(520px, 100%);
    margin: 70px auto;
}

.auth-card h1 { margin-top: 0; }
.auth-card p,
.muted { color: #cbd5e1; line-height: 1.6; }

.dashboard-head,
.section-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.dashboard-head {
    margin-bottom: 28px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-head h1 {
    margin: 4px 0 6px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.client-overview-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.client-profile-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    background: var(--panel);
    border: 1px solid rgba(0, 229, 255, 0.24);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.client-profile-card h2 {
    margin: 4px 0 0;
    color: #ffffff;
    font-size: 1.3rem;
    overflow-wrap: anywhere;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.profile-details div {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.profile-details dt,
.payment-details dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-details dd,
.payment-details dd {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.account-summary {
    display: grid;
    gap: 0;
    margin-bottom: 26px;
    padding: 8px 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.summary-line {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto minmax(180px, 0.8fr);
    gap: 18px;
    align-items: center;
    min-height: 58px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-line:first-child {
    border-top: 0;
}

.summary-line span {
    color: #cbd5e1;
    font-weight: 800;
}

.summary-line strong {
    color: #ffffff;
    font-size: 1.55rem;
    text-align: right;
    white-space: nowrap;
}

.summary-line small {
    color: var(--text-muted);
    text-align: right;
}

.summary-line.warning strong { color: var(--accent-amber); }
.summary-line.success strong { color: var(--accent-green); }

.client-overview-grid .account-summary {
    margin-bottom: 0;
}

.client-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 0;
}

.client-tabs button {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.client-tabs button.active {
    background: var(--accent-cyan);
    color: #06121f;
}

.client-tab-panel {
    display: none;
}

.client-tab-panel.active {
    display: block;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.metric-card {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 22px;
}

.metric-card span {
    color: #cbd5e1;
    display: block;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    font-size: 2rem;
    margin: 8px 0;
}

.metric-card small { color: var(--text-muted); }
.metric-card.warning { border-color: rgba(245, 158, 11, 0.55); }
.metric-card.warning strong { color: var(--accent-amber); }
.metric-card.success { border-color: rgba(34, 197, 94, 0.55); }
.metric-card.success strong { color: var(--accent-green); }

.data-section {
    margin-top: 22px;
}

.client-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
    gap: 22px;
    align-items: start;
}

.client-workspace .data-section {
    margin-top: 0;
}

.client-invoice-stack {
    display: grid;
    gap: 22px;
}

.billing-profile-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.billing-profile-form .span-2,
.profile-form-actions {
    grid-column: 1 / -1;
}

.profile-form-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.invoice-list,
.record-list,
.mini-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.mini-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-account-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.product-account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.product-account-row > div:first-child,
.product-account-meta {
    display: grid;
    gap: 5px;
}

.product-account-row strong {
    color: #ffffff;
    font-size: 1.08rem;
}

.product-account-row small,
.product-account-meta span {
    color: var(--text-muted);
}

.product-account-meta {
    text-align: right;
}

.product-account-meta b {
    color: var(--accent-cyan);
    font-size: 1.15rem;
}

.invoice-row,
.record-row,
.mini-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.invoice-row {
    grid-template-columns: minmax(160px, 1.2fr) repeat(3, minmax(110px, 0.7fr));
    align-items: center;
}

.compact-list {
    gap: 10px;
}

.client-invoice-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.client-invoice-row:hover {
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.invoice-row-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.invoice-row-main strong {
    color: #ffffff;
    overflow-wrap: anywhere;
}

.invoice-row-main small,
.invoice-row-amount span {
    color: var(--text-muted);
}

.invoice-row-amount {
    display: grid;
    gap: 4px;
    text-align: right;
}

.invoice-row-amount strong {
    color: var(--accent-cyan);
    font-size: 1.18rem;
    white-space: nowrap;
}

.record-row {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
}

.record-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.link-button {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 800;
}

.link-button.danger {
    border-color: rgba(239, 68, 68, 0.6);
    color: #fecaca;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    color: white;
    background: rgba(148, 163, 184, 0.22);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge.pending { background: rgba(245, 158, 11, 0.22); color: #fde68a; }
.badge.paid { background: rgba(34, 197, 94, 0.22); color: #bbf7d0; }
.badge.overdue { background: rgba(239, 68, 68, 0.22); color: #fecaca; }
.badge.cancelled { background: rgba(148, 163, 184, 0.22); color: #e2e8f0; }

.empty {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: #cbd5e1;
}

.status-line {
    min-height: 22px;
    color: #cbd5e1;
    margin: 12px 0;
}

.status-line.error { color: #fecaca; }
.status-line.success { color: #bbf7d0; }

.admin-main {
    width: min(1320px, 94%);
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tabs button {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.admin-tabs button.active {
    background: var(--accent-cyan);
    color: #06121f;
}

.admin-panel {
    display: none;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-panel.active { display: grid; }

.management-form h2 { margin: 0; color: var(--accent-cyan); }

.invoice-builder {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.invoice-builder h3,
.invoice-picker-group h4 {
    margin: 0;
    color: var(--accent-cyan);
}

.invoice-picker {
    display: grid;
    gap: 14px;
}

.invoice-picker-group {
    display: grid;
    gap: 10px;
}

.invoice-add-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 88px auto;
    gap: 12px;
    align-items: end;
}

.invoice-add-row label {
    gap: 6px;
    font-size: 0.86rem;
}

.invoice-add-row .btn-secondary {
    min-height: 45px;
    white-space: nowrap;
}

.selected-items-list {
    display: grid;
    gap: 8px;
}

.selected-items-head,
.selected-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px 120px 88px;
    gap: 10px;
    align-items: center;
}

.selected-items-head {
    padding: 0 10px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.selected-item-row {
    padding: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.selected-item-row div {
    display: grid;
    gap: 3px;
}

.selected-item-row small {
    color: var(--text-muted);
}

.selected-item-row b {
    color: var(--accent-cyan);
    text-align: right;
    white-space: nowrap;
}

.selected-item-row .qty-input {
    padding: 9px 10px;
    text-align: center;
}

.compact-empty {
    padding: 12px;
}

.invoice-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 76px auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.invoice-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.invoice-option span {
    display: grid;
    gap: 3px;
}

.invoice-option small,
.invoice-line small {
    color: var(--text-muted);
    line-height: 1.35;
}

.invoice-option .qty-input {
    min-width: 0;
    padding: 9px 10px;
    text-align: center;
}

.invoice-option b {
    color: var(--accent-cyan);
    white-space: nowrap;
}

.invoice-paper {
    display: grid;
    gap: 18px;
    padding: 22px;
    color: #0f172a;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
}

.invoice-paper.compact {
    padding: 18px;
}

.invoice-paper .eyebrow {
    color: #6d28d9;
}

.invoice-paper h3 {
    margin: 4px 0 6px;
    font-size: 1.55rem;
    color: #0f172a;
}

.invoice-paper .muted {
    color: #64748b;
}

.invoice-paper-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.invoice-total-box {
    min-width: 160px;
    padding: 14px;
    border-radius: 8px;
    background: #0f172a;
    color: white;
    text-align: right;
}

.invoice-total-box span,
.invoice-total-box small {
    display: block;
    color: #cbd5e1;
    font-weight: 700;
}

.invoice-total-box strong {
    display: block;
    margin: 4px 0;
    font-size: 1.65rem;
    color: var(--accent-cyan);
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.invoice-meta-grid span {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: #eef4fb;
    color: #334155;
}

.invoice-meta-grid b {
    color: #0f172a;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.invoice-meta-grid em {
    width: fit-content;
    font-style: normal;
}

.invoice-lines {
    display: grid;
    gap: 8px;
}

.invoice-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px 110px 120px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: #f1f5f9;
}

.invoice-line span,
.invoice-line b {
    text-align: right;
}

.invoice-line b {
    color: #0f172a;
}

.invoice-note {
    margin: 0;
    padding: 12px;
    border-left: 4px solid #6d28d9;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
}

.client-invoice {
    background: #ffffff;
}

.invoice-notice {
    position: relative;
    gap: 0;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0 28px 28px;
    overflow: hidden;
    color: #0b1f3a;
    background: #ffffff;
    border: 1px solid #cfd9ea;
    border-radius: 0;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18);
}

.invoice-notice.compact {
    padding: 0 18px 20px;
}

.invoice-top-line {
    height: 8px;
    margin: 0 -28px;
    background: #2f59d9;
}

.invoice-notice.compact .invoice-top-line {
    margin: 0 -18px;
}

.invoice-brand {
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 42px 0 26px;
    text-align: center;
}

.invoice-notice.compact .invoice-brand {
    padding: 24px 0 18px;
}

.invoice-logo {
    width: 86px;
    height: auto;
    object-fit: contain;
}

.invoice-brand h2 {
    margin: 8px 0 0;
    color: #0f2e5f;
    font-size: 1.28rem;
    letter-spacing: 0.04em;
}

.invoice-brand p,
.invoice-letter p {
    margin: 0;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.6;
}

.invoice-notice-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 -28px;
    padding: 16px 28px;
    color: #ffffff;
    background: #2f59d9;
}

.invoice-notice.compact .invoice-notice-bar {
    margin: 0 -18px;
    padding: 13px 18px;
}

.invoice-notice-bar strong {
    font-size: 0.95rem;
}

.invoice-notice-bar span {
    font-size: 0.76rem;
    font-weight: 800;
}

.invoice-letter {
    display: grid;
    gap: 12px;
    padding: 26px 0 20px;
}

.invoice-info-card {
    border: 1px solid #bfcbe0;
}

.invoice-info-card h3 {
    margin: 0;
    padding: 12px 16px;
    color: #ffffff;
    background: #2f59d9;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.invoice-info-card dl {
    margin: 0;
}

.invoice-info-card div {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 46px;
    border-top: 1px solid #d8e1ee;
}

.invoice-info-card div:first-child {
    border-top: 0;
}

.invoice-info-card dt,
.invoice-info-card dd {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.78rem;
    line-height: 1.45;
}

.invoice-info-card dt {
    color: #334155;
    background: #edf3fb;
    font-weight: 700;
}

.invoice-info-card dd {
    color: #0b1f3a;
    font-weight: 700;
}

.invoice-meta-strip {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 20px;
    padding: 13px 16px;
    border-left: 4px solid #2f59d9;
    background: #eaf2fc;
    color: #0b1f3a;
    font-size: 0.8rem;
}

.invoice-services h3 {
    margin: 0 0 10px;
    color: #0b1f3a;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.invoice-service-table {
    border: 1px solid #c9d5e6;
}

.invoice-service-head,
.invoice-service-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 110px;
}

.invoice-service-head {
    color: #ffffff;
    background: #123d70;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.invoice-service-head span,
.invoice-service-row > span,
.invoice-service-row > strong {
    padding: 12px 14px;
    border-left: 1px solid #d7e0ed;
}

.invoice-service-head span:first-child,
.invoice-service-row > span:first-child {
    border-left: 0;
}

.invoice-service-row {
    min-height: 74px;
    border-top: 1px solid #d7e0ed;
    background: #ffffff;
    color: #0b1f3a;
    font-size: 0.78rem;
}

.invoice-service-row > span:first-child {
    display: grid;
    gap: 6px;
    line-height: 1.45;
}

.invoice-service-row small {
    display: block;
    color: #475569;
    line-height: 1.45;
}

.invoice-service-row > span:nth-child(2) {
    color: #1e3a8a;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-service-row > strong {
    text-align: right;
    color: #0b1f3a;
}

.invoice-total-summary {
    width: min(320px, 100%);
    margin: 22px 0 0 auto;
    display: grid;
    gap: 0;
}

.invoice-total-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    color: #0b1f3a;
    background: #ffffff;
    font-size: 0.78rem;
}

.invoice-total-summary > div + div {
    border-top: 1px solid #d7e0ed;
}

.invoice-total-summary b {
    color: #0b1f3a;
}

.invoice-total-summary .invoice-total-pay {
    align-items: center;
    color: #ffffff;
    background: #2f59d9;
    font-weight: 900;
}

.invoice-total-pay strong {
    color: #ffffff;
    font-size: 1.15rem;
}

.modal-open {
    overflow: hidden;
}

.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.invoice-modal[hidden] {
    display: none;
}

.invoice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
}

.invoice-modal-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(92vh, 980px);
    overflow: auto;
    padding: 18px;
    background: #eef3fb;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.invoice-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.invoice-modal-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

.profile-modal-panel {
    width: min(760px, 100%);
    background: var(--panel-solid);
    color: var(--text-light);
}

.profile-modal-panel .invoice-modal-head h2 {
    color: var(--accent-cyan);
}

.payment-method-card {
    display: grid;
    gap: 18px;
    margin-top: 16px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 8px;
}

.payment-method-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.payment-method-head h3 {
    margin: 5px 0 0;
    color: #ffffff;
    font-size: 1.45rem;
}

.payment-details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.payment-details div {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.payment-method-card p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .site-nav {
        position: static;
        transform: none;
        margin: 14px auto 0;
        border-radius: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links { justify-content: center; }
    .view-section { padding-top: 50px; }
    .hero { flex-direction: column; text-align: center; min-height: auto; }
    .hero-content-wrapper { text-align: center; }
    .hero-actions { justify-content: center; }
    .grid-2,
    .client-overview-grid,
    .profile-details,
    .summary-grid,
    .summary-line,
    .client-workspace,
    .admin-panel,
    .invoice-row,
    .client-invoice-row,
    .product-account-row,
    .invoice-option,
    .invoice-add-row,
    .billing-profile-form,
    .selected-items-head,
    .selected-item-row,
    .invoice-paper-head,
    .invoice-meta-grid,
    .invoice-line {
        grid-template-columns: 1fr;
    }

    .invoice-paper-head {
        display: grid;
    }

    .invoice-total-box,
    .invoice-line span,
    .invoice-line b,
    .selected-item-row b,
    .invoice-row-amount,
    .summary-line strong,
    .summary-line small,
    .product-account-meta {
        text-align: left;
    }

    .profile-form-actions {
        display: grid;
    }

    .dashboard-actions {
        justify-content: flex-start;
    }

    .invoice-notice {
        padding-left: 16px;
        padding-right: 16px;
    }

    .invoice-top-line,
    .invoice-notice-bar {
        margin-left: -16px;
        margin-right: -16px;
    }

    .invoice-notice-bar,
    .invoice-meta-strip {
        display: grid;
    }

    .invoice-info-card div,
    .invoice-service-head,
    .invoice-service-row {
        grid-template-columns: 1fr;
    }

    .invoice-service-row > span,
    .invoice-service-row > strong {
        border-left: 0;
        border-top: 1px solid #d7e0ed;
        text-align: left;
    }

    .portal-shell,
    .dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
    .card-light,
    .card-dark,
    .auth-card,
    .data-section,
    .management-form { padding: 22px; }
    .portal-logo { font-size: 0.9rem; }
    .img-logo { height: 36px; }
    .invoice-modal {
        padding: 10px;
    }
    .invoice-modal-panel {
        padding: 12px;
    }
}
