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

/* ═══════════════════════════════════════════════════════
   صفا المشاعر — هوية رسمية بتراث إسلامي
   ═══════════════════════════════════════════════════════ */

:root {
    --green:        #15110d;
    --green-mid:    #31261a;
    --green-light:  #dbc487;
    --green-surface:#f7f0df;
    --green-hover:  #090705;

    --gold:         #c09020;
    --gold-mid:     #d3a33c;
    --gold-light:   #f1ddb0;
    --gold-surface: #fff8ea;
    --gold-glow:    rgba(192,144,32,0.22);
    --gold-dark:    #8a6721;

    --bg:           #f3ede0;
    --surface:      #fffdf8;
    --surface-alt:  #f8f1e4;
    --border:       #d7c39b;
    --border-soft:  #ebdfc8;
    --ivory:        #fbf7ee;

    --text:         #1b130c;
    --muted:        #705c43;
    --text-light:   #9a886b;

    /* ── الحالات ── */
    --success:      #1B6B45;
    --warning:      #A86010;
    --danger:       #A83030;

    /* ── الظلال ── */
    --shadow:       0 8px 32px rgba(27,77,62,0.10);
    --shadow-gold:  0 8px 28px rgba(192,144,32,0.20);
    --shadow-card:  0 2px 12px rgba(27,77,62,0.07);
}

/* ══ قاعدة ══════════════════════════════════════════════ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Cairo', 'Tahoma', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgba(255,251,244,0.92), rgba(243,237,224,0.96)),
        url("../branding/ornaments.png");
    background-size: auto, 560px;
    background-attachment: fixed, fixed;
    background-blend-mode: normal, soft-light;
}

.brand-app-body {
    position: relative;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--gold); }
button, input, select, textarea { font: inherit; }

/* ══ حقول الإدخال ════════════════════════════════════════ */
input, select, textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Cairo', sans-serif;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.12);
}
textarea { resize: vertical; }
label { display: block; margin-bottom: 1rem; }
label > span {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

/* ══ هيكل الصفحات ════════════════════════════════════════ */
.page-shell, .public-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2.5rem;
}
.public-shell.narrow { max-width: 680px; }

.public-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(22,17,13,0.06), rgba(251,247,238,0.96)),
        url("../branding/ornaments.png"),
        var(--ivory);
    background-size: auto, 460px, auto;
    background-blend-mode: normal, soft-light, normal;
}

/* ══ الشريط العلوي (Header) ══════════════════════════════ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    height: 68px;
    background:
        linear-gradient(180deg, rgba(21,17,13,0.97), rgba(29,22,15,0.96)),
        var(--green);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 4px 20px rgba(27,77,62,0.25);
    /* شريط ذهبي سفلي */
    border-bottom: 2px solid var(--gold);
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../branding/ornaments.png") center/260px repeat;
    opacity: 0.09;
    pointer-events: none;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
}

.topbar-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.topbar-brand-text { line-height: 1.25; }
.app-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}
.app-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

.topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}
.user-chip {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(240,216,144,0.18);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
}

.season-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    background: rgba(192,144,32,0.16);
    border: 1px solid rgba(240,216,144,0.35);
    color: var(--gold-light);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ══ التنقل ══════════════════════════════════════════════ */
.nav-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 1.5rem;
    background: rgba(255,253,248,0.94);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 8px 24px rgba(25,18,12,0.05);
}
.nav-tabs form {
    margin-right: auto;
    display: inline-flex;
}
.nav-tabs a {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: var(--muted);
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-tabs a:hover {
    color: var(--green);
    background: var(--gold-surface);
    border-bottom-color: var(--gold);
}
.nav-tabs a:last-child {
    margin-right: auto;
    color: #A83030;
}
.nav-tabs a:last-child:hover { background: #FFF0F0; border-bottom-color: #F4BABA; }
.link-button {
    white-space: nowrap;
    background: transparent;
    border: 0;
    color: var(--green-mid);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

/* ══ البطاقات الأساسية ══════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: 22px;
    padding: 1.25rem;
    box-shadow: 0 12px 34px rgba(25,18,12,0.08);
}

/* بطاقة البطل (Hero) */
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 2rem 1.75rem;
    margin: 1.25rem 0;
    background:
        linear-gradient(135deg, rgba(21,17,13,0.96), rgba(49,38,26,0.92)),
        var(--green);
    border-radius: 28px;
    box-shadow: 0 20px 54px rgba(25,18,12,0.22);
    color: #fff;
    border: 0;
}
.hero-card::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
/* نقش زاوية */
.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../branding/ornaments.png") center/280px repeat;
    opacity: 0.1;
    pointer-events: none;
}
.hero-brandmark {
    display: inline-flex;
    width: 86px;
    height: 86px;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border-radius: 22px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(240,216,144,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.hero-brandmark img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.hero-card .badge { background: rgba(192,144,32,0.25); border-color: rgba(192,144,32,0.45); color: var(--gold-light); }
.hero-card h1 { margin: 0.6rem 0 0.5rem; font-size: 1.85rem; font-weight: 800; color: #fff; }
.hero-card p { margin: 0; color: rgba(255,255,255,0.78); line-height: 1.8; }

/* بطاقة النموذج */
.form-card {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: 0 12px 36px rgba(25,18,12,0.08);
}

/* ══ الشبكات ════════════════════════════════════════════ */
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 1.25rem;
}

/* ══ بطاقات الإحصاء ══════════════════════════════════════ */
.stat-card {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: var(--shadow-card);
    border-right: 4px solid rgba(192,144,32,0.24);
}
.stat-card:first-child { border-right-color: var(--gold); }
.stat-card span { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; }
.stat-card strong { font-size: 1.55rem; font-weight: 700; color: var(--green); }
.metric-row span, .detail-grid span { display: block; color: var(--muted); margin-bottom: 0.3rem; font-size: 0.85rem; font-weight: 600; }

/* ══ الشريحة المقسّمة ════════════════════════════════════ */
.segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    background: transparent;
    border: 0;
    padding: 0;
}
.segment {
    background: linear-gradient(180deg, rgba(255,253,248,0.96), rgba(248,241,228,0.92));
    border: 1.5px solid var(--border-soft);
    border-radius: 18px;
    padding: 1rem 0.9rem;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    transition: all 0.18s;
    box-shadow: 0 10px 22px rgba(25,18,12,0.05);
}
.segment input { display: none; }
.segment:hover {
    border-color: rgba(192,144,32,0.45);
    transform: translateY(-1px);
}
.segment.active {
    background: linear-gradient(180deg, #1d1610, #2a1f15);
    border-color: #1d1610;
    color: #fff;
    box-shadow: 0 8px 24px rgba(25,18,12,0.18);
}

/* ══ بطاقات الاختيار ════════════════════════════════════ */
.selection-group { margin-bottom: 1.25rem; }
.selection-title {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--green);
    font-size: 0.88rem;
    font-weight: 700;
}

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.room-choice-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.room-choice-card { min-height: 46px; border-radius: 10px; }

.admin-room-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.admin-room-card input { display: none; }
.admin-room-card.active {
    background: var(--green-surface);
    border-color: var(--green-mid);
    color: var(--green);
    font-weight: 700;
}

.choice-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--ivory);
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}
.choice-card input { display: none; }
.choice-card:hover:not(.active) { border-color: var(--green-mid); background: var(--green-surface); }
.choice-card.active {
    background: linear-gradient(180deg, #1d1610, #2a1f15);
    border-color: #1d1610;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(25,18,12,0.16);
}

.hidden { display: none; }

/* ══ الأزرار ════════════════════════════════════════════ */
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.1rem; }
.actions.compact { margin-top: 0.5rem; }

.primary-btn, .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.18s;
}
.primary-btn {
    background: linear-gradient(180deg, #15110d, #2b2117);
    color: #fff;
    border: 0;
    box-shadow: 0 10px 24px rgba(25,18,12,0.18);
}
.primary-btn:hover {
    background: linear-gradient(180deg, #0d0a08, #1a140f);
    box-shadow: 0 12px 28px rgba(25,18,12,0.26);
    transform: translateY(-1px);
}
.secondary-btn {
    background: rgba(255,248,234,0.72);
    border: 1.5px solid var(--border);
    color: var(--gold-dark);
}
.secondary-btn:hover { border-color: var(--gold); background: var(--gold-surface); }
.full { width: 100%; }
.disabled-action { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

/* ══ تخطيط الصفحات ══════════════════════════════════════ */
.two-col, .detail-layout { display: grid; gap: 1.1rem; grid-template-columns: 1.6fr 1fr; }
.stack { display: grid; gap: 1.1rem; }

/* ══ قوائم التذاكر ════════════════════════════════════════ */
.ticket-list { display: grid; gap: 0.8rem; }
.ticket-card {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-right: 4px solid rgba(192,144,32,0.3);
    transition: all 0.15s;
    box-shadow: var(--shadow-card);
}
.ticket-card:hover {
    border-right-color: var(--gold);
    box-shadow: 0 10px 28px rgba(25,18,12,0.12);
    transform: translateX(-2px);
}
.ticket-top, .section-head, .leader-item, .metric-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}
.section-head { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-soft); }
.ticket-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; color: var(--text-light); font-size: 0.85rem; }
.metric-row { padding: 0.6rem 0; border-bottom: 1px solid var(--border-soft); }
.metric-row:last-child { border-bottom: 0; }

/* ══ الشارات والعلامات ══════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 6px;
    padding: 0.28rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--green-surface);
    border: 1px solid var(--green-light);
    color: var(--green);
}
.badge.soft { background: var(--ivory); color: var(--muted); border-color: var(--border-soft); }
.badge.success { background: #E0F2EB; color: var(--success); border-color: #A8D8C0; }

.status-new { background: #FFF4DC; color: #8A5E00; border: 1px solid #E8CC80; border-radius: 6px; padding: 0.25rem 0.65rem; font-size: 0.8rem; font-weight: 700; display: inline-flex; }
.status-in_progress { background: var(--green-surface); color: var(--green); border: 1px solid var(--green-light); border-radius: 6px; padding: 0.25rem 0.65rem; font-size: 0.8rem; font-weight: 700; display: inline-flex; }
.status-resolved { background: #E0F2EB; color: var(--success); border: 1px solid #A8D8C0; border-radius: 6px; padding: 0.25rem 0.65rem; font-size: 0.8rem; font-weight: 700; display: inline-flex; }

/* ══ الفلاتر ════════════════════════════════════════════ */
.filters-shell { margin-bottom: 1.1rem; }
.filters-trigger-row { display: flex; justify-content: flex-start; margin-bottom: 0.75rem; }
.search-trigger-btn {
    width: 46px; height: 46px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s;
}
.search-trigger-btn:hover { border-color: var(--green-mid); background: var(--green-surface); }
.search-trigger-icon { position: relative; width: 16px; height: 16px; display: inline-block; }
.search-trigger-icon::before, .search-trigger-icon::after { content: ""; position: absolute; }
.search-trigger-icon::before { width: 10px; height: 10px; border: 2px solid var(--green); border-radius: 50%; top: 0; right: 2px; }
.search-trigger-icon::after { width: 7px; height: 2px; background: var(--green); bottom: 1px; left: 0; transform: rotate(-40deg); border-radius: 999px; }
.filters { margin-bottom: 0; }
.quick-search-row { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; margin-bottom: 0.75rem; }
.filters-inline-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.compact-btn, .search-submit-btn { min-height: 40px; padding: 0.65rem 0.9rem; }
.filter-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ══ لوحة الكانبان ══════════════════════════════════════ */
.kanban-header { margin-bottom: 1rem; }
.live-update-banner {
    display: none; align-items: center; gap: 0.6rem; margin-bottom: 1rem;
    padding: 0.8rem 1rem; border-radius: 10px;
    background: #E0F2EB; border: 1px solid #A8D8C0; color: var(--success);
    font-size: 0.88rem; font-weight: 600;
}
.live-update-banner.show { display: flex; }
.live-update-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(27,107,69,0.15); }
.kanban-board { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.kanban-column {
    background: rgba(255,253,248,0.94);
    border: 1.5px solid var(--border-soft);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(25,18,12,0.08);
    min-height: 300px;
}
.kanban-column-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.75rem; margin-bottom: 1rem;
    padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-soft);
}
.kanban-title-wrap { display: flex; align-items: center; gap: 0.55rem; }
.kanban-title-wrap h3 { margin: 0; font-size: 0.92rem; color: var(--text); font-weight: 700; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.kanban-dot.status-new { background: #C4820A; }
.kanban-dot.status-in_progress { background: var(--green-mid); }
.kanban-dot.status-resolved { background: var(--success); }
.kanban-cards { display: grid; gap: 0.8rem; }
.kanban-card {
    display: block;
    background: linear-gradient(180deg, rgba(255,253,248,0.98), rgba(249,242,229,0.94));
    border: 1.5px solid var(--border-soft);
    border-right: 4px solid rgba(192,144,32,0.2);
    border-radius: 18px;
    padding: 0.95rem;
    box-shadow: 0 10px 26px rgba(25,18,12,0.07);
    transition: all 0.15s;
}
.kanban-card:hover { box-shadow: 0 12px 30px rgba(25,18,12,0.12); transform: translateY(-2px); border-right-color: var(--gold); }
.kanban-card-top, .kanban-card-title { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; }
.kanban-card-title { margin: 0.75rem 0; align-items: flex-start; }
.kanban-card-title strong { font-size: 0.95rem; line-height: 1.6; color: var(--text); }
.kanban-card-title span { color: var(--text-light); font-size: 0.8rem; white-space: nowrap; }
.kanban-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 0.8rem; }
.kanban-meta-grid span, .kanban-description span { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 0.2rem; font-weight: 600; }
.kanban-meta-grid strong { font-size: 0.9rem; line-height: 1.5; }
.kanban-description { background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: 10px; padding: 0.75rem; }
.kanban-description p { margin: 0; color: var(--text); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9rem; }
.kanban-card-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.8rem; }
.kanban-card-actions form { margin: 0; }
.kanban-action-btn, .kanban-action-link { min-height: 38px; padding: 0.6rem 0.85rem; font-size: 0.85rem; }
.kanban-empty { border: 1.5px dashed var(--border); border-radius: 12px; padding: 1.2rem; text-align: center; color: var(--muted); font-size: 0.88rem; }

/* ══ الجداول ════════════════════════════════════════════ */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th {
    padding: 0.8rem 0.9rem;
    border-bottom: 2px solid var(--green-light);
    text-align: right;
    background: var(--green-surface);
    color: var(--green);
    font-size: 0.82rem;
    font-weight: 700;
}
td { padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--border-soft); text-align: right; font-size: 0.9rem; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--green-surface); }

/* ══ الإشعارات والتايم لاين ══════════════════════════════ */
.notification-item, .timeline-item, .note-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.notification-item:last-child, .timeline-item:last-child, .note-item:last-child { border-bottom: 0; }
.notification-item.unread strong { color: var(--green); }
.timeline { position: relative; }
.timeline-item { position: relative; padding-right: 1.2rem; }
.timeline-item::before { content: ""; position: absolute; right: 0; top: 1.1rem; width: 8px; height: 8px; border-radius: 50%; background: var(--green-mid); }

/* ══ شبكة التفاصيل ══════════════════════════════════════ */
.detail-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 1rem 0; }
.description-box { background: var(--surface-alt); border: 1.5px solid var(--border-soft); border-radius: 14px; padding: 1.1rem; }
.description-box h3 { margin-bottom: 0.4rem; color: var(--green); }
.description-box p { color: var(--text); line-height: 1.85; font-size: 0.95rem; }

/* ══ الرسوم البيانية ════════════════════════════════════ */
.chart-row { display: grid; grid-template-columns: minmax(110px, 1fr) 1.4fr 48px; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; font-size: 0.9rem; }
.bar { height: 10px; background: var(--green-surface); border-radius: 999px; overflow: hidden; border: 1px solid var(--green-light); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green)); border-radius: inherit; }

/* ══ فاصل ذهبي إسلامي ═══════════════════════════════════ */
.gold-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
    margin: 1.25rem 0;
    position: relative;
}
.gold-divider::after {
    content: "❖";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    padding: 0 0.5rem;
    color: var(--gold);
    font-size: 0.7rem;
}

/* ══ بانر الهوية ════════════════════════════════════════ */
.safa-brand-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(21,17,13,0.98), rgba(34,26,18,0.96));
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}
.safa-brand-banner::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.safa-brand-banner::before {
    content: "";
    position: absolute; inset: 0;
    background: url("../branding/ornaments.png") center/240px repeat;
    opacity: 0.12;
    pointer-events: none;
}
.safa-brand-banner img {
    width: 96px; height: 96px;
    object-fit: contain;
    border-radius: 18px;
    background: transparent;
    padding: 0;
    box-shadow: 0 10px 28px rgba(0,0,0,0.16);
    position: relative;
}
.safa-brand-banner h2 { margin: 0.4rem 0 0; color: #fff; font-size: 1.2rem; font-weight: 700; position: relative; }
.safa-brand-banner p { margin: 0.1rem 0 0; color: rgba(255,255,255,0.65); font-size: 0.85rem; position: relative; }

/* ══ الشريط العلوي للصفحات العامة ══════════════════════ */
.public-appbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 1.25rem;
}
.public-brand { display: flex; align-items: center; gap: 0.85rem; }
.public-brand-logo {
    width: 78px; height: 78px;
    border-radius: 18px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    box-shadow: 0 10px 24px rgba(25,18,12,0.12);
}
.public-brand-name { line-height: 1.3; }
.public-brand-name strong { display: block; font-size: 1rem; color: var(--green); font-weight: 800; }
.public-brand-name span { display: block; font-size: 0.8rem; color: var(--muted); }

.login-icon-btn {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: rgba(255,253,248,0.84);
    border: 1.5px solid var(--border-soft);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-card);
    transition: all 0.18s;
}
.login-icon-btn:hover { border-color: var(--gold); background: var(--gold-surface); box-shadow: 0 8px 20px rgba(25,18,12,0.12); }
.login-icon-shape { position: relative; width: 18px; height: 18px; display: inline-block; }
.login-dot { position: absolute; top: 0; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.login-stem { position: absolute; right: 1px; bottom: 0; width: 16px; height: 8px; border-radius: 10px 10px 6px 6px; background: var(--green); }

/* ══ مربع المرجع ════════════════════════════════════════ */
.reference-box {
    margin: 1.1rem 0; padding: 1rem;
    font-weight: 800; font-size: 1.35rem; text-align: center;
    background: linear-gradient(180deg, #15110d, #2a1f15);
    border-radius: 18px; color: #fff;
    letter-spacing: 0.06em;
    box-shadow: 0 6px 20px rgba(27,77,62,0.22);
    position: relative;
}
.reference-box::after {
    content: "";
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 60%; height: 3px;
    background: var(--gold);
    border-radius: 999px;
}
.success-panel { text-align: center; margin-top: 6vh; }

/* ══ التقييم ════════════════════════════════════════════ */
.rating-panel {
    margin: 1.25rem 0; text-align: right;
    background: linear-gradient(180deg, rgba(255,248,234,0.92), rgba(247,240,223,0.94));
    border: 1.5px solid #ead7aa;
    border-radius: 20px; padding: 1.2rem;
}
.rating-stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 0.35rem; margin: 0.75rem 0 1rem; }
.star-option input { display: none; }
.star-option span, .rating-stars.read-only .star { font-size: 2rem; color: #C8D8C0; cursor: pointer; transition: color 0.15s, transform 0.15s; }
.star-option.active span, .rating-stars.read-only .star.active { color: var(--gold); }
.star-option:hover span { transform: scale(1.08); }
.rating-stars.disabled { opacity: 0.45; }
.rating-stars.disabled .star-option span { cursor: not-allowed; }
.rating-comment-box { background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: 10px; padding: 0.9rem; line-height: 1.8; }

/* ══ الرسائل الومضية ════════════════════════════════════ */
.empty-state { color: var(--muted); text-align: center; padding: 1.5rem 0; font-size: 0.9rem; }
.flash-stack { display: grid; gap: 0.65rem; margin-bottom: 1.1rem; }
.flash { padding: 0.85rem 1rem; border-radius: 10px; background: var(--green-surface); border: 1px solid var(--green-light); color: var(--green); font-weight: 600; font-size: 0.9rem; }
.flash.error { background: #FDE8E8; border-color: #EFC2C2; color: var(--danger); }
.flash.success { background: #E0F2EB; border-color: #A8D8C0; color: var(--success); }

/* ══ الكتالوج ═══════════════════════════════════════════ */
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.catalog-shell { display: grid; gap: 1rem; }
.catalog-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-bottom: 1rem; overflow: hidden; }
.catalog-hero-copy h2 { margin: 0.5rem 0; font-size: 1.4rem; color: var(--green); }
.catalog-hero-copy p { margin: 0; color: var(--muted); line-height: 1.8; font-size: 0.92rem; }
.catalog-jump-links { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.catalog-jump-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0.6rem 1rem; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--border-soft); color: var(--green); box-shadow: var(--shadow-card); font-size: 0.88rem; font-weight: 600; transition: all 0.15s; }
.catalog-jump-link:hover { border-color: var(--green-mid); background: var(--green-surface); }
.catalog-hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.catalog-stat { background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: 12px; padding: 0.9rem; }
.catalog-stat.emphasis { background: var(--green-surface); border-color: var(--green-light); }
.catalog-stat span { display: block; color: var(--muted); margin-bottom: 0.25rem; font-size: 0.82rem; font-weight: 600; }
.catalog-stat strong { font-size: 1.3rem; color: var(--green); font-weight: 700; }
.catalog-stat small { display: block; margin-top: 0.3rem; color: var(--muted); line-height: 1.6; font-size: 0.82rem; }
.catalog-summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.catalog-summary-card { padding: 1rem 1.1rem; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border-soft); box-shadow: var(--shadow-card); }
.catalog-summary-card span { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.3rem; font-weight: 600; }
.catalog-summary-card strong { display: block; font-size: 1rem; margin-bottom: 0.3rem; color: var(--text); font-weight: 700; }
.catalog-summary-card p { margin: 0; color: var(--muted); line-height: 1.75; font-size: 0.88rem; }
.catalog-redesign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.catalog-redesign-card { display: grid; gap: 1rem; align-content: start; min-height: 100%; padding: 1.2rem; }
.catalog-featured-card { background: var(--green-surface); border-color: var(--green-light); }
.catalog-section-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.catalog-section-top h3 { margin: 0.3rem 0; font-size: 1.1rem; color: var(--green); }
.catalog-kicker { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; font-size: 0.85rem; }
.catalog-redesign-list { display: grid; gap: 0.8rem; }
.catalog-room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 0.75rem; }
.catalog-room-tile { display: grid; gap: 0.65rem; padding: 0.85rem 0.8rem 0.75rem; border-radius: 12px; border: 1.5px solid var(--border-soft); background: var(--surface); box-shadow: var(--shadow-card); }
.catalog-room-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.catalog-room-number { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--green-surface); color: var(--green); font-weight: 700; font-size: 0.95rem; border: 1.5px solid var(--green-light); }
.catalog-status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #C8D0D8; }
.catalog-status-dot.active { background: var(--success); box-shadow: 0 0 0 4px rgba(27,107,69,0.14); }
.catalog-status-dot.inactive { background: var(--danger); box-shadow: 0 0 0 4px rgba(168,48,48,0.12); }
.catalog-room-tile-body { display: grid; gap: 0.2rem; }
.catalog-room-tile-body strong { font-size: 0.9rem; line-height: 1.5; color: var(--text); }
.catalog-room-actions { display: flex; gap: 0.4rem; justify-content: space-between; align-items: center; }
.catalog-room-actions form { margin: 0; }
.catalog-edit-icon, .catalog-delete-icon { position: relative; width: 14px; height: 14px; display: inline-block; }
.catalog-edit-icon::before, .catalog-edit-icon::after, .catalog-delete-icon::before, .catalog-delete-icon::after { content: ""; position: absolute; }
.catalog-edit-icon::before { width: 11px; height: 3px; border-radius: 999px; background: currentColor; transform: rotate(-40deg); top: 5px; right: 1px; }
.catalog-edit-icon::after { width: 4px; height: 4px; background: currentColor; transform: rotate(-40deg); top: 2px; right: 8px; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.catalog-delete-icon::before { width: 10px; height: 10px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; bottom: 0; right: 2px; }
.catalog-delete-icon::after { width: 12px; height: 2px; background: currentColor; border-radius: 999px; top: 1px; right: 1px; box-shadow: 0 3px 0 -1px currentColor; }
.catalog-redesign-item { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; padding: 1rem; border-radius: 12px; border: 1.5px solid var(--border-soft); background: var(--surface); box-shadow: var(--shadow-card); }
.catalog-redesign-main { display: grid; gap: 0.4rem; min-width: 0; }
.catalog-item-headline { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.catalog-status-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0.2rem 0.65rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; background: var(--ivory); color: var(--muted); }
.catalog-status-chip.active { background: #E0F2EB; color: var(--success); }
.catalog-status-chip.inactive { background: #F5EBEB; color: #985252; }
.catalog-card { display: grid; gap: 1rem; align-content: start; }
.catalog-list { display: grid; gap: 0.75rem; }
.catalog-item { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; padding: 0.9rem; border: 1.5px solid var(--border-soft); border-radius: 10px; background: var(--ivory); }
.catalog-item-main { display: grid; gap: 0.4rem; }
.catalog-meta { color: var(--muted); font-size: 0.85rem; }
.catalog-form { border-top: 1px solid var(--border-soft); padding-top: 1rem; margin-top: 0.5rem; }
.catalog-add-btn { margin-top: auto; }
.subtype-chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.subtype-chip { display: inline-flex; padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--green-surface); color: var(--green); font-size: 0.82rem; font-weight: 600; border: 1px solid var(--green-light); }

/* ══ شارات الغرف ════════════════════════════════════════ */
.room-badge-list { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.room-badge { background: var(--green-surface); border: 1px solid var(--green-light); color: var(--green); border-radius: 6px; padding: 0.25rem 0.65rem; font-size: 0.85rem; font-weight: 600; }

/* ══ مساعد / نص ثانوي ═══════════════════════════════════ */
.helper-text { margin-top: 0; color: var(--muted); line-height: 1.85; font-size: 0.9rem; }
.helper-list { display: grid; gap: 0.5rem; margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem; }

/* ══ أزرار الجدول ══════════════════════════════════════ */
.table-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.mini-btn { border: 1.5px solid var(--border); background: var(--ivory); color: var(--green); border-radius: 8px; padding: 0.4rem 0.65rem; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.15s; }
.mini-btn:hover { border-color: var(--green-mid); background: var(--green-surface); }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.arrow-icon { width: 9px; height: 9px; display: inline-block; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.arrow-icon.up { transform: rotate(-135deg); margin-top: 4px; }
.arrow-icon.down { transform: rotate(45deg); margin-bottom: 4px; }
.mini-btn.danger { border-color: #F0C5C5; color: var(--danger); background: #FFF6F6; }
.mini-btn.danger:hover { background: #FDEAEA; border-color: var(--danger); }

/* ══ صفحة الدخول ════════════════════════════════════════ */
.auth-shell { min-height: 75vh; display: grid; place-items: center; }
.auth-card { width: min(100%, 440px); box-shadow: 0 20px 60px rgba(27,77,62,0.16); border-radius: 16px; overflow: hidden; border: 1.5px solid var(--border-soft); }
.auth-card .form-card { border-radius: 0; border: 0; border-top: 0; box-shadow: none; margin-top: 0; }

/* ══ تصميم متجاوب ═══════════════════════════════════════ */
@media (max-width: 860px) {
    .two-col, .detail-layout { grid-template-columns: 1fr; }
    .kanban-board { grid-template-columns: 1fr; }
    .catalog-grid { grid-template-columns: 1fr; }
    .catalog-redesign-grid { grid-template-columns: 1fr; }
    .catalog-hero { grid-template-columns: 1fr; }
    .catalog-summary-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar { height: auto; padding: 0.75rem 1rem; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .hero-card h1 { font-size: 1.5rem; }
    .form-grid.two, .segmented { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: 1fr; }
    .room-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .chart-row { grid-template-columns: 1fr; }
    .actions .primary-btn, .actions .secondary-btn { width: 100%; }
    .kanban-meta-grid { grid-template-columns: 1fr; }
    .kanban-card-top, .kanban-card-title { flex-direction: column; align-items: flex-start; }
    .kanban-card-actions > * { width: 100%; }
    .quick-search-row { grid-template-columns: 1fr; }
    .catalog-jump-links { display: grid; grid-template-columns: 1fr 1fr; }
    .catalog-redesign-item, .catalog-section-top { flex-direction: column; }
    .catalog-room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .table-actions { width: 100%; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
