:root {
    --ink: #18211f;
    --muted: #61716b;
    --line: #dbe3df;
    --soft: #f5f8f6;
    --panel: #ffffff;
    --accent: #13735d;
    --accent-2: #b8892f;
    --danger: #b42318;
    --shadow: 0 12px 30px rgba(24, 33, 31, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--soft);
    letter-spacing: 0;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--accent);
}

.site-header nav {
    display: flex;
    gap: 16px;
    color: var(--muted);
}

.site-header nav a {
    text-decoration: none;
}

.page-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.site-footer {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.narrow {
    max-width: 620px;
}

.hero-panel {
    border-top: 4px solid var(--accent);
}

.section-title {
    margin-bottom: 18px;
}

.section-title h1,
.section-title h2 {
    margin: 0 0 6px;
}

.section-title p,
.form-note,
.live-total,
small {
    margin: 0;
    color: var(--muted);
}

.row-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

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

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

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

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
select,
textarea,
button,
.button-link {
    min-height: 42px;
    border-radius: 7px;
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    padding: 10px 12px;
    color: var(--ink);
}

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

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.error {
    min-height: 18px;
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 400;
}

.single-field {
    max-width: 360px;
}

.readonly-label {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-weight: 400;
    background: var(--soft);
}

.selected-hotel {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0;
    padding: 14px;
    border-left: 4px solid var(--accent-2);
    background: #fff9ed;
    color: var(--ink);
}

.selected-hotel span {
    color: var(--muted);
}

.ziarat-area {
    display: grid;
    gap: 12px;
}

.ziarat-area h3 {
    margin: 0;
}

.submit-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-grid,
.category-grid,
.formula-grid,
.hotel-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.admin-tile,
.category-card,
.formula-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.admin-tile {
    text-decoration: none;
    font-weight: 700;
}

.category-card {
    display: grid;
    gap: 10px;
}

.filter-bar,
.inline-form,
.form-actions,
.action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-bar {
    margin-bottom: 16px;
}

.inline-form input,
.filter-bar select {
    width: auto;
    min-width: 160px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: var(--soft);
}

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

.actions button,
.table-wrap button {
    min-height: 34px;
    padding: 7px 10px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-button {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.tab-button.active {
    background: var(--accent);
    color: #fff;
}

.tab-panel {
    display: none;
}

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

.hidden {
    display: none;
}

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

.check-label input {
    width: auto;
}

.result-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.result-hero h1 {
    margin: 0 0 6px;
}

.grand-total {
    min-width: 220px;
    padding: 16px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
}

.grand-total span,
.grand-total small {
    display: block;
    color: rgba(255, 255, 255, 0.82);
}

.grand-total strong {
    display: block;
    margin: 4px 0;
    font-size: 1.8rem;
}

.sub-row td:first-child {
    padding-left: 28px;
    color: var(--muted);
}

.total-row {
    font-weight: 700;
    background: #f8fbfa;
}

.hotel-result-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.hotel-result-card img,
.image-fallback {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e3f0ea, #fff2d9);
    color: var(--muted);
}

.hotel-card-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.hotel-card-body h3,
.hotel-card-body p {
    margin: 0;
}

.badge {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e4f4ef;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.loader-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f3f7f4;
}

.loader-wrap {
    text-align: center;
    padding: 32px;
}

.crescent-loader {
    width: 82px;
    height: 82px;
    margin: 0 auto 20px;
    border: 8px solid var(--accent);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.crescent-loader span {
    display: block;
}

#countdown {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    .grid-form.two,
    .grid-form.three {
        grid-template-columns: 1fr;
    }

    .site-header,
    .result-hero,
    .submit-panel,
    .row-title {
        align-items: stretch;
        flex-direction: column;
    }

    .site-header nav {
        flex-wrap: wrap;
    }

    .grand-total {
        width: 100%;
    }
}

@media print {
    .site-header,
    .site-footer,
    .action-row,
    .swap-hotel {
        display: none;
    }

    body {
        background: #fff;
    }

    .panel {
        box-shadow: none;
        break-inside: avoid;
    }
}

