/* جميع أنماط مركز التصميم معزولة عن بقية شاشات النظام */
.dc-root{direction:rtl;color:#17334a;font-family:Cairo,Tahoma,Arial,sans-serif;display:block;min-width:0}
.dc-root *{box-sizing:border-box}
.dc-root .dc-hero{background:linear-gradient(120deg,#123c58,#0b6674 65%,#087985);color:#fff;border-radius:20px;padding:26px;display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;box-shadow:0 12px 35px #153c5421;margin-bottom:17px}
.dc-root .dc-eyebrow{font-size:11px;letter-spacing:1px;color:#b8e3db;font-weight:800}
.dc-root .dc-hero h1{font-size:28px;margin:5px 0 8px;color:#fff}
.dc-root .dc-hero p{font-size:13px;line-height:1.9;max-width:680px;margin:0;color:#e4f4f3}
.dc-root .dc-hero-stats{display:flex;gap:9px;align-self:center}
.dc-root .dc-hero-stats>div{display:flex;flex-direction:column;min-width:100px;text-align:center;background:#ffffff1b;border:1px solid #ffffff26;border-radius:14px;padding:13px 10px}
.dc-root .dc-hero-stats strong{font-size:24px;color:#fff}
.dc-root .dc-hero-stats span{font-size:11px;color:#d9e8e7}
.dc-root .dc-toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;padding:15px;background:white;border:1px solid #dce6ed;border-radius:16px;margin-bottom:12px;box-shadow:0 5px 18px #1739530d}
.dc-root .dc-toolbar>.dc-field{flex:1 1 230px}
.dc-root .dc-input,.dc-root .dc-select{border:1px solid #cad8df;border-radius:10px;min-height:37px;padding:7px 10px;background:#fff;color:#17334a;font:inherit;font-size:13px;max-width:100%;width:100%;outline-color:#0f7886}
.dc-root .dc-field{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:700;min-width:0}
.dc-root .dc-field>span{color:#526b7c}
.dc-root .dc-button{border:1px solid #ccdbe3;background:white;border-radius:10px;padding:9px 12px;min-height:36px;font:700 12px Cairo,Tahoma,Arial,sans-serif;color:#1a4b60;cursor:pointer;white-space:nowrap;transition:background .16s ease,transform .16s ease}
.dc-root .dc-button:not(:disabled):hover{background:#eaf4f8;transform:translateY(-1px)}
.dc-root .dc-button:disabled{opacity:.45;cursor:not-allowed}
.dc-root .dc-button.primary{background:#097682;color:#fff;border-color:#097682}
.dc-root .dc-button.print{background:#d7a33f;color:#142b36;border-color:#d7a33f}
.dc-root .dc-button.secondary{background:#f1f7f9}
.dc-root .dc-button.danger{color:#a53b3b;background:#fff5f3;border-color:#f7d6d3}
.dc-root .dc-button.mini{padding:4px 8px;min-height:29px}
.dc-root .dc-feedback{padding:10px 14px;margin:10px 0;border-radius:10px;font-size:13px;font-weight:700}
.dc-root .dc-feedback.error{background:#fff1ee;color:#a22a2a;border:1px solid #f2cecb}
.dc-root .dc-feedback.success{background:#ecf8f4;color:#14674e;border:1px solid #c9e9dc}
.dc-root .dc-workspace{display:grid;grid-template-columns:minmax(300px,410px) minmax(0,1fr);gap:16px;align-items:start}
.dc-root .dc-editor{background:#fff;border:1px solid #dbe5eb;border-radius:16px;padding:17px;min-width:0;box-shadow:0 5px 16px #1640550d}
.dc-root .dc-editor>.dc-field{margin-bottom:12px}
.dc-root .dc-tabs{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:14px;padding-bottom:11px;border-bottom:1px solid #e7eef1}
.dc-root .dc-tabs .dc-button{padding:8px 9px;min-height:33px}
.dc-root .dc-tabs .dc-button.active{color:#fff;background:#176574;border-color:#176574}
.dc-root .dc-card{background:#f9fcfd;border:1px solid #e1ebef;border-radius:13px;padding:13px;margin-bottom:12px;display:flex;flex-direction:column;gap:10px}
.dc-root .dc-card h3{color:#17445c;margin:0 0 4px;font-size:15px}
.dc-root .dc-card h4{margin:0 0 7px;font-size:12px;color:#37677b}
.dc-root .dc-field-list{display:grid;gap:6px;max-height:350px;overflow:auto}
.dc-root .dc-available-field{padding:7px 9px;display:flex;align-items:center;gap:8px;justify-content:space-between;background:white;border:1px solid #e4edf2;border-radius:9px;font-size:12px}
.dc-root .dc-available-field span{flex:1;min-width:0}
.dc-root .dc-available-field .dc-button{font-size:10px;padding:5px 8px;min-height:28px}
.dc-root .dc-column-list{display:grid;gap:9px}
.dc-root .dc-column-row{background:#fff;border:1px solid #e4eef2;border-radius:11px;padding:9px;display:grid;grid-template-columns:25px minmax(0,1fr) 90px;gap:8px;align-items:end}
.dc-root .dc-index{font-weight:900;color:#167987;align-self:center;text-align:center}
.dc-root .dc-column-row .dc-row-actions{grid-column:1/-1;display:flex;justify-content:end;gap:6px}
.dc-root .dc-check{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:700;cursor:pointer;margin:9px 0}
.dc-root .dc-check input{accent-color:#087888;width:17px;height:17px}
.dc-root .dc-slot-grid{display:grid;gap:10px}
.dc-root .dc-slot-grid>div{padding:11px;background:white;border:1px solid #dae8ef;border-radius:9px}
.dc-root .dc-slot-editor{display:grid;gap:8px}
.dc-root .dc-file-picker{display:grid;gap:8px}
.dc-root .dc-file-picker input{font-size:12px;width:100%}
.dc-root .dc-file-picker img{width:90px;height:65px;object-fit:contain;background:#fff}
.dc-root .dc-extra-list{display:grid;gap:10px}
.dc-root .dc-extra-row{background:#fff;padding:10px;border-radius:9px;display:grid;gap:8px}
.dc-root .dc-extra-row>.dc-button{justify-self:start}
.dc-root .dc-filter-edit{display:flex;align-items:center;justify-content:space-between;padding:9px;border:1px solid #e0e9ed;background:#fff;border-radius:10px;margin:8px 0}
.dc-root .dc-page-settings{display:grid;gap:12px}
.dc-root .dc-muted{font-size:12px;color:#697e8a;line-height:1.9;margin:4px 0}
.dc-root .dc-preview{min-width:0;border:1px solid #dbe5eb;background:#f5f8fa;border-radius:16px;overflow:hidden;box-shadow:0 5px 16px #1640550d}
.dc-root .dc-preview-head{padding:15px 18px;background:white;display:flex;justify-content:space-between;gap:10px;align-items:center;border-bottom:1px solid #e1e9ed}
.dc-root .dc-preview-head h2{margin:0;color:#16445d;font-size:18px}
.dc-root .dc-preview-head p{font-size:11px;margin:5px 0 0;color:#728392}
.dc-root .dc-a4-badge{background:#e8f4f5;color:#097382;border:1px solid #d0e7e8;border-radius:100px;padding:7px 10px;font-size:11px;font-weight:900;white-space:nowrap}
.dc-root .dc-filters-screen{background:#fff;border-bottom:1px solid #dfe8ee;padding:13px 17px;display:flex;flex-wrap:wrap;align-items:end;gap:10px}
.dc-root .dc-filters-screen>strong{width:100%;font-size:12px;color:#1e536a}
.dc-root .dc-filters-screen>p{color:#7b8a91;font-size:12px;flex:1}
.dc-root .dc-runtime-filters{display:flex;gap:7px;flex-wrap:wrap;flex:1}
.dc-root .dc-runtime-filters .dc-field{min-width:130px;flex:1}
.dc-root .dc-preview-note{padding:10px 16px;background:#fffbec;color:#766024;font-size:12px;margin:0;border-bottom:1px solid #ece1b5}
.dc-root .dc-scroll{overflow:auto;padding:18px;max-height:76vh}
.dc-root .dc-preview-bottom{padding:12px 18px;background:#fff;border-top:1px solid #e0e9ed;display:flex;justify-content:space-between;color:#567082;font-size:11px;font-weight:700}
/* الأنماط التالية مشتركة بين معاينة A4 ونافذة طباعتها فقط */
.dc-pages{display:grid;gap:16px;justify-content:center;direction:rtl}
.dc-page{width:210mm;height:297mm;box-sizing:border-box;padding:var(--dc-margin,9mm);display:flex;flex-direction:column;direction:rtl;background:#fff;color:#121820;border:1px solid #d5dce0;box-shadow:0 7px 22px #16334a24;font-family:Cairo,Tahoma,Arial,sans-serif;font-size:var(--dc-font,10pt);page-break-after:always;break-after:page;overflow:hidden}
.dc-sheet-header{padding-bottom:3mm;margin-bottom:3mm;border-bottom:1px solid #333;flex:none}
.dc-sheet-heading{display:grid;grid-template-columns:1fr 1.6fr 1fr;align-items:center;gap:2mm;min-height:19mm}
.dc-sheet-slot{font-weight:750;min-width:0;overflow-wrap:anywhere}
.dc-slot-right{text-align:right}
.dc-slot-center{text-align:center;font-weight:900;font-size:1.3em}
.dc-slot-left{text-align:left}
.dc-logo{height:18mm;max-width:90%;object-fit:contain}
.dc-sheet-extra{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2mm 6mm;padding:1mm 0;font-weight:700;font-size:.95em}
.dc-paper-body{flex:1;min-height:0;width:100%}
.dc-data-columns{display:grid;gap:5mm;align-items:start}
.dc-sheet-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:var(--dc-font,10pt);direction:rtl;color:#1b2430}
.dc-sheet-table th,.dc-sheet-table td{border:.3mm solid #666;padding:1mm .8mm;text-align:center;overflow-wrap:anywhere;word-break:break-word;line-height:1.25;height:var(--dc-row-height,7mm);vertical-align:middle}
.dc-sheet-table th{background:#e9f1f2;font-weight:900;line-height:1.3}
.dc-sheet-table td{font-size:.92em}
.dc-sheet-table tr{break-inside:avoid;page-break-inside:avoid}
.dc-sheet-footer{flex:none;display:grid;gap:1mm;border-top:1px solid #bbb;padding-top:2mm;margin-top:3mm;text-align:center}
.dc-signatures{display:flex;justify-content:space-around;gap:3mm;text-align:center;font-weight:800;font-size:.9em}
.dc-signatures>div{flex:1}
.dc-sign-space{height:8mm}
.dc-footer-note{font-size:.85em}
.dc-page-number{font-size:.75em;color:#3d444b}
.dc-print-only{margin:0!important;padding:0!important;background:white!important}
.dc-print-only .dc-pages{gap:0;display:block}
.dc-print-only .dc-page{margin:0;box-shadow:none;border:0}
@media print{.dc-print-only{margin:0!important;padding:0!important}.dc-print-only .dc-page{box-shadow:none!important;border:0!important;margin:0!important;break-after:page;page-break-after:always}.dc-print-only .dc-page:last-child{break-after:auto;page-break-after:auto}.dc-print-only .dc-pages{display:block}}
@media (max-width:1380px){.dc-root .dc-workspace{grid-template-columns:minmax(280px,350px) minmax(0,1fr)}.dc-root .dc-scroll{padding:10px}}
@media (max-width:1030px){.dc-root .dc-workspace{grid-template-columns:1fr}.dc-root .dc-editor{order:1}.dc-root .dc-preview{order:2}.dc-root .dc-scroll{max-height:90vh}.dc-root .dc-hero-stats>div{min-width:75px}}
@media (max-width:720px){.dc-root .dc-hero{padding:16px}.dc-root .dc-hero h1{font-size:21px}.dc-root .dc-toolbar{padding:10px}.dc-root .dc-scroll{padding:8px}.dc-root .dc-page{zoom:.66}.dc-root .dc-preview-head{padding:10px}.dc-root .dc-filters-screen{padding:10px}}

/* الجداول المرتبطة داخل مركز التصميم فقط */
.dc-root .dc-linked-tables{display:grid;gap:9px}
.dc-root .dc-linked-item{display:flex;justify-content:space-between;align-items:center;gap:8px;background:#fff;border:1px solid #d4e6eb;border-radius:10px;padding:9px 11px;font-size:12px}
.dc-root .dc-linked-item strong{color:#155d67}

/* إضافات V3 المعزولة: روابط القوالب، أعمدة فارغة، هيدر متعدد الحقول */
.dc-root .dc-report-links{padding:12px 16px;margin:0 0 13px;background:#fff;border:1px solid #dce6ed;border-radius:14px}
.dc-root .dc-report-links h3{font-size:14px;color:#18566b;margin:0 0 10px}
.dc-root .dc-saved-list{display:flex;flex-wrap:wrap;gap:8px;max-height:170px;overflow:auto}
.dc-root .dc-saved-link{font-size:12px;font-weight:800;text-decoration:none;border:1px solid #cbdfe4;background:#f4fafb;color:#146272;border-radius:9px;padding:7px 11px}
.dc-root .dc-saved-link.active{background:#146c79;color:white}
.dc-root .dc-empty-tag{display:block;font-size:9px;font-weight:700;color:#687a86}
.dc-root .dc-header-sides{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.dc-root .dc-header-side-editor{padding:10px;background:white;border:1px solid #e3ebf0;border-radius:10px;display:grid;gap:8px;align-content:start}
.dc-sheet-slot .dc-slot-stacked{font-weight:700;font-size:.86em;line-height:1.45;margin-top:1.2mm;overflow-wrap:anywhere}
@media(max-width:570px){.dc-root .dc-header-sides{grid-template-columns:1fr}}
