:root {
    --red: #d32f2f;
    --red-dark: #b91c1c;
    --gold: #f9a825;
    --dark: #202124;
    --muted: #667085;
    --line: #e6e8ec;
    --soft: #f7f7f8;
    --bg: #fffaf8;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(#fff, var(--bg));
    color: var(--dark);
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
    color: var(--red);
}

button,
.btn {
    border: 0;
    cursor: pointer;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    background: var(--red);
    color: #fff;
    border-radius: 14px;
    padding: 12px 18px;
}

.btn:hover {
    background: var(--red-dark);
}

.btn.small {
    padding: 8px 12px;
    font-size: 13px;
}

.btn.secondary {
    background: #fff;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn.secondary:hover {
    background: #fff8f7;
}

/* Header */

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5vw;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    flex-shrink: 0;
}

.brand img {
    height: 42px;
    width: auto;
    display: block;
}

.brand-text {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    color: var(--dark);
    white-space: nowrap;
}

.brand-text span,
.brand span {
    color: var(--red);
}

nav,
.top nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

/* Generic layout */

.container {
    width: min(1100px, 92vw);
    margin: 34px auto;
}

.card,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(16,24,40,.08);
    padding: 34px;
}

.container > .card:first-child {
    padding-top: 22px;
    padding-bottom: 18px;
}

h1 {
    text-align: center;
    font-size: 42px;
    margin: 10px;
}

.sub {
    text-align: center;
    color: var(--muted);
    font-size: 18px;
}

.meta {
    color: var(--muted);
    font-size: 14px;
}

.price {
    font-weight: 900;
    color: var(--red);
    font-size: 22px;
}

/* Homepage hero */

.peru-home {
    position: relative;
    min-height: 760px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.peru-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.60);
    backdrop-filter: blur(2px);
}

.peru-content {
    position: relative;
    z-index: 2;
    max-width: 1050px;
    width: 90%;
    padding-top: 40px;
}

.peru-content h1 {
    font-size: 54px;
    margin-bottom: 12px;
    color: #111827;
}

.peru-content p {
    font-size: 24px;
    color: #1f2937;
}

.peru-content p span {
    color: #d62828;
    font-weight: 800;
}

/* Homepage search only */

.peru-search {
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 880px;
    margin: 28px auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.peru-search input[name="q"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
}

.peru-search input::placeholder {
    color: #9ca3af;
}

.peru-search select[name="scope"] {
    width: 150px;
    min-width: 150px;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 10px;
    background: #fff;
    font-size: 15px;
}

.peru-search button {
    width: auto;
    min-width: 86px;
    height: 32px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

/* Homepage categories */

.peru-categories {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 40px auto 24px;
    max-width: 760px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.10);
}

.peru-categories a {
    color: #111827;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.peru-categories a:first-child {
    color: var(--red);
}

.peru-categories a:hover {
    transform: translateY(-3px);
    transition: .2s;
    color: var(--red);
}

.peru-trust {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-top: 26px;
    color: #111827;
    font-weight: 600;
}

/* How it works */

.how-it-works {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
}

.how-it-works h2 {
    font-size: 32px;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 900px;
    margin: auto;
    gap: 40px;
}

.step-icon {
    width: 64px;
    height: 64px;
    margin: auto;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.steps h3 {
    margin-top: 18px;
}

.steps p {
    color: #4b5563;
}

/* Category/search page form only */

.category-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto 12px;
    padding: 10px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.category-search-form .search-live-wrap {
    flex: 1;
    min-width: 0;
}

.category-search-form input[name="q"] {
    width: 100%;
    height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 16px;
}

.category-search-form select[name="scope"] {
    width: 150px;
    height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
}

.category-search-form .filter-check {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--muted);
    font-weight: 700;
}

.category-search-form .filter-check input {
    width: 14px;
    height: 14px;
    accent-color: var(--red);
}

.category-search-form button {
    width: 86px;
    height: 48px;
    min-width: 90px;
    border-radius: 999px;
    padding: 0;
    font-size: 14px;
    background: var(--red);
    color: #fff;
}

/* Search results */

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 14px;
    align-items: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 6px 20px rgba(16,24,40,.04);
    position: relative;
}

.search-thumb {
    width: 96px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f4f7;
    display: grid;
    place-items: center;
    color: #98a2b3;
    font-size: 13px;
}

.search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-info h3 {
    margin: 4px 0;
    font-size: 17px;
}

.search-info h3 a {
    color: #111827;
}

.search-info p {
    margin: 6px 0 0;
    color: var(--muted);
}

.search-actions form {
    margin: 0;
}

.search-actions button,
.search-actions .btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 12px;
    background: #fff;
    color: var(--red);
    border: 1px solid var(--red);
}

/* Live search */

.search-live-wrap {
    position: relative;
}

.live-results {
    display: none;
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(16,24,40,.14);
    overflow: hidden;
    z-index: 50;
}

.live-result-item {
    display: block;
    padding: 10px 12px;
    color: var(--dark);
    border-bottom: 1px solid var(--line);
}

.live-result-item:last-child {
    border-bottom: 0;
}

.live-result-item:hover {
    background: #fff3f1;
}

/* Listing detail */

.listing-gallery {
    margin: 20px 0;
}

.main-listing-photo {
    width: 100%;
    height: 520px;
    object-fit: contain;
    object-position: center;
    border-radius: 20px;
    display: block;
    background: #f7f7f8;
}

.listing-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
}

.listing-thumbs img {
    width: 110px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.seller-card {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(16,24,40,.06);
}

.seller-row {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.seller-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--red);
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
}

.listing-action-panel {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.listing-main-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 12px auto;
    height: 42px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
}

.listing-secondary-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.listing-secondary-actions form {
    margin: 0;
}

.safety-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

/* Auth pages */

.auth-form {
    max-width: 620px;
    margin: 24px auto 0;
}

.auth-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-form .field {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-form input,
.auth-form select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
    border-color: var(--red);
}

.auth-form button {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 15px;
    margin-top: 8px;
}

/* Create listing page */

.create-listing-card {
    max-width: 980px;
    margin: 36px auto;
    padding: 42px;
}

.create-listing-form {
    max-width: 760px;
    margin: 28px auto 0;
}

.create-listing-form .form-section {
    margin-bottom: 30px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.create-listing-form .form-section:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.create-listing-form .section-title {
    font-size: 20px;
    font-weight: 900;
    margin: 0 0 18px;
    color: #111827;
}

.create-listing-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.create-listing-form .field {
    margin-bottom: 16px;
}

.create-listing-form label {
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 7px;
    color: #344054;
}

.create-listing-form input[type="text"],
.create-listing-form input[type="number"],
.create-listing-form input:not([type]),
.create-listing-form select,
.create-listing-form textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fff;
    color: var(--dark);
    outline: none;
}

.create-listing-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.45;
}

.create-listing-form input:focus,
.create-listing-form select:focus,
.create-listing-form textarea:focus,
.edit-listing-form input:focus,
.edit-listing-form select:focus,
.edit-listing-form textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(211,47,47,.10);
    outline: none;
}

.create-listing-form input[type="file"] {
    width: 100%;
    border: 1px dashed #d0d5dd;
    border-radius: 14px;
    padding: 14px;
    background: #fcfcfd;
}

.create-listing-form .help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.create-listing-form .checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    font-weight: 700;
    color: #344054;
}

.create-listing-form .checkbox-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.plan-card {
    position: relative;
    display: block;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16,24,40,.08);
}

.plan-card input {
    position: absolute;
    top: 16px;
    right: 16px;
    accent-color: var(--red);
}

.plan-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
    color: #111827;
}

.plan-card p {
    min-height: 42px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.plan-price {
    font-weight: 900;
    color: var(--red);
    font-size: 18px;
}

.plan-card:has(input:checked) {
    border-color: var(--red);
    background: #fff8f7;
    box-shadow: 0 0 0 4px rgba(211,47,47,.08);
}

.create-listing-submit {
    width: 100%;
    height: 52px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.create-listing-submit:hover {
    background: var(--red-dark);
}

/* Edit listing page */

.edit-listing-form {
    max-width: 720px;
    margin: 28px auto 0;
}

.edit-listing-form .field {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.edit-listing-form label {
    font-weight: 800;
    color: #202124;
}

.edit-listing-form input,
.edit-listing-form select,
.edit-listing-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
}

.edit-listing-form textarea {
    min-height: 90px;
    resize: vertical;
}

.edit-listing-form input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--red);
}

.edit-listing-actions {
    display: flex;
    gap: 14px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
/* Footer */

footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

/* Responsive */

@media (min-width: 768px) {
    .brand img {
        height: 56px;
    }

    .brand-text {
        font-size: 30px;
    }
}

@media (min-width: 1200px) {
    .brand img {
        height: 60px;
    }

    .brand-text {
        font-size: 32px;
    }
}
@media (max-width: 700px) {
    .top {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .brand {
        justify-content: center;
        gap: 8px;
    }

    .brand img {
        height: 34px;
    }

    .brand-text {
        font-size: 22px;
    }

    .top nav,
    nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
    }

    .top nav a,
    nav a {
        font-size: 13px;
    }

    .top nav .btn.small,
    nav .btn.small {
        display: none;
    }

    .top nav a[href="/login.php"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 7px 16px;
        border: 1px solid var(--red);
        border-radius: 999px;
        font-size: 13px;
        font-weight: 800;
        color: var(--red);
        background: #fff;
    }

    .container {
        width: 92vw;
        margin: 18px auto;
    }

    .card,
    .panel {
        padding: 22px;
        border-radius: 22px;
    }

    h1 {
        font-size: 34px;
        line-height: 1.15;
    }

    .peru-home {
        min-height: auto;
        padding: 40px 0 36px;
    }

    .peru-content {
        width: 92vw;
        max-width: 92vw;
        padding: 0;
    }

    .peru-content h1 {
        font-size: 36px;
        line-height: 1.12;
        margin-bottom: 16px;
    }

    .peru-content p {
        font-size: 18px;
        line-height: 1.35;
    }

    .peru-search {
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 12px;
        gap: 12px;
        border-radius: 18px;
    }

    .peru-search input[name="q"],
    .peru-search select[name="scope"] {
        display: block;
        width: 100%;
        min-width: 0;
        height: 52px;
        min-height: 52px;
        border-radius: 14px;
        padding: 0 16px;
        font-size: 16px;
        line-height: 52px;
    }

    .peru-search button {
        width: 60%;
        max-width: 240px;
        min-width: 160px;
        height: 46px;
        margin: 2px auto 0;
        border-radius: 999px;
        font-size: 16px;
        padding: 0;
    }

    .peru-categories {
        width: 100%;
        max-width: 100%;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 14px;
        margin: 28px auto 18px;
        overflow: hidden;
    }

    .peru-categories a {
        min-width: 0;
        font-size: 13px;
        text-align: center;
    }

    .peru-trust {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        font-size: 13px;
        text-align: center;
    }

    .how-it-works {
        padding: 42px 18px;
        overflow: hidden;
    }

    .how-it-works h2 {
        font-size: 30px;
        line-height: 1.15;
        margin-bottom: 30px;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 34px;
        max-width: 100%;
        width: 100%;
    }

    .steps > div {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        text-align: center;
    }

    .step-icon {
        width: 72px;
        height: 72px;
        margin: 0 auto 12px;
        font-size: 30px;
    }

    .steps h3 {
        font-size: 22px;
        line-height: 1.2;
        margin: 8px 0;
    }

    .steps p {
        font-size: 16px;
        line-height: 1.35;
    }

    .category-search-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        padding: 12px;
        gap: 10px;
        margin: 14px auto 12px;
    }

    .category-search-form .search-live-wrap,
    .category-search-form input[name="q"],
    .category-search-form select[name="scope"],
    .category-search-form .filter-check,
    .category-search-form button {
        width: 100%;
        min-width: 0;
    }

    .category-search-form input[name="q"],
    .category-search-form select[name="scope"] {
        height: 44px;
    }

    .category-search-form .filter-check {
        height: 40px;
        justify-content: center;
    }

    .category-search-form button {
        height: 44px;
        border-radius: 12px;
        font-size: 15px;
    }

    .search-results {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .search-result {
        display: block;
        padding: 0;
        overflow: hidden;
        border-radius: 16px;
    }

    .search-thumb {
        width: 100%;
        height: 155px;
        border-radius: 0;
    }

    .search-info {
        padding: 10px;
    }

    .search-info .meta,
    .search-info p {
        display: none;
    }

    .search-info h3 {
        font-size: 15px;
        line-height: 1.2;
        margin: 0 0 5px;
        font-weight: 700;
    }

    .search-info .price {
        font-size: 17px;
        line-height: 1.2;
    }

    .search-actions {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .search-actions button,
    .search-actions .btn {
        width: 34px;
        height: 34px;
        min-height: 34px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid var(--line);
        font-size: 15px;
    }

    .main-listing-photo {
        height: 320px;
    }

    .listing-secondary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .auth-form {
        max-width: 100%;
    }

    .auth-form .row,
    .create-listing-form .row,
    .plan-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .create-listing-card {
        margin: 18px auto;
        padding: 24px;
    }

    .plan-card p {
        min-height: auto;
    }

    .edit-listing-form {
        max-width: 100%;
    }

    .edit-listing-form .field {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .edit-listing-actions {
        flex-direction: column;
    }

    .dashboard-page .dashboard-header-card {
        max-width: 100%;
        margin: 16px auto 22px;
        padding: 14px 18px;
    }

    .dashboard-page .dashboard-header-card h1 {
        font-size: 28px;
        margin-bottom: 0;
    }

    .dashboard-page .dashboard-header-card .btn {
        display: none;
    }

    .dashboard-page .dashboard-section-title h2 {
        font-size: 26px;
    }

    .dashboard-page .dashboard-section-title .btn.small {
        font-size: 12px;
        padding: 8px 11px;
        border-radius: 14px;
    }

    .dashboard-page .dashboard-row {
        grid-template-columns: 64px 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 14px;
    }

    .dashboard-page .dashboard-thumb {
        width: 64px;
        height: 56px;
    }

    .dashboard-page .dashboard-info h3 {
        font-size: 16px;
    }

    .dashboard-page .dashboard-info .meta,
    .dashboard-page .dashboard-info p,
    .dashboard-page .dashboard-status,
    .dashboard-page .dashboard-stats {
        font-size: 12px;
    }

    .dashboard-page .dashboard-info p {
        margin-top: 5px;
    }

    .dashboard-page .status-pill {
        font-size: 11px;
        padding: 3px 8px;
    }

    .dashboard-page .dashboard-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
        gap: 8px;
        margin-top: 7px;
    }

    .dashboard-page .dashboard-actions a,
    .dashboard-page .dashboard-actions button {
        font-size: 12px;
    }
}
/* Dashboard V2 - FinViz style */
.dashboard-v2 .dashboard-top-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    max-width: 100%;
    margin-bottom: 18px;
}

.dashboard-v2 .dashboard-top-card h1 {
    text-align: left;
    margin: 0 0 6px;
    font-size: 34px;
}

.dashboard-v2 .dashboard-top-card .sub {
    text-align: left;
    margin: 0;
    font-size: 16px;
}

.account-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.account-tabs a {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--dark);
    font-weight: 800;
    font-size: 13px;
}

.account-tabs a.active,
.account-tabs a:hover {
    border-color: var(--red);
    color: var(--red);
    background: #fff8f7;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 28px rgba(16,24,40,.05);
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 6px;
}

.summary-card strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: var(--dark);
}

.summary-card.urgent strong {
    color: var(--red);
}

.dashboard-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 12px;
}

.dashboard-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-filters a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--dark);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-filters a span {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.dashboard-filters a.active {
    border-color: var(--red);
    background: #fff8f7;
    color: var(--red);
}
.dashboard-table-card {
    overflow-x: auto;
    overflow-y: visible;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 38px rgba(16,24,40,.06);
}
.dashboard-table-head,
.dashboard-v2 .dashboard-row {
    display: grid;
    grid-template-columns: 70px minmax(230px, 1fr) 105px 80px 115px 60px 70px 170px;
    gap: 8px;
    align-items: center;
}
.dashboard-table-head {
    padding: 11px 14px;
    background: #fcfcfd;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.dashboard-v2 .dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-v2 .dashboard-row {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.dashboard-v2 .dashboard-row:last-child {
    border-bottom: 0;
}

.dashboard-v2 .dashboard-row:hover {
    background: #fffaf8;
}

.dashboard-v2 .dashboard-thumb {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f4f7;
    display: grid;
    place-items: center;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-v2 .dashboard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-v2 .dashboard-info h3 {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.25;
}

.dashboard-v2 .dashboard-info h3 a {
    color: #111827;
}

.dashboard-v2 .dashboard-info h3 a:hover {
    color: var(--red);
}

.dashboard-price-line {
    color: var(--red);
    font-weight: 900;
    font-size: 13px;
}

.dashboard-v2 .dashboard-info p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.status-pill,
.sales-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-pill.active {
    background: #ecfdf3;
    color: #027a48;
}

.status-pill.pending {
    background: #fffaeb;
    color: #b54708;
}

.status-pill.expired,
.status-pill.inactive {
    background: #f2f4f7;
    color: #667085;
}

.sales-pill {
    margin-top: 5px;
    background: #eff4ff;
    color: #3538cd;
}

.dashboard-plan-cell,
.dashboard-expiry-cell,
.dashboard-number-cell {
    font-size: 13px;
    color: var(--dark);
}

.dashboard-expiry-cell.expired {
    color: var(--red);
    font-weight: 900;
}

.dashboard-number-cell {
    font-weight: 900;
}

.dashboard-v2 .dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 10px;
}

.dashboard-v2 .dashboard-actions a,
.dashboard-v2 .dashboard-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.dashboard-v2 .dashboard-actions form {
    margin: 0;
}

.empty-dashboard-card {
    text-align: center;
}

.empty-dashboard-card h2 {
    margin-top: 0;
}
/* Mobile adjustments */
@media (max-width: 700px) {

  .dashboard-v2 .dashboard-top-card {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
    gap: 12px;
  }

  .dashboard-v2 .dashboard-top-card h1 {
    font-size: 28px;
    line-height: 1;
  }

  .dashboard-v2 .dashboard-top-card .sub {
    font-size: 12px;
    line-height: 1.3;
  }

  .dashboard-v2 .dashboard-top-card .btn {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 10px;
  }

}
/* Mobile: account-tabs fit in one line */
@media (max-width: 700px) {

  .account-tabs {
    display: flex;
    flex-wrap: nowrap;      /* force single line */
    gap: 6px;               /* tighter spacing */
    margin: 0 0 12px;
  }

  .account-tabs a {
    flex: 1;                /* equal width buttons */
    padding: 6px 4px;       /* reduce height */
    font-size: 11px;        /* smaller text */
    text-align: center;
    white-space: nowrap;    /* prevent wrapping */
    border-radius: 999px;
  }

}
/* Mobile: summary cards fit small phone screens */
@media (max-width: 700px) {

  .dashboard-summary-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
  }

  .summary-card {
    padding: 10px 4px;
    min-width: 0;
    text-align: center;
    border-radius: 12px;
  }

  .summary-card span {
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 6px;
  }

  .summary-card strong {
    font-size: 22px;
    line-height: 1;
    text-align: center;
  }

}
/* Mobile: hide dashboard filters */
@media (max-width: 700px) {

  .dashboard-filters {
    display: none;
  }

}
/* Mobile: dashboard listing table/cards */
@media (max-width: 700px) {

  .dashboard-table-card {
    overflow-x: hidden;
    border-radius: 14px;
  }

  .dashboard-table-head {
    display: none;
  }

  .dashboard-v2 .dashboard-row {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 8px;
    align-items: start;
    padding: 10px 8px;
  }

  .dashboard-v2 .dashboard-thumb {
    width: 52px;
    height: 52px;
  }

  .dashboard-v2 .dashboard-info h3 {
    font-size: 12px;
    line-height: 1.15;
    margin: 0 0 3px;
  }

  .dashboard-v2 .dashboard-price-line {
    font-size: 11px;
    line-height: 1.15;
    margin: 0 0 3px;
    white-space: normal;
  }

  .dashboard-v2 .dashboard-info p {
    font-size: 10px;
    line-height: 1.2;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-v2 .dashboard-status-cell,
  .dashboard-v2 .dashboard-plan-cell,
  .dashboard-v2 .dashboard-expiry-cell,
  .dashboard-v2 .dashboard-seen-cell,
  .dashboard-v2 .dashboard-count-cell {
    display: none;
  }

  .dashboard-v2 .dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-end;
    min-width: 58px;
  }

  .dashboard-v2 .dashboard-actions a {
    font-size: 10px;
    line-height: 1.1;
    padding: 0;
    white-space: nowrap;
  }

}
/* Mobile: compact horizontal actions that fit 346px */
@media (max-width: 700px) {

  .dashboard-v2 .dashboard-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;              /* force single line */
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    gap: 4px;
    max-width: 100%;
  }

  .dashboard-v2 .dashboard-actions a,
  .dashboard-v2 .dashboard-actions button {
    font-size: 9px;                 /* tighter text */
    line-height: 1;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 1;                 /* allow shrinking */
  }

  /* separator */
  .dashboard-v2 .dashboard-actions a:not(:last-child)::after {
    content: "|";
    margin-left: 4px;
    color: #ccc;
  }

}
/* Mobile: hide number cell */
@media (max-width: 700px) {

  .dashboard-number-cell {
    display: none;
  }

}
/* TodoPe Messages Center */
.messages-mobile-back {
    display: none;
}

.messages-page {
    width: min(1280px, 96vw);
    margin: 24px auto;
}

.messages-app {
    display: grid;
    grid-template-columns: 230px 300px minmax(400px, 720px);
    justify-content: center;
    height: calc(100vh - 155px);
    min-height: 620px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(16,24,40,.08);
}

.messages-profile-panel,
.messages-folder-panel {
    border-right: 1px solid var(--line);
    background: #fcfcfd;
    overflow-y: auto;
}

.messages-profile-panel {
    padding: 18px;
}

.messages-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.messages-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--red);
    display: grid;
    place-items: center;
    font-weight: 900;
}

.messages-profile p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.messages-compose {
    display: flex;
    justify-content: center;
    padding: 11px 12px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-weight: 900;
    margin-bottom: 18px;
}

.messages-main-nav a,
.messages-folders a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--dark);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 6px;
}

.messages-main-nav a.active,
.messages-main-nav a:hover,
.messages-folders a.active,
.messages-folders a:hover {
    background: #fff8f7;
    color: var(--red);
}

.messages-folder-panel h2 {
    margin: 18px 16px 12px;
}

.messages-folders {
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--line);
}

.messages-thread-list {
    display: flex;
    flex-direction: column;
}

.messages-thread {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--dark);
}

.messages-thread.active,
.messages-thread:hover {
    background: #fff8f7;
}

.messages-thread-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.messages-thread-listing {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.messages-thread p {
    margin: 8px 0 0;
    color: #344054;
    font-size: 13px;
    line-height: 1.35;
}

.messages-preview-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}

.messages-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.messages-preview-header h1 {
    text-align: left;
    margin: 4px 0 0;
    font-size: 28px;
}

.messages-preview-actions {
    display: flex;
    gap: 8px;
}

.messages-preview-actions form {
    margin: 0;
}

.messages-preview-actions button {
    padding: 8px 11px;
    border-radius: 999px;
    background: #fff;
    color: var(--red);
    border: 1px solid var(--red);
    font-weight: 900;
}

.messages-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    background: linear-gradient(#fff, #fffaf8);
}

.message-bubble {
    width: fit-content;
    max-width: 72%;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f2f4f7;
    margin-bottom: 12px;
}

.message-bubble strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.message-bubble p {
    margin: 0;
    line-height: 1.4;
}

.message-bubble span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}

.messages-reply-box {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.messages-reply-box textarea {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    font-size: 14px;
}

.messages-reply-box button {
    width: 96px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
}

.messages-empty,
.messages-empty-small {
    color: var(--muted);
    padding: 24px;
}

@media (max-width: 900px) {
    .messages-app {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .messages-profile-panel,
    .messages-folder-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .messages-preview-panel {
        min-height: 520px;
    }
}
.messages-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    background: linear-gradient(#fff, #fffaf8);
    display: flex;
    flex-direction: column;
}

.message-bubble {
    max-width: 68%;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f2f4f7;
    margin-bottom: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.message-bubble.mine {
    align-self: flex-end;
    background: #fee2e2;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 6px;
}

.message-bubble strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.message-bubble p {
    margin: 0;
    line-height: 1.4;
}

.message-bubble span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}
.messages-folders {
    display: flex;
    flex-direction: column;   /* 🔥 this is the key */
    gap: 6px;
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--line);
}
.messages-folders a {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    text-align: left;
}
.messages-section-title {
    margin: 18px 0 12px;
    font-size: 13px;
    font-weight: 900;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.messages-folder-title {
    font-size: 13px;
    font-weight: 900;
    color: #111;
    margin: 12px 12px 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.messages-app {
    display: grid;
    grid-template-columns: 320px 1fr;
}
@media (max-width: 700px) {
    .messages-page {
        width: 100%;
        margin: 0;
    }

    .messages-app {
        display: block;
        height: calc(100vh - 95px);
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .messages-folder-panel {
        width: 100%;
        height: 100%;
        border-right: 0;
        overflow-y: auto;
        background: #fff;
    }

    .messages-folder-panel h2 {
        font-size: 30px;
        padding: 18px 18px 8px;
        margin: 0;
    }

    .messages-preview-panel {
        display: none;
    }

     .messages-page.mobile-list-open .messages-folder-panel {
    display: block;
}

.messages-page.mobile-list-open .messages-preview-panel {
    display: none;
}

.messages-page.mobile-chat-open .messages-folder-panel {
    display: none;
}

.messages-page.mobile-chat-open .messages-preview-panel {
    display: flex;
    height: 100%;
    min-height: 0;
}

    .messages-preview-header {
        position: sticky;
        top: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: 36px 1fr auto;
        gap: 8px;
        align-items: center;
        padding: 10px 12px;
        background: #fff;
    }

    .messages-mobile-back {
        display: flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        color: var(--dark);
        font-size: 26px;
        font-weight: 900;
    }

    .messages-preview-header h1 {
        font-size: 20px;
        margin: 0;
        text-align: left;
    }

    .messages-preview-header .meta {
        font-size: 11px;
        margin: 0 0 2px;
    }

    .messages-preview-actions {
        gap: 4px;
    }

    .messages-preview-actions button {
        font-size: 11px;
        padding: 6px 8px;
    }

    .messages-preview-body {
        flex: 1;
        min-height: 0;
        padding: 14px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .message-bubble {
        max-width: 82%;
        font-size: 15px;
    }

    .message-bubble.mine {
        align-self: flex-end;
    }

    .messages-reply-box {
        position: sticky;
        bottom: 0;
        padding: 10px;
        background: #fff;
    }

    .messages-reply-box textarea {
        min-height: 44px;
        max-height: 90px;
        border-radius: 22px;
    }

    .messages-reply-box button {
        width: 58px;
        height: 48px;
        border-radius: 50%;
        font-size: 0;
    }

    .messages-reply-box button::before {
        content: "➤";
        font-size: 20px;
    }
}
.messages-thread.active {
    background: #f5f5f5;
    border-left: 3px solid var(--red);
}
.messages-thread {
    display: block;
    width: 100%;
}