:root {
    --bg: #f6f6ef;
    --surface: #ffffff;
    --text: #1b1b1b;
    --muted: #6a6a66;
    --line: #ddd7cb;
    --primary: #005f73;
    --accent: #ee9b00;
    --danger: #bb3e03;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, #fefae0 0%, transparent 40%),
        radial-gradient(circle at 80% 0%, #e9f5db 0%, transparent 35%),
        var(--bg);
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.auth-shell,
.app-shell {
    min-height: 100vh;
    padding: 1rem;
}

.landing-shell {
    min-height: 100vh;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .6rem 0 1rem;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.brand-lockup span,
.eyebrow,
.panel-card span,
.pricing-strip span {
    color: var(--muted);
    display: block;
    font-size: .85rem;
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #0a9396);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.landing-actions,
.hero-cta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.cta-link,
.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .8rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.cta-link {
    background: var(--primary);
    color: white;
}

.ghost-link {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text);
    border: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 1rem;
    align-items: stretch;
    padding: 2rem 0 1rem;
}

.hero-copy,
.hero-panel,
.feature-grid article,
.pricing-strip article {
    background: rgba(255, 255, 255, 0.84);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 2rem;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.hero-copy p {
    max-width: 60ch;
    font-size: 1.05rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-top: 1.5rem;
}

.trust-row,
.hero-strip,
.proof-grid {
    display: grid;
    gap: .75rem;
}

.trust-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
}

.trust-row span,
.hero-strip article,
.proof-grid article {
    display: block;
    padding: .85rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
}

.hero-strip {
    grid-template-columns: repeat(3, 1fr);
    margin: 1rem 0;
}

.hero-strip strong {
    display: block;
    font-size: 1.35rem;
}

.proof-grid {
    grid-template-columns: repeat(3, 1fr);
    margin: 1rem 0 0;
}

.hero-stats article,
.panel-card,
.feature-grid article,
.pricing-strip article {
    padding: 1rem;
}

.hero-stats strong,
.panel-card strong,
.pricing-strip strong {
    display: block;
    font-size: 1.15rem;
    margin: .2rem 0;
}

.hero-panel {
    display: grid;
    gap: .75rem;
    padding: 1rem;
}

.dashboard-preview {
    overflow: hidden;
}

.preview-topline {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: .5rem;
    margin-bottom: .75rem;
}

.preview-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .6rem;
    align-items: end;
    min-height: 140px;
    margin-bottom: .7rem;
}

.preview-bars div {
    background: linear-gradient(180deg, rgba(0, 95, 115, .12), rgba(0, 95, 115, .35));
    border-radius: 16px 16px 10px 10px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.preview-bars i {
    display: block;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--primary), #0a9396);
    border-radius: 14px 14px 10px 10px;
}

.panel-accent {
    background: linear-gradient(180deg, rgba(0, 95, 115, .12), rgba(238, 155, 0, .12));
}

.feature-grid,
.pricing-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
    margin: 1rem 0 0;
}

.pricing-strip {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 2rem;
}

.feature-grid article h2 {
    margin-bottom: .4rem;
}

.feature-grid p,
.panel-card p,
.pricing-strip p {
    margin: 0;
}

.pricing-strip article {
    background: rgba(255, 255, 255, 0.92);
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.auth-modal-card {
    position: relative;
    width: min(100%, 560px);
    max-height: 92vh;
    overflow: auto;
    padding: 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 1;
}

.close-modal {
    position: absolute;
    top: .55rem;
    right: .55rem;
    width: auto;
    min-width: 2.2rem;
    padding: .45rem .65rem;
    line-height: 1;
    background: #d62828;
    color: #fff;
}

@media (max-width: 900px) {
    .hero-grid,
    .feature-grid,
    .pricing-strip,
    .hero-strip,
    .proof-grid,
    .trust-row {
        grid-template-columns: 1fr;
    }

    .landing-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-actions {
        justify-content: stretch;
    }

    .landing-actions a,
    .hero-cta a {
        flex: 1 1 0;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }
}

.auth-card,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.auth-card {
    max-width: 460px;
    margin: 8vh auto;
    padding: 1.25rem;
}

h1, h2 { margin: 0 0 .75rem; }
p { color: var(--muted); }

.tab-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin: 1rem 0;
}

button,
input,
select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: .72rem .8rem;
    font-size: .95rem;
}

button {
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

button.secondary { background: #0a9396; margin-top: .5rem; }
button.active { background: var(--accent); color: #1f1f1f; }

form { display: grid; gap: .55rem; }

.topbar {
    background: #001219;
    color: #fff;
    border-radius: 16px;
    padding: .9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar button {
    width: auto;
    padding: .5rem .9rem;
    background: #ee9b00;
    color: #111;
}

.grid-wrap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: .9rem;
    margin-top: .9rem;
}

.card {
    padding: .9rem;
    grid-column: span 12;
}

.stats .stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .7rem;
}

.stat-grid article {
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: .7rem;
}

pre {
    font-size: .75rem;
    background: #f1efe8;
    border-radius: 8px;
    padding: .65rem;
    overflow: auto;
}

.list-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
}

.list-card li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: .45rem;
}

.statusbar {
    margin-top: .8rem;
    color: var(--muted);
    font-size: .85rem;
}

@media (min-width: 900px) {
    .stats { grid-column: span 12; }
    .card:nth-child(2), .card:nth-child(3), .card:nth-child(4) { grid-column: span 4; }
    .card:nth-child(5), .card:nth-child(6) { grid-column: span 6; }
    .card:nth-child(7), .card:nth-child(8) { grid-column: span 6; }
}

/* Modern dashboard layout */
.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    padding: 1rem;
}

.sidebar {
    background: #05202c;
    color: #fff;
    border-radius: 20px;
    padding: 1rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.sidebar-brand small {
    color: #aac1c9;
    display: block;
}

.sidebar-nav {
    display: grid;
    gap: .45rem;
    align-content: start;
}

.sidebar-nav button {
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-active {
    background: #0ea5b7;
    border-color: #0ea5b7;
}

.sidebar-footer {
    font-size: .85rem;
    color: #d9edf1;
    display: grid;
    gap: .55rem;
}

.sidebar-footer button {
    background: #ee9b00;
    color: #1b1b1b;
}

.workspace {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1rem;
}

.workspace-top {
    margin-bottom: .75rem;
}

.workspace-top h1 {
    margin-bottom: .2rem;
}

.workspace-top small {
    color: var(--muted);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.dash-card {
    background: #fff;
    border: 1px solid #dfe5d6;
    border-radius: 16px;
    padding: .9rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.dash-card span {
    color: #6d6d6d;
    font-size: .86rem;
}

.dash-card strong {
    display: block;
    font-size: 1.28rem;
}

.muted-note {
    color: var(--muted);
    margin: 0 0 .7rem;
}

.widget-board {
    position: relative;
    height: 760px;
    border: 1px dashed #ced8c1;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7f9f4 0%, #edf2e8 100%);
    overflow: hidden;
}

.widget-card {
    position: absolute;
    background: #fff;
    border: 1px solid #dbe3d2;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.widget-head {
    padding: .5rem .7rem;
    background: #0f2f3d;
    color: #fff;
    cursor: move;
    -webkit-user-select: none;
    user-select: none;
}

.widget-body {
    height: calc(100% - 38px);
    padding: .65rem;
}

.widget-time {
    font-size: 1.5rem;
    font-weight: 800;
    margin: .4rem 0;
}

.widget-date {
    margin: 0;
    color: #56606a;
}

.widget-body canvas {
    width: 100% !important;
    height: 100% !important;
}

.widget-empty {
    position: absolute;
    inset: 38px 0 0 0;
    display: grid;
    place-items: center;
    color: #5f6a73;
    font-size: .85rem;
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
    padding: .6rem;
}

.resize-grip {
    position: absolute;
    width: 14px;
    height: 14px;
    right: 5px;
    bottom: 5px;
    border-radius: 3px;
    background: #0ea5b7;
    cursor: nwse-resize;
}

.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }

.form-card form {
    display: grid;
    gap: .5rem;
}

.admin-control-card h4 {
    margin: .45rem 0 .2rem;
}

.admin-color-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr;
    gap: .45rem;
    align-items: center;
}

.admin-color-row label {
    font-size: .85rem;
    color: var(--muted);
}

.admin-color-row input[type="color"] {
    width: 100%;
    min-height: 38px;
    padding: .15rem;
}

.checkout-result {
    margin-top: .65rem;
    padding: .65rem;
    border-radius: 10px;
    border: 1px solid #d8ddd5;
    background: #f7faf7;
}

.checkout-result a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.checkout-result p {
    margin: .45rem 0 0;
    font-size: .85rem;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}

.plan-card {
    border: 1px solid #dbe2cb;
    border-radius: 14px;
    padding: .75rem;
    background: #fcfcf8;
}

.plan-card h3 {
    margin: 0 0 .4rem;
}

.table-wrap {
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
    padding: .55rem;
}

.admin-main {
    display: grid;
    gap: 1rem;
}

.admin-header {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), #0a9396);
    border-radius: 18px;
    color: white;
}

.admin-header h2 {
    margin: 0 0 .25rem;
    font-size: 1.65rem;
}

.admin-status {
    margin: 0;
    opacity: 0.95;
    font-size: .95rem;
}

.admin-tabs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .65rem;
    background: #f7faf7;
    border-radius: 14px;
    border-bottom: 1px solid #e2e2e2;
}

.admin-tab,
.admin-tab-active {
    padding: .65rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.7);
    color: var(--text);
}

.admin-tab:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-2px);
}

.admin-tab-active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0,95,115,0.25);
}

.admin-content {
    display: grid;
    gap: 1rem;
}

fieldset {
    border: none;
    padding: 0 0 .75rem;
    margin: 0 0 .75rem 0;
    border-bottom: 1px solid #e2e2e2;
}

fieldset:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

legend {
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: .45rem;
    display: block;
}

.payment-gateway-card {
    padding: 1rem;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    background: #fafaf8;
    margin-bottom: 1rem;
}

.payment-gateway-card h4 {
    margin: 0 0 .75rem;
    color: var(--primary);
}

.payment-gateway-card form {
    display: grid;
    gap: .65rem;
}

.subscription-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e2e2;
}

.subscription-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pricing-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: .65rem;
    align-items: end;
    margin-bottom: .75rem;
    padding: .75rem;
    background: rgba(238,155,0,0.08);
    border-radius: 10px;
    border: 1px solid rgba(238,155,0,0.2);
}

.pricing-form h5 {
    grid-column: 1 / -1;
    margin: 0 0 .45rem;
    font-size: .95rem;
}

.pricing-form input {
    padding: .55rem;
    font-size: .85rem;
}

.pricing-form button {
    padding: .55rem .85rem;
    font-size: .85rem;
}

.checkout-form {
    display: grid;
    gap: .65rem;
}

.checkout-result {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--primary);
    border-radius: 12px;
    background: rgba(0,95,115,0.06);
}

.checkout-result h4 {
    margin: 0 0 .85rem;
    color: var(--primary);
    font-size: 1.05rem;
}

.result-details {
    display: grid;
    gap: .45rem;
    margin-bottom: .85rem;
}

.result-details p {
    margin: 0;
    font-size: .9rem;
    word-break: break-all;
}

.result-details code {
    background: rgba(0,0,0,0.06);
    padding: .2rem .4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: .85rem;
}

.url-input {
    padding: .65rem;
    font-size: .85rem;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: white;
    font-family: monospace;
    width: 100%;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: .65rem 1rem;
    margin-right: .5rem;
    margin-top: .5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,95,115,0.3);
}

.btn-secondary {
    background: #f0f0ed;
    color: var(--text);
    border: 1px solid #e2e2e2;
}

.btn-secondary:hover {
    background: #e5e5e2;
}

.hint {
    font-size: .85rem;
    color: var(--muted);
    margin: .45rem 0 0;
}

.color-group {
    display: grid;
    gap: .3rem;
}

.color-input-wrap {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.color-input-wrap input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    cursor: pointer;
}

.color-input-wrap span {
    font-size: .85rem;
    font-family: monospace;
    color: var(--muted);
    min-width: 70px;
}

.badge {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active {
    background: rgba(10,147,150,0.15);
    color: #0a9396;
}

.badge-inactive {
    background: rgba(187,62,3,0.15);
    color: #bb3e03;
}

@media (max-width: 1100px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-template-rows: auto;
    }

    .panel-grid,
    .plan-grid {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-4 {
        grid-column: span 1;
    }

    .widget-board {
        height: auto;
        display: grid;
        gap: .7rem;
        padding: .65rem;
        overflow: visible;
    }

    .widget-card {
        position: relative;
        width: 100% !important;
        height: 300px !important;
        left: auto !important;
        top: auto !important;
    }

    .resize-grip {
        display: none;
    }

    .admin-color-row {
        grid-template-columns: 1fr;
    }
}
