@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Vazirmatn:wght@400;500;700;800&display=swap");

:root {
    --bg-1: #f4fffb;
    --bg-2: #eef7ff;
    --surface: #ffffff;
    --surface-2: rgba(255, 255, 255, 0.82);
    --text: #0f172a;
    --muted: #475569;
    --line: #dbeafe;
    --primary: #0f766e;
    --primary-2: #0ea5e9;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-soft: 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-hard: 0 26px 60px rgba(2, 132, 199, 0.16);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 16% -8%, #ccfbf1 0%, transparent 34%),
        radial-gradient(circle at 92% 10%, #dbeafe 0%, transparent 38%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    font-family: "Manrope", "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

[dir="rtl"] body {
    font-family: "Vazirmatn", "Manrope", "Segoe UI", sans-serif;
}

.container {
    width: min(1220px, 94%);
    margin-inline: auto;
}

.honeypot-field {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    margin: 14px auto 0;
    width: min(1240px, 96%);
    border-radius: 24px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(239, 246, 255, 0.84));
    border: 1px solid rgba(186, 230, 253, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
}

.brand {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #0c4a6e;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.main-nav a,
.link-btn {
    text-decoration: none;
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    border: 1px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.main-nav a:hover,
.link-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(224, 242, 254, 0.7);
}

.user-badge {
    border-radius: 999px;
    border: 1px solid rgba(6, 182, 212, 0.35);
    background: linear-gradient(120deg, rgba(236, 254, 255, 0.95), rgba(224, 242, 254, 0.9));
    color: #0e7490;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.3rem 0.45rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(14, 165, 233, 0.28);
}

.lang-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 700;
}

.lang-switch select {
    width: auto;
    min-width: 130px;
    border-radius: 999px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    background: #ffffff;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

main.container {
    margin-top: 1.2rem;
    padding-bottom: 2rem;
}

.card {
    background: linear-gradient(145deg, var(--surface), var(--surface-2));
    border: 1px solid rgba(186, 230, 253, 0.85);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.1rem;
    margin-bottom: 1rem;
    animation: card-in 0.4s ease;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2,
h3 {
    margin-top: 0;
    margin-bottom: 0.7rem;
    line-height: 1.3;
}

.grid-2,
.grid-3 {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #1f2937;
}

input,
select,
textarea,
button {
    width: 100%;
    font: inherit;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.62rem 0.74rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.62);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button,
.btn {
    width: auto;
    border-radius: 12px;
    border: 1px solid transparent;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(130deg, var(--primary), var(--primary-2));
    box-shadow: 0 12px 24px rgba(14, 116, 144, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.08);
    box-shadow: var(--shadow-hard);
}

.btn-danger {
    background: linear-gradient(130deg, #dc2626, #f97316);
}

.btn-muted {
    background: linear-gradient(130deg, #334155, #64748b);
}

.btn-secondary {
    background: linear-gradient(130deg, #0284c7, #0ea5e9);
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select,
.inline-form button {
    width: auto;
}

.table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    overflow: auto;
    background: rgba(255, 255, 255, 0.76);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 0.72rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: start;
    vertical-align: top;
    font-size: 0.89rem;
}

th {
    background: rgba(236, 253, 245, 0.8);
    color: #0f172a;
    font-weight: 800;
}

tr:last-child td {
    border-bottom: 0;
}

.flash {
    border-radius: 14px;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash-success {
    background: rgba(220, 252, 231, 0.75);
    color: #14532d;
    border-color: rgba(34, 197, 94, 0.35);
}

.flash-error {
    background: rgba(254, 226, 226, 0.85);
    color: #7f1d1d;
    border-color: rgba(239, 68, 68, 0.35);
}

.muted {
    color: var(--muted);
    font-size: 0.87rem;
}

.price-box {
    margin-top: 0.65rem;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(236, 254, 255, 0.9), rgba(224, 242, 254, 0.9));
    padding: 0.78rem;
    font-size: 1.03rem;
    font-weight: 800;
}

.kpi {
    border-radius: 16px;
    border: 1px solid rgba(125, 211, 252, 0.55);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(239, 246, 255, 0.86));
    padding: 0.85rem;
}

.kpi strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 0.2rem;
    color: #0c4a6e;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(239, 246, 255, 0.95);
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
}

.message-thread {
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
    max-height: 420px;
    overflow: auto;
    padding: 0.5rem;
}

.message-item {
    padding: 0.62rem 0.64rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.86);
    margin-bottom: 0.45rem;
}

.message-item p {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
}

hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    margin: 1rem 0;
}

@media (max-width: 1100px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .lang-switch {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 640px;
    }

    .topbar {
        width: 98%;
        margin-top: 8px;
    }
}

@media (max-width: 600px) {
    .main-nav {
        gap: 0.3rem;
    }

    .main-nav a,
    .link-btn {
        font-size: 0.8rem;
        padding: 0.34rem 0.6rem;
    }

    .card {
        padding: 0.88rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 96%;
    }

    .topbar-inner {
        gap: 0.65rem;
    }

    .brand {
        font-size: 1rem;
    }

    .main-nav {
        width: 100%;
    }

    .lang-switch {
        width: 100%;
    }

    .lang-switch select {
        min-width: 0;
        width: 100%;
    }

    .inline-form {
        width: 100%;
    }

    .inline-form input,
    .inline-form select,
    .inline-form button {
        width: 100%;
    }
}
