:root {
    --green: #25D366;
    --green-dark: #1DA851;
    --text: #1F2937;
    --muted: #6B7280;
    --bg: #F9FAFB;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --accent: #F59E0B;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
    --shadow-lg: 0 8px 24px rgba(17, 24, 39, 0.10);
    --app-width: 480px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== App shell ===== */
.app {
    max-width: var(--app-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(17, 24, 39, 0.05);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 22px;
    color: var(--text);
}

.brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: var(--shadow);
}

.topbar nav {
    display: flex;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.topbar nav a {
    padding: 6px 10px;
    border-radius: 10px;
}

.topbar nav a:hover {
    background: var(--bg);
}

.content {
    flex: 1;
    padding: 18px;
}

.content.has-sticky {
    padding-bottom: 96px;
}

/* ===== Typography ===== */
h1 {
    font-size: 26px;
    line-height: 1.35;
    margin: 0 0 10px;
    font-weight: 800;
}

h2 {
    font-size: 20px;
    margin: 0 0 12px;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.center {
    text-align: center;
}

/* ===== Buttons ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
}

.btn:active {
    transform: scale(0.985);
}

.btn-primary {
    background: var(--green);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

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

.btn-wa {
    background: var(--green);
    color: #fff;
}

.btn-outline {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.btn + .btn {
    margin-top: 12px;
}

.btn-sm {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    margin-top: 0;
}

/* ===== Cards ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.card h3 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 800;
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(160deg, #eafff2 0%, var(--bg) 70%);
    border-radius: var(--radius);
    padding: 26px 20px;
    margin-bottom: 18px;
    text-align: center;
}

.hero .emoji {
    font-size: 46px;
    margin-bottom: 6px;
}

.hero p {
    color: var(--muted);
    font-size: 16px;
    margin: 0 0 18px;
}

/* ===== Steps card list (how it works) ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 12px;
    font-size: 18px;
    font-weight: 800;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.step-item .num {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eafff2;
    color: var(--green-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}

/* ===== Forms ===== */
.field {
    margin-bottom: 16px;
}

.field > label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 17px;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
    width: 100%;
    padding: 14px 14px;
    font-family: inherit;
    font-size: 17px;
    color: var(--text);
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green);
}

.field textarea {
    resize: vertical;
    min-height: 90px;
}

.field .hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

.error {
    color: #DC2626;
    font-size: 14px;
    margin-top: 6px;
    font-weight: 600;
}

.alert {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-weight: 600;
}

/* ===== Choice chips (yes/no & options) ===== */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    flex: 1 1 auto;
    min-width: 90px;
    text-align: center;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    user-select: none;
    transition: all 0.12s ease;
}

.chip.selected {
    border-color: var(--green);
    background: #eafff2;
    color: var(--green-dark);
}

/* ===== Multi-step ===== */
.progress {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}

.progress .bar {
    flex: 1;
    height: 6px;
    border-radius: 6px;
    background: var(--border);
    transition: background 0.2s ease;
}

.progress .bar.active {
    background: var(--green);
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fade 0.2s ease;
}

@keyframes fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.step-heading {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 4px;
}

.step-sub {
    color: var(--muted);
    margin: 0 0 18px;
    font-size: 15px;
}

/* ===== Sticky bottom CTA ===== */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    max-width: var(--app-width);
    margin: 0 auto;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.sticky-cta .btn {
    margin-top: 0;
}

/* ===== Listing cards ===== */
.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.tag.green {
    background: #eafff2;
    border-color: #bff0d3;
    color: var(--green-dark);
}

.tag.amber {
    background: #FEF3C7;
    border-color: #FDE68A;
    color: #92400E;
}

.tag.muted {
    color: var(--muted);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-loc {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pay {
    font-weight: 800;
    color: var(--green-dark);
    font-size: 16px;
    margin: 6px 0;
}

/* ===== Filters ===== */
.filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

.filters .row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters .row > * {
    flex: 1 1 45%;
    min-width: 0;
}

.filters select,
.filters input[type="text"],
.filters input[type="tel"],
.filters input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease;
}

.filters select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 34px;
}

.filters input::placeholder {
    color: var(--muted);
}

.filters select:focus,
.filters input:focus {
    border-color: var(--green);
}

/* Filter action row */
.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.filter-actions .btn {
    margin-top: 0;
    width: auto;
}

.filter-actions .btn-search {
    flex: 1;
    padding: 12px 18px;
    font-size: 16px;
}

.filter-actions .btn-clear {
    flex: 0 0 auto;
    padding: 12px 20px;
    font-size: 15px;
}

/* ===== Empty state ===== */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty .emoji {
    font-size: 44px;
    margin-bottom: 10px;
}

/* ===== Success screen ===== */
.success {
    text-align: center;
    padding: 30px 10px;
}

.success .check {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #eafff2;
    color: var(--green);
    display: grid;
    place-items: center;
    font-size: 44px;
    margin: 0 auto 18px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 24px 18px;
}

/* ===== Admin (functional, denser) ===== */
.admin-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.admin-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-nav a {
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
}

.admin-nav a.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
}

.stat .n {
    font-size: 30px;
    font-weight: 800;
    color: var(--green-dark);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: 14px;
}

table.data th,
table.data td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

table.data th {
    background: var(--bg);
    font-weight: 800;
}

table.data tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.active {
    background: #eafff2;
    color: var(--green-dark);
}

.badge.inactive {
    background: #FEE2E2;
    color: #991B1B;
}

.inline-form {
    display: inline;
}

.link-btn {
    background: none;
    border: none;
    color: var(--green-dark);
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.link-btn.danger {
    color: #DC2626;
}

@media (min-width: 520px) {
    .app {
        margin-top: 20px;
        margin-bottom: 20px;
        min-height: calc(100vh - 40px);
        border-radius: 24px;
        overflow: hidden;
    }
}

/* ===== App-style header (Prompt 2) ===== */
.topbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
}

.topbar .brand {
    justify-self: center;
}

.back-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.back-btn:active {
    background: var(--bg);
}

.header-spacer {
    width: 44px;
    height: 44px;
}

/* ===== Progress counter ===== */
.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-count {
    font-size: 14px;
    font-weight: 800;
    color: var(--green-dark);
    background: #eafff2;
    border: 1px solid #bff0d3;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ===== WhatsApp icon button ===== */
.btn .wa-ico {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.btn .wa-ico path {
    fill: currentColor;
}

/* ===== Value cards (why use) ===== */
.value-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.value-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 14px;
    box-shadow: var(--shadow);
}

.value-card .ico {
    font-size: 26px;
    margin-bottom: 6px;
    display: block;
}

.value-card .t {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 2px;
}

.value-card .s {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ===== Label:value rows on cards ===== */
.kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
}

.kv .k {
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 auto;
}

.kv .v {
    font-weight: 700;
    text-align: left;
}

.kv .v.yes {
    color: var(--green-dark);
}

.kv .v.no {
    color: var(--muted);
    font-weight: 600;
}

.kv .v.pay {
    color: var(--green-dark);
}

/* ===== How-it-works tabs ===== */
.tabs {
    display: flex;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px;
    margin-bottom: 14px;
}

.tabs button {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 800;
    font-size: 15px;
    color: var(--muted);
    padding: 10px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.tabs button.active {
    background: var(--green);
    color: #fff;
}

.tab-panel {
    display: none;
}

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

/* ===== Bottom sheet (apply confirm) ===== */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: var(--app-width);
    margin: 0 auto;
    background: var(--card);
    border-radius: 22px 22px 0 0;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.25s ease;
    z-index: 51;
    box-shadow: 0 -8px 30px rgba(17, 24, 39, 0.18);
}

.sheet.open {
    transform: translateY(0);
}

.sheet .grip {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--border);
    margin: 0 auto 16px;
}

.sheet h3 {
    text-align: center;
    font-size: 20px;
    margin: 0 0 6px;
}

.sheet p {
    text-align: center;
    color: var(--muted);
    margin: 0 0 18px;
    font-size: 15px;
}

/* V1: Assist, matching, urgency */
.assist-section {
    margin-bottom: 20px;
    padding: 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
}

.assist-title {
    font-weight: 800;
    font-size: 15px;
    color: var(--green-dark);
    margin-bottom: 12px;
}

.assist-card {
    margin-bottom: 10px;
}

.assist-card:last-child {
    margin-bottom: 0;
}

.match-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.match-reason {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f5e9;
    color: var(--green-dark);
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag.urgency-urgent {
    background: #FEF3C7;
    color: #92400E;
}

.tag.urgency-today {
    background: #FEE2E2;
    color: #991B1B;
}

.tag.muted {
    background: var(--bg);
    color: var(--muted);
    font-weight: 600;
}

.footer-links {
    margin-top: 8px;
    font-size: 13px;
}

.footer-links a {
    color: var(--green-dark);
    font-weight: 700;
}

/* ---------- SEO / content blocks (Prompt 7) ---------- */
.breadcrumbs {
    font-size: 13px;
    color: var(--muted);
    margin: 4px 0 12px;
    line-height: 1.9;
}

.breadcrumbs a {
    color: var(--green-dark);
    font-weight: 600;
}

.breadcrumbs .sep {
    margin: 0 6px;
    color: var(--border);
}

.seo-intro {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.seo-intro h2 {
    font-size: 18px;
    margin: 0 0 8px;
}

.seo-intro p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

.seo-cta {
    margin: 16px 0;
    display: grid;
    gap: 12px;
}

.seo-cta-block {
    background: linear-gradient(160deg, #eafff2 0%, var(--bg) 80%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.seo-cta-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.faq-section {
    margin: 20px 0;
}

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.faq-item summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    color: var(--green-dark);
    font-size: 20px;
    font-weight: 700;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-answer {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
    margin-top: 10px;
}

.related-links {
    margin: 20px 0;
}

.chip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-link {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow);
}

.chip-link:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

.job-meta-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.job-expired-banner {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-weight: 600;
    margin-bottom: 14px;
}
