/* الهيكل الجديد: صفحة الدخول، الشريط الجانبي، والرئيسية */

/* ---------- صفحة الدخول ---------- */
.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(460px, 100%); text-align: center; padding: 32px 28px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(20,26,36,.95), rgba(12,16,23,.95));
  border: 1px solid rgba(96,165,250,.18); box-shadow: 0 30px 80px -40px rgba(59,130,246,.55);
}
.login-logo { width: 84px; height: 84px; object-fit: contain; border-radius: 18px; margin-bottom: 10px; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-sub { color: var(--muted, #94a3b8); margin: 0 0 18px; font-size: 14px; line-height: 1.7; }
.login-foot { color: var(--muted, #94a3b8); font-size: 12px; margin: 14px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.2); }
.btn.big { padding: 12px 22px; font-size: 15px; width: 100%; justify-content: center; }
.btn.ghost { background: transparent; }

/* ---------- الشريط الجانبي ---------- */
.sb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 4px 12px; letter-spacing: .5px; }
.logo-mini { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(96,165,250,.14); }
.home-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; margin-bottom: 8px; }
.home-link.on { background: rgba(96,165,250,.14); }
.grp { margin-top: 10px; }
.grp h3, .sub-h { font-size: 11px; letter-spacing: .3px; color: var(--muted, #94a3b8); margin: 10px 4px 6px; font-weight: 600; display: flex; justify-content: space-between; }
.grp .count { background: rgba(255,255,255,.06); border-radius: 6px; padding: 0 6px; }
.srv-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: 13px; }
.srv-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-link.on { background: rgba(96,165,250,.14); }
.srv-link .role-mini { font-size: 10px; color: var(--muted, #94a3b8); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #64748b; flex: none; }
.dot.ok { background: #34d399; } .dot.warn { background: #fbbf24; }

/* ---------- الهيدر ---------- */
.avatar { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #818cf8); color: #fff; font-weight: 700; font-size: 12px; }
#userbox { display: flex; align-items: center; gap: 8px; }
#userbox .who { display: flex; flex-direction: column; line-height: 1.2; }
#userbox .who small { color: var(--muted, #94a3b8); font-size: 11px; }

/* ---------- الرئيسية ---------- */
.home { display: grid; gap: 18px; }
.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; border-radius: 16px; background: linear-gradient(120deg, rgba(59,130,246,.14), rgba(129,140,248,.06));
  border: 1px solid rgba(96,165,250,.16);
}
.hero-title { margin: 8px 0 4px; font-size: 24px; }
.hero-sub { margin: 0; color: var(--muted, #94a3b8); }
.home-banner { width: 150px; height: 88px; object-fit: cover; border-radius: 12px; opacity: .9; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-big { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); }
.stat-big .stat-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(96,165,250,.12); }
.stat-big span { display: block; font-size: 12px; color: var(--muted, #94a3b8); }
.stat-big b { font-size: 20px; }
.stat-big.ok b { color: #34d399; } .stat-big.warn b { color: #fbbf24; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 220px; min-width: 180px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: inherit; font: inherit; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.seg button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: rgba(96,165,250,.22); }

.sec-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.sec-head h2 { font-size: 16px; margin: 0; }
.role-group { margin-bottom: 14px; }
.role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.role-head small { color: var(--muted, #94a3b8); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.srv-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); color: inherit; text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
.srv-card:hover { border-color: rgba(96,165,250,.45); background: rgba(96,165,250,.06); }
.srv-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.srv-top img, .srv-top .ico { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: rgba(255,255,255,.05); flex: none; }
.srv-meta { min-width: 0; }
.srv-meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-meta small { color: var(--muted, #94a3b8); }
.srv-bottom { display: flex; justify-content: space-between; align-items: center; }
.srv-card .open { font-size: 12px; color: #93c5fd; }

.tips { padding: 16px 18px; border-radius: 14px; background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.18); }
.tips h3 { margin: 0 0 6px; font-size: 14px; }
.tips p { margin: 0; color: var(--muted, #94a3b8); font-size: 13px; }

@media (prefers-reduced-motion: reduce) { .srv-card { transition: none; } }
