/* تخطيط لوحة التحكم (SPA) - نادي ضباط الشرطة - RTL */

:root {
    --navy: #1e2559;
    --navy-dark: #141a42;
    --gold: #c8a45a;
    --green: #16a34a;
    --green-dark: #166534;
    --red: #dc2626;
    --purple: #2d2272;
    --sidebar-w: 250px;
    --line: #e5e7eb;
}

body.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f1f4f9;
    margin: 0;
}

/* احترام سمة hidden رغم قواعد display على الفئات */
[hidden] {
    display: none !important;
}

/* ===== الشريط الجانبي ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand .badge {
    font-size: 1.8rem;
}

.sidebar-brand strong {
    display: block;
    font-size: 0.95rem;
}

.sidebar-brand small {
    color: var(--gold);
    font-size: 0.75rem;
}

.sidebar-nav {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    color: #d7e0ec;
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--gold), #b8954f);
    color: var(--navy-dark);
    font-weight: 700;
}

.nav-icon {
    font-size: 1.1rem;
}

/* ===== المنطقة الرئيسية ===== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar h2 {
    font-size: 1.1rem;
    color: var(--navy);
    margin: 0;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    position: relative;
}

.icon-btn:hover {
    background: #f1f4f9;
}

#menuToggle {
    display: none;
}

/* جرس الإشعارات */
.bell-wrap {
    position: relative;
}

.bell-badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.bell-dropdown {
    position: absolute;
    inset-inline-end: 0;
    top: 120%;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 34, 56, 0.18);
    z-index: 50;
}

.bell-head {
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
}

.bell-item {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f1f4f9;
}

.bell-item strong {
    font-size: 0.88rem;
    color: var(--navy);
}

.bell-item p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.2rem 0 0;
}

.bell-empty {
    padding: 1rem;
    text-align: center;
}

.bell-all {
    display: block;
    text-align: center;
    padding: 0.7rem;
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid var(--line);
}

/* بطاقة المستخدم */
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-meta span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}

.user-meta small {
    font-size: 0.72rem;
    color: var(--gold);
}

.btn-logout {
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
}

.btn-logout:hover {
    background: var(--red);
    color: #fff;
}

/* ===== المحتوى ===== */
.content {
    padding: 1.5rem;
    flex: 1;
}

.loading,
.page-error {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.page-error {
    color: var(--red);
}

.muted {
    color: #6b7280;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.page-head h3 {
    color: var(--navy);
    margin: 0;
}

/* بطاقة الترحيب */
.welcome-card {
    background: linear-gradient(135deg, var(--navy), var(--navy-dark));
    color: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.welcome-hi {
    color: var(--gold);
    font-size: 0.9rem;
}

.welcome-card h3 {
    margin: 0.25rem 0;
    font-size: 1.4rem;
}

.welcome-date {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* بطاقة الآية */
.quote-card {
    background: rgba(201, 169, 97, 0.1);
    border-inline-start: 4px solid var(--gold);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quote-card p {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 1.35rem;
    color: var(--gold);
    margin: 0;
    line-height: 1.8;
}

.quote-mark {
    font-size: 2rem;
    color: var(--gold);
    opacity: 0.5;
}

/* شبكة الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-icon {
    font-size: 1.6rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
}

.stat-label {
    font-size: 0.82rem;
    color: #6b7280;
}

/* لوحات وقوائم */
.panel {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
}

.panel h4 {
    color: var(--navy);
    margin: 0 0 0.75rem;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f4f9;
}

.list a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}

.list small {
    color: #9ca3af;
    font-size: 0.78rem;
}

/* بطاقات عامة */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.card-item {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid transparent;
    transition: border-color 0.15s, transform 0.1s;
}

a.card-item:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.card-item h4 {
    color: var(--navy);
    margin: 0.4rem 0;
}

.card-item-head {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* وسوم */
.tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #eef2f7;
    color: var(--navy);
}

.tag-urgent {
    background: #fde8e8;
    color: var(--red);
}

.tag-new {
    background: rgba(22, 163, 74, 0.12);
    color: var(--green);
}

.tag-ok {
    background: rgba(22, 163, 74, 0.12);
    color: var(--green);
}

.tag-status.status-resolved {
    background: rgba(22, 163, 74, 0.12);
    color: var(--green);
}

.tag-status.status-rejected {
    background: #fde8e8;
    color: var(--red);
}

.tag-status.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

/* نماذج مضمّنة */
.inline-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.inline-form input,
.inline-form textarea,
.inline-form select {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

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

.check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    align-self: flex-start;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border: none;
}

.circular-body {
    margin: 1rem 0;
    line-height: 1.9;
    color: #374151;
}

.comment {
    border-top: 1px solid #f1f4f9;
    padding: 0.75rem 0;
}

.comment strong {
    color: var(--navy);
}

.comment .muted {
    font-size: 0.75rem;
    margin-inline-start: 0.5rem;
}

.read-ok {
    color: var(--green);
    font-weight: 600;
}

.read-stats {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f1f4f9;
    border-radius: 10px;
}

.admin-reply {
    background: rgba(22, 163, 74, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    color: var(--green-dark);
    font-size: 0.9rem;
}

.reply-form {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reply-form textarea {
    min-height: 60px;
    padding: 0.5rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
}

.reply-form .rstatus {
    padding: 0.45rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.kv {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.kv li {
    padding: 0.15rem 0;
}

.kv span {
    color: #6b7280;
}

/* جدول */
.search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-family: inherit;
}

.table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: start;
    border-bottom: 1px solid #f1f4f9;
    font-size: 0.88rem;
}

.data-table th {
    background: #f8fafc;
    color: var(--navy);
    font-weight: 700;
}

/* قائمة الإشعارات */
.notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notif-item {
    background: #fff;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 8px rgba(15, 34, 56, 0.05);
    cursor: pointer;
    border-inline-start: 4px solid transparent;
}

.notif-item.unread {
    border-inline-start-color: var(--gold);
    background: #fffdf6;
}

.notif-item strong {
    color: var(--navy);
}

.notif-item p {
    margin: 0.2rem 0;
    color: #4b5563;
    font-size: 0.88rem;
}

.notif-item small {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Toast */
.app-toast {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-start: 50%;
    transform: translateX(50%) translateY(150%);
    background: var(--navy);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s;
    z-index: 100;
    font-size: 0.9rem;
}

.app-toast.show {
    transform: translateX(50%) translateY(0);
}

.app-toast.error {
    background: var(--red);
}

.back-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 25;
}

.section-title {
    color: var(--navy);
    margin: 1rem 0 0.5rem;
}

.thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

/* بطاقات الأدوار v5 */
.badge-system {
    background: rgba(201, 169, 97, 0.2);
    color: #8a6d2f;
}

.badge-custom {
    background: rgba(45, 34, 114, 0.12);
    color: var(--purple);
}

.perm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.5rem 0;
}

.role-assign {
    padding: 0.35rem 0.5rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
}

/* نافذة منبثقة (Modal) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 34, 56, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    color: var(--navy);
    margin: 0 0 1rem;
}

.modal input,
.modal textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.perm-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.perm-group {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
}

.perm-group legend {
    color: var(--navy);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 0.4rem;
}

.perm-check {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: 48%;
    font-size: 0.85rem;
    margin: 0.2rem 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* بطاقة موظف الشهر */
.eom-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--gold), #b8954f);
    color: var(--navy-dark);
    border-radius: 16px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.25rem;
}

.eom-trophy {
    font-size: 2.4rem;
}

.eom-info {
    flex: 1;
}

.eom-label {
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.85;
}

.eom-info h3 {
    margin: 0.1rem 0;
    font-size: 1.3rem;
}

.eom-sub {
    font-size: 0.85rem;
}

.eom-link {
    color: var(--navy-dark);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
}

.vote-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vote-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.vote-item.voted {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.08);
}

.vote-name {
    flex: 1;
    color: var(--navy);
    font-weight: 600;
}

.vote-count {
    font-size: 0.82rem;
    color: #6b7280;
}

/* الاستبيانات */
.survey-q {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f4f9;
}

.survey-label {
    display: block;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.survey-q textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
}

.builder-q {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.builder-q .bq-text {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.builder-q select,
.builder-q .bq-options {
    margin-bottom: 0;
    width: auto;
    flex: 1;
}

.result-bar {
    margin: 0.4rem 0;
}

.result-bar span {
    font-size: 0.82rem;
    color: var(--navy);
}

/* اسألني - أكورديون */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.faq-item {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.faq-item:hover {
    border-color: var(--purple);
}

.faq-item.open {
    border-color: var(--purple);
}

.faq-q {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.9rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    text-align: start;
}

.faq-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.faq-a {
    padding: 1rem 1.1rem;
    background: #f0fdf4;
    border-top: 1px solid #dcfce7;
    color: #166534;
    line-height: 1.9;
}

.faq-a p {
    margin: 0 0 0.5rem;
}

/* تبويبات التصنيف */
.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tab {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--navy);
}

.tab.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.card-item video {
    width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0;
    background: #000;
}

/* دردشة اللجان */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: start;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.chat-messages {
    flex: 1;
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.chat-msg {
    background: #f1f4f9;
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    max-width: 80%;
    align-self: flex-start;
}

.chat-msg.mine {
    background: rgba(201, 169, 97, 0.18);
    align-self: flex-end;
}

.chat-author {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--navy);
}

.chat-msg p {
    margin: 0.15rem 0;
}

.chat-msg small {
    font-size: 0.68rem;
    color: #9ca3af;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chat-input input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-family: inherit;
}

@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
}

/* حقول النماذج ذات التسمية */
.fld {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--navy);
}

.fld select,
.fld input {
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
}

/* لوحة Kanban */
.kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kanban-col {
    background: #eef2f7;
    border-radius: 12px;
    padding: 0.75rem;
    min-height: 120px;
}

.kanban-col h4 {
    color: var(--navy);
    font-size: 0.9rem;
    margin: 0 0 0.6rem;
}

.kanban-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 6px rgba(15, 34, 56, 0.06);
}

.kanban-card strong {
    color: var(--navy);
    font-size: 0.9rem;
}

.kanban-card p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.35rem 0 0.15rem;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--green);
}

.kanban-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.kanban-actions .mv,
.btn-mini {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.kanban-actions .mv:hover {
    background: var(--navy);
    color: #fff;
}

/* مخطط Gantt */
.gantt-row {
    display: grid;
    grid-template-columns: 140px 1fr 180px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
}

.gantt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}

.gantt-track {
    background: #eef2f7;
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.gantt-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    border-radius: 999px;
}

.gantt-dates {
    font-size: 0.75rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .kanban {
        grid-template-columns: 1fr;
    }
    .gantt-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* ===== تطبيق الدردشة ===== */
.chat-app {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    height: calc(100vh - 130px);
}

.chat-sidebar {
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
    overflow-y: auto;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 0.6rem;
    cursor: pointer;
    text-align: start;
    position: relative;
}

.room-item:hover {
    background: #f1f4f9;
}

.room-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.room-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.room-info strong {
    color: var(--navy);
    font-size: 0.9rem;
}

.room-info small {
    color: #9ca3af;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.room-unread {
    background: var(--green);
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.chat-main {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 34, 56, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-empty {
    margin: auto;
    color: #9ca3af;
}

.chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.msg-reply {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    border-inline-start: 3px solid var(--gold);
    padding-inline-start: 0.5rem;
    margin-bottom: 0.25rem;
}

.ticks {
    color: var(--gold);
    font-size: 0.7rem;
}

.chat-msg.mine .ticks {
    color: #16a34a;
}

.msg-reply-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    font-size: 0.85rem;
    position: absolute;
    top: 4px;
    inset-inline-start: 4px;
}

.chat-msg {
    position: relative;
}

.chat-msg:hover .msg-reply-btn {
    opacity: 0.6;
}

.typing-indicator {
    height: 18px;
    padding: 0 1rem;
    font-size: 0.78rem;
    color: var(--green);
}

.reply-bar {
    padding: 0.4rem 1rem;
    background: #f1f4f9;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-bar button {
    background: transparent;
    border: none;
    cursor: pointer;
}

.chat-composer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--line);
    align-items: center;
}

.chat-composer input[type='text'] {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-family: inherit;
}

@media (max-width: 768px) {
    .chat-app {
        grid-template-columns: 1fr;
        height: auto;
    }
    .chat-main {
        min-height: 60vh;
    }
}

/* ===== استجابة الجوال ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        inset-inline-start: 0;
        transform: translateX(-100%);
        z-index: 30;
        transition: transform 0.25s;
    }

    [dir='rtl'] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    #menuToggle {
        display: block;
    }

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

    .user-meta {
        display: none;
    }

    .content {
        padding: 1rem;
    }
}

/* ===== الشاليهات ===== */
.chalet-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5eaf2;
}

.chalet-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.6rem 1.1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
}

.chalet-tab.active {
    color: var(--navy, #1e3a5f);
    border-bottom-color: var(--gold, #c9a961);
}

.chalet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}

.chalet-card {
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 1rem 0.75rem;
    text-decoration: none;
    color: var(--navy, #1e3a5f);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.12s, box-shadow 0.12s;
}

.chalet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.chalet-num {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy, #1e3a5f), #2d2272);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
}

.chalet-name {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
}

.chalet-meta {
    font-size: 0.72rem;
    color: #64748b;
}

.chalet-deposit-bar {
    background: rgba(201, 169, 97, 0.14);
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.chalet-guest-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chalet-items-table .ci-cond,
.chalet-items-table .ci-qty {
    padding: 0.3rem 0.4rem;
    border: 1px solid #d4dbe6;
    border-radius: 8px;
    font-family: inherit;
    width: 100%;
    max-width: 110px;
}

.chalet-items-table tr.row-flag {
    background: rgba(220, 38, 38, 0.06);
}

.chalet-items-table .ci-line {
    font-weight: 700;
    white-space: nowrap;
}

.btn-del-item {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.chalet-summary {
    margin: 1rem 0;
    background: #f7f9fc;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
}

.chalet-summary .cs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #e0e6ef;
}

.chalet-summary .cs-row:last-child {
    border-bottom: none;
}

.chalet-summary .cs-row strong {
    font-size: 1.05rem;
    color: var(--navy, #1e3a5f);
}

.chalet-summary .cs-row strong.neg {
    color: var(--red, #dc2626);
}

.report-items {
    margin: 0.6rem 0;
    font-size: 0.85rem;
}

.cond-tag {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cond-tag.cond-missing {
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
}

.cond-tag.cond-damaged {
    background: rgba(217, 119, 6, 0.16);
    color: #b45309;
}

/* ===== أكاديمية كرة القدم ===== */
.academy-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.ac-stat {
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    padding: 0.7rem 0.4rem;
    text-align: center;
}

.ac-stat .num {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy, #1e3a5f);
}

.ac-stat .lbl {
    font-size: 0.7rem;
    color: #64748b;
}

.search-box {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d4dbe6;
    border-radius: 10px;
    font-family: inherit;
    margin-bottom: 1rem;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--navy, #1e3a5f);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.12s, box-shadow 0.12s;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.player-avatar,
.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gold, #c9a961), #b8954f);
    color: var(--navy, #1e3a5f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    flex-shrink: 0;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.player-info strong {
    font-size: 0.95rem;
}

.player-cat {
    display: inline-block;
    background: rgba(201, 169, 97, 0.18);
    color: #8a6d2f;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    width: fit-content;
}

.sess-badge {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 700;
}

.sess-badge b {
    font-size: 0.95rem;
}

.sess-badge.no-sub {
    color: #dc2626;
}

.player-profile {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 1rem;
    margin: 0.75rem 0 1rem;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    font-size: 2.1rem;
    border: 2px solid var(--gold, #c9a961);
    border-radius: 14px;
}

.profile-meta h3 {
    margin-bottom: 0.25rem;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn.danger {
    color: var(--red, #dc2626);
    border-color: rgba(220, 38, 38, 0.4);
}

.attendance-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-link-del {
    background: transparent;
    border: none;
    color: var(--red, #dc2626);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
}

/* مربعات حصص الشهر (مشتركة مع صفحة التحقق) */
.vc-sessions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 0.5rem 0;
}

.vc-stat {
    text-align: center;
    background: #f7f9fc;
    border-radius: 12px;
    padding: 0.8rem 0.3rem;
}

.vc-stat .num {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--navy, #1e3a5f);
}

.vc-stat.remain .num {
    color: #16a34a;
}

.vc-stat.attended .num {
    color: #2d2272;
}

.vc-stat .lbl {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.vc-pay {
    text-align: center;
    margin-top: 0.6rem;
    padding: 0.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}

.vc-pay.pay-paid {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.vc-pay.pay-unpaid {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.vc-pay.pay-partial {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.vc-pay.pay-none {
    background: #f1f5f9;
    color: #64748b;
}

/* ============ تعديلات جديدة (الرزنامة، المودال، النقاط، المستثمرون، المسح) ============ */

/* زر الرجوع */
.back-btn { font-size: 1.15rem; }

.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* أزرار التبويب العامة */
.tab-btn {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--navy);
}
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* شريط ملخص */
.stat-strip { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-mini {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 0.6rem 1rem; display: flex; flex-direction: column; min-width: 140px;
}
.stat-mini span { color: #64748b; font-size: 0.8rem; }
.stat-mini strong { color: var(--navy); font-size: 1.2rem; }

/* بار الفعاليات */
.events-bar { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.event-chip {
    flex: 0 0 auto; background: #fff; border: 1.5px solid var(--line);
    border-radius: 12px; padding: 0.5rem 0.8rem; cursor: pointer; text-align: right;
    display: flex; flex-direction: column; gap: 2px; min-width: 150px; font-family: inherit;
}
.event-chip:hover { border-color: var(--gold); }
.event-chip .chip-date { font-size: 0.72rem; color: #64748b; }
.event-chip .chip-title { font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.event-chip .chip-staff { font-size: 0.72rem; color: var(--green-dark); }

/* الرزنامة */
.cal-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-top: 1rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-head strong { font-size: 1.05rem; color: var(--navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.75rem; color: #64748b; font-weight: 700; padding: 4px 0; }
.cal-cell { min-height: 78px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fafbfc; display: flex; flex-direction: column; gap: 2px; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold) inset; }
.cal-daynum { font-size: 0.78rem; font-weight: 700; color: var(--navy); }
.cal-event {
    background: var(--navy); color: #fff; border: none; border-radius: 5px;
    padding: 2px 5px; font-size: 0.68rem; cursor: pointer; text-align: right;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit;
}
.cal-more { font-size: 0.68rem; color: #64748b; }

/* المودال العام */
.app-modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 34, 56, 0.55);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 1000; padding: 5vh 1rem; overflow-y: auto;
}
.app-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,0.25); }
.app-modal.wide { max-width: 680px; }
.app-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.app-modal-head h3 { margin: 0; color: var(--navy); font-size: 1.1rem; }
.app-modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b; }
.app-modal-body { padding: 1.25rem; }

/* قائمة المسؤولين */
.staff-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.staff-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.staff-list .staff-name { font-weight: 600; color: var(--navy); flex: 1; }

/* لوحة النقاط */
.points-board { display: flex; flex-direction: column; gap: 4px; }
.points-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: #f8fafc; border-radius: 8px; }
.points-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.points-name { flex: 1; color: var(--navy); }
.points-val { font-weight: 700; color: var(--gold); }

/* تخصيص الأقسام */
.sections-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.section-row { display: grid; grid-template-columns: 1.3fr 1.5fr 0.7fr auto; gap: 0.5rem; align-items: center; }
.section-row .section-default { font-size: 0.85rem; color: #64748b; }
.section-row input[type="text"] { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }

/* شارات مناطق الشاليهات */
.chalet-zone-tag { display: block; font-size: 0.68rem; color: #64748b; margin-top: 2px; }
.chalet-card.zone-vip { border-color: var(--gold); }
.chalet-card.zone-beach .chalet-num { color: #0369a1; }

/* المسح بالكاميرا */
.scan-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.scan-video { width: 100%; max-height: 300px; background: #000; border-radius: 12px; object-fit: cover; }
.scan-result { padding: 0.75rem; border-radius: 10px; background: #f8fafc; min-height: 20px; }
.scan-result.ok { background: #dcfce7; color: #166534; }
.scan-result.warn { background: #fef9c3; color: #854d0e; }
.scan-result.err { background: #fee2e2; color: #991b1b; }
.scan-sess { margin-top: 4px; font-size: 0.85rem; }

/* الوضع الليلي للعناصر الجديدة */
body.dark .app-modal { background: #16233a; }
body.dark .app-modal-head { border-color: #24354f; }
body.dark .app-modal-head h3, body.dark .cal-daynum, body.dark .points-name, body.dark .stat-mini strong { color: #e2e8f0; }
body.dark .cal-wrap, body.dark .event-chip, body.dark .stat-mini, body.dark .tab-btn { background: #16233a; border-color: #24354f; color: #e2e8f0; }
body.dark .cal-cell { background: #1b2c46; border-color: #24354f; }
body.dark .points-row, body.dark .scan-result { background: #1b2c46; }

/* صف عنوان قسم في جدول تدقيق الشاليه */
.ci-cat-row td {
    background: var(--navy); color: #fff; font-weight: 700;
    font-size: 0.85rem; padding: 6px 10px;
}
body.dark .ci-cat-row td { background: #24354f; }

/* إدارة المستثمر: أزرار، تبويبات، دردشة */
.inv-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.inv-tabs { margin-bottom: 0.75rem; }
.inv-chat { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding: 6px; background: #f7f9fc; border-radius: 12px; }
.chat-bubble { max-width: 80%; padding: 8px 12px; border-radius: 12px; }
.chat-bubble p { margin: 0; font-size: 0.9rem; }
.chat-bubble small { font-size: 0.68rem; opacity: 0.7; }
.chat-bubble.me { align-self: flex-start; background: var(--navy); color: #fff; }
.chat-bubble.them { align-self: flex-end; background: #fff; border: 1px solid var(--line); color: var(--navy); }
body.dark .inv-chat { background: #1b2c46; }
body.dark .chat-bubble.them { background: #16233a; border-color: #24354f; color: #e2e8f0; }

/* حجم أيقونة الجرس الموحّدة في الشريط العلوي */
.icon-btn .ui-icon { width: 22px; height: 22px; }
.bell-wrap { position: relative; }

/* منتقي الصلاحيات عند قبول الطلب */
.perm-groups { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; max-height: 55vh; overflow-y: auto; }
.perm-group { background: #f7f9fc; border-radius: 10px; padding: 0.6rem 0.8rem; }
.perm-group h5 { color: var(--navy); margin: 0 0 0.4rem; font-size: 0.9rem; }
.perm-group .perm-check { display: block; padding: 0.2rem 0; font-size: 0.9rem; }
.doc-link { display: inline-block; margin: 0.4rem 0; color: var(--navy); font-weight: 600; text-decoration: none; }
body.dark .perm-group { background: #1b2c46; }

/* ===== إصلاح التمرير على مستوى النظام (R5) ===== */
/* منع الفيض الأفقي للصفحة مع إبقاء التمرير الرأسي */
html { overflow-x: hidden; }
body.app-shell { overflow-x: hidden; }
.main-area { min-width: 0; overflow-x: hidden; }
.content { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* الجداول الطويلة: تمرير أفقي واضح دون قص الأعمدة */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.data-table { min-width: max-content; }
/* النوافذ المنبثقة: تمرير عند زيادة المحتوى */
.app-modal { max-height: 90vh; display: flex; flex-direction: column; }
.app-modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* أي حاوية بطاقات/شبكات لا تتجاوز عرض الشاشة */
.cards, .stats-grid, .player-grid, .chalet-grid { max-width: 100%; }

/* بطاقة الفعالية القادمة في الرئيسية */
.home-event { display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none; }
.home-event strong { color: var(--navy); font-size: 1.05rem; }
.home-event .muted { font-size: 0.85rem; }

/* ================= نظام تصميم موحّد (نمط المرجع "أهلا ٢") ================= */
/* شبكة بطاقات الأقسام/الأكاديميات: بطاقة كحلية بأيقونة + شريط اسم أبيض */
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 900px) { .grid-cards { grid-template-columns: repeat(4, 1fr); } }
.grid-card {
    display: flex; flex-direction: column; text-decoration: none;
    border-radius: 18px; overflow: hidden; box-shadow: 0 8px 20px rgba(30,37,89,0.12);
    transition: transform .06s;
}
.grid-card:active { transform: scale(0.98); }
.grid-card .gc-icon {
    background: linear-gradient(150deg, #2a3169, #171d47); color: #fff;
    aspect-ratio: 1.5 / 1; display: flex; align-items: center; justify-content: center;
}
.grid-card .gc-icon .ui-icon { width: 40px; height: 40px; }
.grid-card .gc-img { width: 100%; aspect-ratio: 1.7 / 1; object-fit: cover; background: #1e2559; }
.grid-card .gc-label {
    background: #fff; color: var(--navy, #1e2559); text-align: center;
    padding: 0.7rem 0.5rem; font-weight: 700; font-size: 0.92rem;
}
body.dark .grid-card .gc-label { background: #16233a; color: #e2e8f0; }

/* لوحة صدارة موظف الشهر (ميداليات) */
.leaderboard { display: flex; flex-direction: column; gap: 0.6rem; }
.lb-top {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem;
    border-radius: 16px; background: linear-gradient(150deg, #2a3169, #171d47); color: #fff;
}
.lb-top.rank-1 { box-shadow: 0 0 0 2px var(--gold, #c8a45a) inset; }
.lb-medal { font-size: 2rem; }
.lb-info { display: flex; flex-direction: column; }
.lb-info strong { color: var(--gold, #c8a45a); font-size: 1.1rem; }
.lb-info .lb-name { font-size: 1.05rem; font-weight: 700; }
.lb-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line, #e5e7eb); }
.lb-hash { color: var(--gold, #c8a45a); font-weight: 700; width: 34px; }
.lb-rowname { flex: 1; color: var(--navy, #1e2559); font-weight: 600; }
.lb-pts { color: #64748b; font-size: 0.9rem; }
body.dark .lb-rowname { color: #e2e8f0; }

/* بطاقة تفاصيل موحّدة (كحلية بعناوين ذهبية) — للاعبين/الموظفين/المستثمرين */
.detail-card { background: linear-gradient(150deg, #232c63, #1a2150); color: #fff; border-radius: 18px; padding: 1.1rem 1.25rem; }
.detail-card .dc-k { color: var(--gold, #c8a45a); font-weight: 700; }
.detail-card .dc-v { color: #fff; }
.detail-card .dc-row { margin: 0.35rem 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* شريط بحث + مسح رمز موحّد */
.list-search { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.list-search .ls-input { flex: 1; min-width: 160px; border: 1.5px solid var(--line, #e5e7eb); border-radius: 12px; padding: 0.6rem 0.9rem; font-family: inherit; }

/* ===== الأكاديميات والدورات (نمط المرجع) ===== */
.gold-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.btn-gold-pill {
    background: var(--gold, #c8a45a); color: var(--navy, #1e2559);
    border: none; border-radius: 999px; padding: 0.6rem 1.4rem;
    font-family: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer;
    box-shadow: 0 6px 16px rgba(200,164,90,0.3);
}
.btn-gold-pill:active { transform: scale(0.97); }
.grid-card .gc-icon.danger { background: #a01820; }
.back-link { display: inline-block; margin-bottom: 0.9rem; color: var(--navy, #1e2559); font-weight: 700; text-decoration: none; }

/* بطاقة اللاعب المميّزة */
.player-feature { margin-bottom: 1rem; }
.pf-top { display: flex; gap: 1rem; align-items: flex-start; }
.pf-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.pf-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: #e6e9f2; color: var(--navy,#1e2559); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 800; }
.pf-num { color: #cbd5e1; font-size: 0.85rem; letter-spacing: 1px; }
.pf-fields { flex: 1; min-width: 0; }
.pf-fields .dc-row { font-size: 0.95rem; }
.pf-qr { margin: 0.75rem 0 0.25rem; }
.pf-qr img { width: 130px; height: 130px; background: #fff; padding: 6px; border-radius: 10px; }
.pf-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-start; margin-top: 0.6rem; }
.btn-mini { border: none; border-radius: 999px; padding: 0.45rem 1rem; font-family: inherit; font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.btn-mini.gray { background: #aeb4c6; color: #1e2559; }
.btn-mini.gold { background: var(--gold, #c8a45a); color: #1e2559; }
.btn-mini.green { background: #1e9e4a; color: #fff; }
.btn-mini.red { background: #c22432; color: #fff; }

/* قائمة أسماء اللاعبين داخل بطاقة كحلية (فواصل ذهبية كالمرجع) */
.pl-names { display: flex; flex-direction: column; padding: 0.4rem 1.25rem; }
.pl-name {
    background: none; border: none; border-bottom: 1px solid rgba(200,164,90,0.55);
    color: #fff; font-family: inherit; font-size: 0.98rem; padding: 0.7rem 0.2rem;
    cursor: pointer; text-align: center;
}
.pl-name:last-child { border-bottom: none; }

/* نتائج بحث اللاعب الموجود */
.ex-results { display: flex; flex-direction: column; gap: 4px; margin-top: 0.5rem; }
.ex-row { background: #f3f5fb; border: none; border-radius: 10px; padding: 0.6rem 0.8rem; font-family: inherit; text-align: right; cursor: pointer; color: var(--navy,#1e2559); font-weight: 600; }
.ex-row:hover { background: #e8ebf6; }

/* بطاقتا موقعي الاستثمار (نمط المرجع) */
.loc-cards { display: flex; flex-direction: column; gap: 1.1rem; max-width: 560px; margin: 0 auto; }
.loc-card { border-radius: 18px; overflow: hidden; text-decoration: none; box-shadow: 0 10px 24px rgba(30,37,89,0.15); display: flex; flex-direction: column; }
.loc-card .lc-img { background: linear-gradient(150deg, #2a3169, #171d47); height: 130px; display: flex; align-items: center; justify-content: center; color: #fff; }
.loc-card .lc-img .ui-icon { width: 52px; height: 52px; }
.loc-card .gc-label { background: #fff; color: var(--navy, #1e2559); text-align: center; padding: 0.75rem; font-weight: 700; }
body.dark .loc-card .gc-label { background: #16233a; color: #e2e8f0; }

/* الأعمال الجارية: بطاقات كحلية موحّدة (نمط المرجع) */
.kanban-col { background: transparent; border: none; padding: 0; }
.kanban-col h4 { color: var(--navy, #1e2559); }
.kanban-card {
    background: linear-gradient(150deg, #232c63, #1a2150) !important;
    color: #fff !important; border: none !important; border-radius: 18px !important;
    box-shadow: 0 10px 22px rgba(30,37,89,0.2);
}
.kanban-card p { color: #cbd5e1 !important; }
.kanban-card .progress { background: rgba(255,255,255,0.18) !important; }
.kanban-card .progress span { background: var(--gold, #c8a45a) !important; }

/* شريحة فلتر القسم النشط */
.dept-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(200,164,90,0.15); color: var(--navy, #1e2559);
    border: 1px solid var(--gold, #c8a45a); border-radius: 999px;
    padding: 0.35rem 0.9rem; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.9rem;
}
.dept-chip button { background: none; border: none; color: #b91c1c; font-weight: 800; cursor: pointer; font-size: 0.95rem; }

/* ===== نظام فحص الشاليهات الجديد ===== */
.btn-gold-pill.big-period { width: 100%; max-width: 480px; padding: 1rem; line-height: 1.7; font-size: 1.05rem; }
.btn-gold-pill.big-period small { font-weight: 600; font-size: 0.85rem; }
/* حالة الشاليه في الشبكة */
.chalet-card.st-ok { border: 2px solid #16a34a; background: #f0fdf4; }
.chalet-card.st-not_ok { border: 2px solid #dc2626; background: #fef2f2; }
.chalet-card.st-maintenance { border: 2px solid #d97706; background: #fffbeb; }
/* خيارات الفحص الثلاثة */
.check-options { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.75rem 0; }
.check-opt {
    border: 2px solid var(--line, #e5e7eb); background: #fff; border-radius: 14px;
    padding: 0.9rem; font-family: inherit; font-size: 1rem; font-weight: 700;
    color: var(--navy, #1e2559); cursor: pointer; text-align: center;
}
.check-opt.ok.selected { border-color: #16a34a; background: #f0fdf4; }
.check-opt.bad.selected { border-color: #dc2626; background: #fef2f2; }
.check-opt.mnt.selected { border-color: #d97706; background: #fffbeb; }
/* زر حذف الإشعار/التعميم */
.notif-del {
    float: left; background: none; border: none; color: #b91c1c;
    font-size: 0.95rem; font-weight: 800; cursor: pointer; padding: 2px 6px;
}
.notif-item { position: relative; }
