/**
 * نبراس — حوكمة الفروع · لوحة الإدارة الرئيسية · لوحة الفرع
 */

.nebras-hq-branch-empire-modal,
.nebras-branch-command-modal {
    max-width: min(96vw, 1180px) !important;
    overflow: hidden;
}

.nb-panel-hero {
    margin: 0 24px 16px;
    padding: 18px 20px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.nb-panel-hero--hq {
    background: linear-gradient(125deg, #071525 0%, #0d2840 45%, #134e6f 100%);
    border: 1px solid rgba(56, 189, 248, 0.28);
}
.nb-panel-hero--branch {
    background: linear-gradient(125deg, #0a3d2e 0%, #0d2840 50%, #155e94 100%);
    border: 1px solid rgba(27, 158, 87, 0.35);
}
.nb-panel-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 15%, rgba(201, 162, 39, 0.3), transparent 55%);
    pointer-events: none;
}
.nb-panel-hero-inner { position: relative; z-index: 1; }
.nb-panel-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 8px;
}
.nb-panel-hero h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
}
.nb-panel-hero p {
    margin: 0;
    font-size: 0.86rem;
    opacity: 0.9;
    line-height: 1.65;
    max-width: 720px;
}

.hq-branch-empire-intro {
    margin: 0 24px 16px;
    padding: 14px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 40, 64, 0.04), rgba(201, 162, 39, 0.1));
    border: 1px solid rgba(21, 94, 148, 0.14);
    font-size: 0.92rem;
    line-height: 1.7;
    color: #2c3e50;
}
.hq-branch-empire-intro i { color: #c9a227; margin-inline-end: 6px; }

.hq-branch-empire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
    padding: 4px 24px 24px;
}

.hq-branch-empire-card {
    border: 1px solid rgba(13, 40, 64, 0.1);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
    padding: 0;
    box-shadow: 0 12px 32px rgba(7, 21, 37, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
}
.hq-branch-empire-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(21, 94, 148, 0.14);
}
.hq-branch-empire-card-accent {
    height: 5px;
    background: linear-gradient(90deg, #c9a227, #155e94, #38bdf8);
}
.hq-branch-empire-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hq-branch-empire-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.hq-branch-empire-card-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0d2840;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hq-branch-empire-card-head h3 i { color: #155e94; }
.hq-branch-empire-card-head small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.76rem;
}
.hq-branch-team-pill {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(27, 158, 87, 0.12);
    color: #0d5c36;
    border: 1px solid rgba(27, 158, 87, 0.25);
    white-space: nowrap;
}

.hq-branch-managers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hq-branch-mgr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 600;
    background: #f1f6fb;
    border: 1px solid #dce8f2;
    color: #1a5276;
}
.hq-branch-mgr-badge--empty {
    opacity: 0.55;
    font-style: italic;
    background: #fafbfc;
    border-style: dashed;
}
.hq-branch-mgr-badge i { color: #155e94; font-size: 0.85rem; }

.hq-branch-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.hq-branch-kpi {
    text-align: center;
    padding: 10px 6px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f0f6fc);
    border: 1px solid #e2ebf3;
    transition: border-color 0.2s;
}
.hq-branch-kpi:hover { border-color: rgba(56, 189, 248, 0.45); }
.hq-branch-kpi strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0d2840;
}
.hq-branch-kpi span {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.hq-branch-gov-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.hq-branch-gov-btns button {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #cfd9e6;
    background: #fff;
    cursor: pointer;
    color: #1a5276;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.hq-branch-gov-btns button:hover {
    border-color: #155e94;
    background: #f0f7ff;
    color: #0d2840;
}
.hq-branch-gov-btns button.is-primary {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #155e94, #0d2840);
    color: #fff;
    border-color: #0d2840;
    box-shadow: 0 8px 20px rgba(13, 40, 64, 0.2);
}
.hq-branch-gov-btns button.is-primary:hover {
    filter: brightness(1.06);
}

.branch-command-note {
    margin: 0 24px 14px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(27, 158, 87, 0.08);
    border: 1px solid rgba(27, 158, 87, 0.2);
    color: #1a5276;
    font-size: 0.86rem;
    line-height: 1.6;
}
.branch-command-note i { color: #1b9e57; margin-inline-end: 6px; }

.branch-command-hr-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 0 24px 12px;
    padding: 0;
}
.branch-command-hr-strip .erp-stat { margin: 0; min-width: 0; }

.branch-command-feed-wrap {
    margin: 0 24px 20px;
    padding: 14px;
    border-radius: 16px;
    background: #f8fbfe;
    border: 1px solid #e2ebf3;
}

@media (max-width: 640px) {
    .hq-branch-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .hq-branch-gov-btns { grid-template-columns: 1fr; }
    .hq-branch-empire-grid { grid-template-columns: 1fr; padding-inline: 16px; }
}

.nebras-branch-gov-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
}
.nebras-branch-gov-strip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(21, 94, 148, 0.08);
    border: 1px solid rgba(21, 94, 148, 0.15);
    color: #1a5276;
}
.nebras-branch-gov-strip span i { color: #155e94; }
