/* =====================================================
   LEXORA LAW FIRM — النمط الرئيسي (RTL / بدون أيقونات)
   الألوان: كحلي قانوني داكن + ذهبي + خلفيات فاتحة
   ===================================================== */

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-Regular.ttf') format('truetype');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #0f3d5c;
    --navy-dark: #0a2b42;
    --navy-light: #1a5a85;
    --gold: #b08d2f;
    --gold-dark: #8a6d1f;
    --gold-light: #d4b25e;
    --ink: #22293a;
    --muted: #67718a;
    --line: #dde3ec;
    --bg: #f3f5f9;
    --card: #ffffff;
    --green: #2e7d4f;
    --red: #a33030;
    --orange: #b36a1d;
    --purple: #5b4a8a;
    --blue: #2e6e8e;
    --gray: #7a8296;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(15, 61, 92, .08), 0 4px 14px rgba(15, 61, 92, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Cairo', 'Tahoma', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.75;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold-dark); }
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.5; }
p { margin-bottom: .8em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
.text-center { text-align: center; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.w-100 { width: 100%; }

/* ============ تنبيهات ============ */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    border: 1px solid; position: relative; font-size: 14px;
}
.alert-success { background: #eef7f1; border-color: #bfe0cc; color: #1d5c38; }
.alert-danger { background: #fbeeee; border-color: #e7c3c3; color: #7c2525; }
.alert-info { background: #eef4fb; border-color: #c3d7ea; color: #1d4a68; }
.alert-close {
    position: absolute; left: 12px; top: 8px; background: none; border: none;
    color: inherit; cursor: pointer; font-family: inherit; font-size: 12px; opacity: .7;
}
.alert-close:hover { opacity: 1; }

/* ============ أزرار ============ */
.btn {
    display: inline-block; padding: 9px 22px; border-radius: var(--radius);
    border: 1px solid transparent; cursor: pointer; font-family: inherit;
    font-size: 14.5px; font-weight: 600; text-align: center; transition: .18s;
    line-height: 1.6;
}
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #7c2525; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--navy); border-color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-light:hover { border-color: var(--navy); }
.btn-link { background: none; border: none; color: var(--navy); padding: 0; font-size: inherit; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ شارات الحالة ============ */
.badge {
    display: inline-block; padding: 2px 12px; border-radius: 20px;
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: #e3f2e9; color: var(--green); }
.badge-red { background: #f9e8e8; color: var(--red); }
.badge-orange { background: #faf0e3; color: var(--orange); }
.badge-blue { background: #e6f0f7; color: var(--blue); }
.badge-purple { background: #eeebf5; color: var(--purple); }
.badge-gray { background: #eef0f4; color: var(--gray); }

/* =====================================================
   الموقع العام
   ===================================================== */
.site-body { background: #fff; }

.site-header {
    border-bottom: 3px solid var(--gold);
    background: var(--navy);
    position: sticky; top: 0; z-index: 50;
}
.site-header-in { display: flex; align-items: center; gap: 22px; min-height: 78px; flex-wrap: wrap; }
.site-brand { display: flex; flex-direction: column; line-height: 1.3; }
.brand-mark {
    color: var(--gold); font-weight: 900; letter-spacing: 3px; font-size: 22px;
    font-family: Georgia, 'Times New Roman', serif;
}
.brand-mark.big { font-size: 26px; }
.brand-name-ar { color: #fff; font-size: 14px; font-weight: 700; }
.brand-slogan { color: #9fb4c4; font-size: 11px; font-family: Georgia, serif; letter-spacing: .5px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-inline-start: 8px; }
.site-nav a {
    color: #d4dde5; padding: 8px 11px; font-size: 14px; border-radius: 6px; font-weight: 600;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.site-nav a.on { color: var(--gold-light); }
.site-cta { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.site-cta .btn-outline { color: #fff; border-color: #5a7d99; }
.site-cta .btn-outline:hover { background: #fff; color: var(--navy); border-color: #fff; }

/* بانر الديمو */
.demo-banner {
    background: #5c0f0f; color: #fff; padding: 9px 18px; display: flex;
    align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13.5px; z-index: 60;
}
.demo-banner-tag {
    background: #fff; color: #5c0f0f; font-weight: 800; padding: 2px 14px;
    border-radius: 20px; font-size: 13px; white-space: nowrap;
}
.demo-banner-text { flex: 1; min-width: 220px; }
.demo-switch a {
    color: #fff; border: 1px solid #a25252; padding: 2px 12px; border-radius: 16px; margin-inline-start: 6px; font-size: 12.5px;
}
.demo-switch a.on { background: var(--gold); border-color: var(--gold); }
.demo-switch a.exit { background: #fff; color: #5c0f0f; border-color: #fff; font-weight: 700; }

/* أقسام الموقع */
.hero {
    background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #14496b 100%);
    color: #fff; padding: 70px 0 78px; position: relative; overflow: hidden;
}
.hero::after {
    content: ''; position: absolute; inset-inline-start: -120px; bottom: -160px;
    width: 420px; height: 420px; border: 60px solid rgba(176, 141, 47, .12); border-radius: 50%;
}
.hero-in { max-width: 860px; margin: 0 auto; text-align: center; padding: 0 20px; position: relative; z-index: 2; }
.hero h1 { font-size: 34px; margin-bottom: 14px; }
.hero h1 span { color: var(--gold-light); }
.hero p { color: #c9d6e0; font-size: 17px; max-width: 640px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section { padding: 54px 0; }
.section.alt { background: var(--bg); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head h2 { font-size: 26px; color: var(--navy); margin-bottom: 8px; }
.section-head .kicker { color: var(--gold-dark); font-weight: 700; font-size: 13px; letter-spacing: 1px; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
}
.card-hover { transition: .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(15,61,92,.13); }
.card h3 { color: var(--navy); font-size: 17.5px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }

.service-card { border-top: 3px solid var(--gold); display: flex; flex-direction: column; }
.service-card .more { margin-top: auto; padding-top: 12px; font-weight: 700; font-size: 14px; }

.stat-box { text-align: center; padding: 20px 12px; }
.stat-box .num { font-size: 30px; font-weight: 900; color: var(--navy); }
.stat-box .lbl { color: var(--muted); font-size: 13.5px; }

.team-card { text-align: center; }
.team-photo {
    width: 92px; height: 92px; border-radius: 50%; background: var(--navy);
    color: var(--gold-light); display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 900; margin: 0 auto 14px; overflow: hidden;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-role { color: var(--gold-dark); font-weight: 700; font-size: 13px; }

.faq-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: #fff; }
.faq-item summary {
    padding: 15px 20px; cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; position: relative;
}
.faq-item summary::after { content: '+'; position: absolute; left: 18px; color: var(--gold); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-a { padding: 0 20px 16px; color: var(--muted); }

.page-head {
    background: var(--navy); color: #fff; padding: 38px 0; margin-bottom: 34px;
}
.page-head h1 { font-size: 26px; }
.page-head .crumbs { color: #a9bccb; font-size: 13px; margin-top: 6px; }
.page-head .crumbs a { color: var(--gold-light); }

.article-card h3 a { color: var(--navy); }
.article-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }

.article-body { font-size: 15.5px; line-height: 2; }
.article-body h2, .article-body h3 { color: var(--navy); margin: 22px 0 10px; }

.site-footer { background: var(--navy-dark); color: #b8c6d2; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 44px 20px; }
.footer-col h4 { color: #fff; margin-bottom: 14px; font-size: 16px; }
.footer-col p, .footer-col a { display: block; color: #b8c6d2; font-size: 13.5px; margin-bottom: 7px; }
.footer-col a:hover { color: var(--gold-light); }
.footer-social a { display: inline-block; margin-inline-end: 12px; }
.footer-bar { border-top: 1px solid #1c425f; padding: 16px 0; font-size: 13px; }
.footer-bar-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-bar a { color: #b8c6d2; margin-inline-start: 16px; }

/* نماذج الموقع */
.form-card { max-width: 780px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.auth-wrap { max-width: 440px; margin: 46px auto; }
.auth-links { text-align: center; margin-top: 16px; font-size: 14px; }

/* =====================================================
   تطبيق النظام (لوحات التحكم)
   ===================================================== */
.app-body { background: var(--bg); }
.layout { display: flex; min-height: calc(100vh - 0px); }

/* شريط جانبي */
.sidebar {
    width: 250px; background: var(--navy-dark); color: #c6d3dd; flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 20px 18px 12px; border-bottom: 1px solid #1c425f; }
.sidebar-brand .brand-mark { font-size: 20px; }
.sidebar-brand .brand-sub { color: #8ba3b5; font-size: 12px; }
.sidebar-tools { display: flex; gap: 6px; padding: 10px 14px; }
.mini-btn {
    flex: 1; background: #12354f; color: #a9bccb; border: 1px solid #1c425f; border-radius: 6px;
    padding: 4px 6px; font-family: inherit; font-size: 11.5px; cursor: pointer;
}
.mini-btn:hover { color: #fff; border-color: #2e5a7d; }
.sidebar-nav { padding: 6px 0 24px; flex: 1; }
.nav-group { border-bottom: 1px solid rgba(28, 66, 95, .5); }
.nav-group-toggle {
    width: 100%; background: none; border: none; color: #d4dde5; font-family: inherit;
    font-size: 13.5px; font-weight: 700; padding: 11px 16px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; text-align: right;
}
.nav-group-toggle:hover { color: var(--gold-light); }
.nav-arrow { font-size: 10px; width: 14px; color: var(--gold); }
.nav-items { display: none; }
.nav-group.open .nav-items { display: block; }
.nav-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 18px 8px 16px; color: #a9bccb; font-size: 13.5px;
    border-inline-start: 3px solid transparent; margin-inline-start: 10px;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-item.active {
    color: var(--gold-light); background: rgba(176, 141, 47, .1); border-inline-start-color: var(--gold); font-weight: 700;
}
.nav-count {
    background: var(--red); color: #fff; border-radius: 10px; font-size: 11px;
    padding: 0 7px; font-weight: 700; min-width: 20px; text-align: center;
}

/* منطقة المحتوى */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 22px;
    display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 40;
}
.menu-btn { display: none; }
.top-search { flex: 1; max-width: 520px; display: flex; }
.top-search input {
    flex: 1; border: 1px solid var(--line); border-inline-end: none; border-radius: 0 var(--radius) var(--radius) 0;
    padding: 8px 14px; font-family: inherit; font-size: 13.5px; outline: none;
}
.top-search button {
    background: var(--navy); color: #fff; border: none; border-radius: var(--radius) 0 0 0;
    padding: 0 18px; font-family: inherit; cursor: pointer; font-weight: 700; font-size: 13.5px;
}
.top-user { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.top-notif { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.notif-badge, .top-notif .notif-badge {
    background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700;
}
.top-who { display: flex; flex-direction: column; line-height: 1.4; }
.top-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.top-role { font-size: 12px; color: var(--muted); }

.content { padding: 24px; flex: 1; }
.app-footer {
    padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted);
    font-size: 12.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; background: #fff;
}

.page-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title h1 { font-size: 21px; color: var(--navy); }
.page-title .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* بطاقات وصفوف */
.card-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-block h2 { font-size: 16.5px; color: var(--navy); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card-block h3 { font-size: 15px; color: var(--navy); margin: 14px 0 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--navy);
}
.kpi.gold { border-inline-start-color: var(--gold); }
.kpi.green { border-inline-start-color: var(--green); }
.kpi.red { border-inline-start-color: var(--red); }
.kpi.orange { border-inline-start-color: var(--orange); }
.kpi .kpi-num { font-size: 25px; font-weight: 900; color: var(--navy); }
.kpi .kpi-lbl { color: var(--muted); font-size: 13px; }
.kpi .kpi-sub { font-size: 12px; color: var(--gold-dark); font-weight: 600; }
.kpi a { font-size: 12px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-grid .wide { grid-column: 1 / -1; }

/* جداول */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px;
}
table.data th {
    background: #f0f3f8; color: var(--navy); text-align: right; padding: 10px 12px;
    border-bottom: 2px solid var(--line); font-size: 13px; white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
table.data tr:hover td { background: #f7f9fc; }
table.data .actions-cell { white-space: nowrap; display: flex; gap: 6px; }
table.data td a.rowlink { font-weight: 700; }
.empty-row td { text-align: center; color: var(--muted); padding: 28px; }

/* نماذج النظام */
.form-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
label.f { display: block; font-weight: 700; font-size: 13.5px; color: var(--navy); margin-bottom: 5px; }
label.f .req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=url], input[type=tel], select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
    font-family: inherit; font-size: 14px; color: var(--ink); background: #fff; outline: none;
    transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-light); box-shadow: 0 0 0 3px rgba(26,90,133,.1); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
fieldset.fset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
fieldset.fset legend { font-weight: 700; color: var(--navy); font-size: 14px; padding: 0 8px; }

/* فلاتر */
.filters {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filters .f-item { min-width: 150px; flex: 1; max-width: 230px; }
.filters .f-item.small { max-width: 150px; }
.filters label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.filters input, .filters select { padding: 7px 10px; font-size: 13px; }

/* ترقيم الصفحات */
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 13px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: #fff; color: var(--navy);
}
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.pagination .disabled { color: #b9c1cf; }
.pagination a:hover { border-color: var(--navy); }

/* الرسوم البيانية */
.chart-bars { display: flex; align-items: flex-end; position: relative; padding-top: 8px; border-bottom: 2px solid var(--line); }
.chart-bar-col { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { width: 55%; max-width: 58px; border-radius: 6px 6px 0 0; }
.chart-bar-val { font-size: 11.5px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.chart-bar-label { font-size: 11px; color: var(--muted); margin-top: 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-empty { color: var(--muted); text-align: center; padding: 30px; }
.chart-donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; justify-content: center; }
.donut-total { font-size: 22px; font-weight: 900; fill: var(--navy); }
.donut-label { font-size: 11px; fill: var(--muted); }
.chart-legend { list-style: none; font-size: 13.5px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.chart-legend .dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.line-label { font-size: 11px; fill: var(--muted); }

/* لوحة كانبان */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kanban-col { background: #eef1f6; border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kanban-col h3 { font-size: 14px; color: var(--navy); padding-bottom: 8px; border-bottom: 2px solid var(--gold); margin-bottom: 12px; display: flex; justify-content: space-between; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.kanban-card .k-title { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 6px; }
.kanban-card .k-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.kanban-card .k-move { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kanban-card .k-move button { font-size: 11.5px; padding: 2px 9px; }

/* تقويم */
.calendar { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--navy); color: #fff; }
.cal-head div { padding: 9px 6px; text-align: center; font-size: 12.5px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 96px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; font-size: 12px; }
.cal-cell.other { background: #f6f8fb; color: #b9c1cf; }
.cal-day-num { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.cal-cell.today .cal-day-num { color: var(--gold); }
.cal-ev { display: block; background: #e6f0f7; color: var(--blue); border-radius: 5px; padding: 2px 7px; margin-bottom: 3px; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev.hearing { background: #faf0e3; color: var(--orange); }
.cal-ev.task { background: #f9e8e8; color: var(--red); }
.cal-ev.appointment { background: #e6f0f7; color: var(--blue); }
.cal-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f7f9fc; border-bottom: 1px solid var(--line); }

/* المحادثات */
.chat-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 18px; min-height: 460px; }
.chat-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; max-height: 560px; }
.chat-item { display: block; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.chat-item:hover, .chat-item.active { background: #f2f6fa; }
.chat-item .c-sub { font-size: 12px; color: var(--muted); }
.chat-item.unread .c-title { font-weight: 800; }
.chat-item.unread .c-title::after { content: 'جديد'; color: var(--red); font-size: 10.5px; margin-inline-start: 8px; }
.chat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.chat-head { padding: 13px 18px; border-bottom: 1px solid var(--line); background: #f7f9fc; border-radius: var(--radius) var(--radius) 0 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; max-height: 420px; }
.msg { margin-bottom: 14px; display: flex; }
.msg.me { justify-content: flex-start; flex-direction: row-reverse; }
.msg .bubble {
    background: #eef2f8; border-radius: 12px 12px 12px 3px; padding: 10px 15px; max-width: 75%;
    font-size: 14px;
}
.msg.me .bubble { background: var(--navy); color: #fff; border-radius: 12px 12px 3px 12px; }
.msg .bubble .m-meta { font-size: 11px; opacity: .75; margin-bottom: 4px; }
.msg .bubble .m-file { display: inline-block; margin-top: 6px; font-size: 12.5px; }
.msg.me .bubble .m-file { color: var(--gold-light); }
.chat-form { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.chat-form textarea { flex: 1; min-height: 52px; }

/* الإشعارات */
.notif-row { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif-row.unread { background: #f2f7fc; border-inline-start: 3px solid var(--gold); }
.notif-row .n-title { font-weight: 700; color: var(--navy); font-size: 14px; }
.notif-row .n-body { color: var(--muted); font-size: 13px; }
.notif-row .n-time { color: #99a3b5; font-size: 12px; white-space: nowrap; }

/* تفاصيل القضية */
.case-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.case-tab { padding: 9px 18px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; }
.case-tab.on { color: var(--navy); border-bottom-color: var(--gold); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail-grid .d-item { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; }
.detail-grid .d-lbl { font-size: 12px; color: var(--muted); }
.detail-grid .d-val { font-weight: 700; color: var(--ink); font-size: 14px; }
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 22px 18px 0; border-inline-start: none; }
.timeline li::before {
    content: ''; position: absolute; right: 4px; top: 7px; width: 9px; height: 9px;
    border-radius: 50%; background: var(--gold);
}
.timeline li::after {
    content: ''; position: absolute; right: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline .t-meta { font-size: 12px; color: var(--muted); }
.timeline .t-title { font-weight: 700; color: var(--navy); font-size: 14px; }

/* النسخ الاحتياطي */
.backup-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }

/* طباعة */
.print-hide { display: none; }
@media print {
    .sidebar, .topbar, .app-footer, .filters, .pagination, .page-title .actions, .demo-banner, .menu-btn { display: none !important; }
    .layout { display: block; }
    .content { padding: 0; }
    body { background: #fff; }
}

/* الاستجابة */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed; inset-inline-end: -260px; transition: inset-inline-end .25s; z-index: 70; height: 100vh;
    }
    .sidebar.open { inset-inline-end: 0; box-shadow: -4px 0 20px rgba(0,0,0,.3); }
    .menu-btn {
        display: inline-block; background: var(--navy); color: #fff; border: none; border-radius: 7px;
        padding: 7px 14px; font-family: inherit; font-size: 13px; cursor: pointer; font-weight: 700;
    }
    .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
    .site-nav.open { display: flex; }
    .site-cta { margin-inline-start: auto; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3, .grid-4, .form-grid, .form-2col, .form-3col { grid-template-columns: 1fr; }
    .chat-wrap { grid-template-columns: 1fr; }
    .chat-list { max-height: 220px; }
    .kanban { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .content { padding: 14px; }
    .top-search { display: none; }
    .form-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .site-cta { width: 100%; }
}
