/* Entry experience (login + complex picker) — the new purple/Tajawal theme,
   intentionally separate from the inner admin styles. */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
body.entry {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background: #F4F4F9;
  color: #2A2C3A;
  min-height: 100vh;
}
.entry a { text-decoration: none; color: inherit; }

/* ---------- Hub ---------- */
.hub { min-height: 100vh; display: flex; flex-direction: column; background: #F6F7FC; }

.hub-top { background: #fff; border-bottom: 1px solid #ECECF3; }
.hub-top-in {
  max-width: 1320px; margin: 0 auto; height: 78px;
  display: flex; align-items: center; gap: 22px; padding: 0 34px;
}
.hub-brand { display: flex; align-items: center; gap: 11px; flex: 1; }
.hub-brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #6C5CE7, #8B7BF0);
  display: flex; align-items: center; justify-content: center;
}
.hub-brand .b-name { font-size: 16.5px; font-weight: 800; }
.hub-brand .b-sub { font-size: 10.5px; color: #9A9CB0; letter-spacing: 1px; }
.hub-user { display: flex; align-items: center; gap: 10px; }
.hub-user .u-name { font-size: 13.5px; font-weight: 700; }
.hub-user .u-role { font-size: 11px; color: #9A9CB0; }
.hub-user .u-meta { text-align: left; }
.hub-user .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #6C5CE7, #8B7BF0);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.logout-pill {
  padding: 9px 16px; border-radius: 10px; border: none;
  background: rgba(186, 26, 26, 0.10); color: #BA1A1A;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .18s;
}
.logout-pill:hover { background: #BA1A1A; color: #fff; }
.hub-ico {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center;
  justify-content: center; background: transparent; transition: background .14s;
}
.hub-ico:hover { background: #F1F0FB; }
.u-divider { width: 1px; height: 36px; background: #ECECF3; margin: 0 8px; }

.hub-main {
  flex: 1; max-width: 1320px; margin: 0 auto; width: 100%;
  padding: 52px 34px; display: flex; flex-direction: column; justify-content: center;
}
.hub-welcome { text-align: center; margin-bottom: 48px; }
.hub-welcome h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.hub-welcome p { font-size: 17px; color: #8A8DA0; margin-top: 12px; }
.hub-welcome .rule { width: 96px; height: 4px; background: #6C5CE7; border-radius: 30px; margin: 22px auto 0; }

.hub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
@media (max-width: 1080px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hub-grid { grid-template-columns: 1fr; } }

.ccard {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #fff; border: 1px solid #ECECF3; border-radius: 20px; padding: 34px 24px 26px;
  cursor: pointer; transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s, border-color .22s;
}
.ccard:hover { transform: translateY(-8px); box-shadow: 0 22px 48px rgba(40,30,90,0.15); border-color: #C9C0F5; }
.ccard .badge {
  position: absolute; top: 16px; left: 16px; background: #6C5CE7; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; padding: 4px 10px; border-radius: 30px;
}
.ccard .emblem {
  width: 96px; height: 96px; border-radius: 27px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px rgba(40,30,90,0.18); transition: transform .3s ease;
}
.ccard:hover .emblem { transform: scale(1.06); }
.ccard .emblem-img { background: #fff; overflow: hidden; }
.ccard .emblem-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ccard h3 { font-size: 17px; font-weight: 800; margin-top: 22px; line-height: 1.5; }
.ccard .desc { font-size: 13px; color: #9A9CB0; margin-top: 10px; line-height: 1.7; min-height: 44px; }
.ccard .enter {
  margin-top: 22px; width: 100%; padding: 13px; border-radius: 12px;
  font-size: 13.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s; background: #F1F0FB; color: #6C5CE7;
}
.ccard.premium .enter { background: #6C5CE7; color: #fff; box-shadow: 0 10px 22px rgba(108,92,231,0.30); }
.ccard:hover .enter { background: #6C5CE7; color: #fff; box-shadow: 0 10px 22px rgba(108,92,231,0.30); }

.hub-foot {
  margin-top: 50px; display: flex; flex-wrap: wrap; justify-content: center; gap: 26px;
  align-items: center; color: #A2A5B5; font-size: 13px;
}
.hub-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: #2FA37C; display: inline-block; margin-inline-end: 8px; }
.hub-foot .sep { width: 1px; height: 16px; background: #DEDEE8; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px;
  background: radial-gradient(circle at 30% 15%, #ECEAFB, #F4F4F9 60%);
}
.login-card {
  display: flex; width: 880px; max-width: 100%; min-height: 520px; background: #fff;
  border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(40,30,90,0.18);
}
.login-hero {
  flex: 1; position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 36px; color: #fff;
  background: linear-gradient(160deg, #3A2E76, #120E1C);
}
.login-hero .brand { display: flex; align-items: center; gap: 12px; }
.login-hero .brand .logo {
  width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #6C5CE7, #8B7BF0);
  display: flex; align-items: center; justify-content: center;
}
.login-hero .pitch h2 { font-size: 23px; font-weight: 800; line-height: 1.45; }
.login-hero .pitch p { font-size: 13.5px; opacity: .82; margin-top: 12px; line-height: 1.8; }
.login-form { flex: 1; padding: 52px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h1 { font-size: 24px; font-weight: 800; }
.login-form .hint { font-size: 13.5px; color: #9A9CB0; margin-top: 6px; }
.login-form label { font-size: 13px; font-weight: 700; color: #5A5C70; display: block; margin: 18px 0 7px; }
.login-form input {
  width: 100%; border: 1px solid #E4E4EE; border-radius: 11px; padding: 13px 14px;
  font: inherit; font-size: 14px; color: #2A2C3A; background: #fff;
}
.login-form input:focus { outline: none; border-color: #6C5CE7; box-shadow: 0 0 0 3px rgba(108,92,231,0.12); }
.login-form .submit {
  margin-top: 24px; width: 100%; background: linear-gradient(135deg, #6C5CE7, #8674F0); color: #fff;
  border: none; border-radius: 11px; padding: 14px; font: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; box-shadow: 0 8px 20px rgba(108,92,231,0.30);
}
.login-form .err {
  margin-top: 16px; background: #FDECEC; color: #BA1A1A; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
}
@media (max-width: 680px) { .login-hero { display: none; } }

/* ---------- Settings ---------- */
/* ERP-style two-pane layout: left tab rail + right content panes. */
.set-shell { max-width: 1140px; margin: 0 auto; width: 100%; padding: 34px 28px 60px; display: flex; gap: 26px; align-items: flex-start; }
.set-rail { width: 256px; flex: none; position: sticky; top: 22px; background: #fff; border: 1px solid #ECECF3; border-radius: 18px; padding: 16px 13px; box-shadow: 0 1px 3px rgba(40,40,80,0.05); display: flex; flex-direction: column; gap: 5px; }
.set-prof { display: flex; align-items: center; gap: 12px; padding: 6px 8px 15px; border-bottom: 1px solid #F1F1F7; margin-bottom: 9px; }
.set-prof .av { width: 46px; height: 46px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, #6C5CE7, #8B7BF0); }
.set-prof .nm { font-size: 14.5px; font-weight: 800; line-height: 1.3; word-break: break-word; }
.set-prof .rl { font-size: 11.5px; color: #9A9CB0; margin-top: 2px; }
.set-tab { display: flex; align-items: center; gap: 11px; width: 100%; text-align: right; border: none; background: none; border-radius: 11px; padding: 11px 13px; font: inherit; font-size: 14px; font-weight: 700; color: #5A5C70; cursor: pointer; transition: background .15s, color .15s; }
.set-tab:hover { background: #F6F6FB; color: #2A2C3A; }
.set-tab.active { background: #F1F0FB; color: #5B57E0; }
.set-tab svg { flex: none; opacity: .9; }
.set-content { flex: 1; min-width: 0; }
.set-pane { display: none; }
.set-pane.active { display: block; animation: setfade .22s ease; }
@keyframes setfade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.set-pane-head { margin-bottom: 18px; }
.set-pane-head h1 { font-size: 23px; font-weight: 800; }
.set-pane-head p { font-size: 14px; color: #8A8DA0; margin-top: 5px; }
@media (max-width: 860px) {
  .set-shell { flex-direction: column; padding: 22px 16px 50px; gap: 18px; }
  .set-rail { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .set-prof { width: 100%; border-bottom: 1px solid #F1F1F7; }
  .set-tab { width: auto; flex: 1 1 auto; justify-content: center; }
}
.set-main { flex: 1; max-width: 820px; margin: 0 auto; width: 100%; padding: 40px 28px 60px; }
.set-head { margin-bottom: 26px; }
.set-head h1 { font-size: 27px; font-weight: 800; }
.set-head p { font-size: 15px; color: #8A8DA0; margin-top: 6px; }
.set-card {
  background: #fff; border: 1px solid #ECECF3; border-radius: 18px; padding: 26px 28px;
  margin-bottom: 22px; box-shadow: 0 1px 3px rgba(40,40,80,0.05);
}
.set-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.set-card .sub { font-size: 13px; color: #9A9CB0; margin-bottom: 18px; }
.set-field { margin-bottom: 16px; }
.set-field label { display: block; font-size: 13px; font-weight: 700; color: #5A5C70; margin-bottom: 7px; }
.set-field input {
  width: 100%; border: 1px solid #E4E4EE; border-radius: 11px; padding: 12px 14px;
  font: inherit; font-size: 14px; color: #2A2C3A; background: #fff;
}
.set-field input:focus { outline: none; border-color: #6C5CE7; box-shadow: 0 0 0 3px rgba(108,92,231,0.12); }
.set-submit {
  margin-top: 6px; background: linear-gradient(135deg, #6C5CE7, #8674F0); color: #fff; border: none;
  border-radius: 11px; padding: 13px 26px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(108,92,231,0.26);
}
.set-note { border-radius: 10px; padding: 11px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.set-note.ok { background: #E6F6EF; color: #1F8A5B; }
.set-note.err { background: #FDECEC; color: #BA1A1A; }
.set-info { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.set-info .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #F1F1F7; padding-bottom: 10px; }
.set-info .k { font-size: 13.5px; color: #9A9CB0; }
.set-info .v { font-size: 13.5px; font-weight: 700; }
.set-complexes { display: flex; flex-direction: column; gap: 10px; }
.set-cx { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #F0F0F6; border-radius: 12px; }
.set-cx .emblem { width: 34px; height: 34px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; }
.set-cx .nm { font-size: 13.5px; font-weight: 700; }
.set-cx .badge { margin-inline-start: auto; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #6C5CE7; background: #EFEDFB; padding: 3px 9px; border-radius: 20px; }

.cx-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cx-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: #2A2C3A; cursor: pointer; }
.cx-check input { width: 16px; height: 16px; accent-color: #6C5CE7; }
.user-row { border: 1px solid #F0F0F6; border-radius: 12px; padding: 14px 16px; }
.user-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-head .user-name { font-size: 14.5px; font-weight: 800; }
.user-head .badge { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #6C5CE7; background: #EFEDFB; padding: 3px 9px; border-radius: 20px; }
.user-del { margin-inline-start: auto; }
.del-btn { background: rgba(186,26,26,0.10); color: #BA1A1A; border: none; border-radius: 9px; padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.del-btn:hover { background: #BA1A1A; color: #fff; }
.user-perm { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.perm-save { background: #F1F0FB; color: #6C5CE7; border: none; border-radius: 9px; padding: 8px 16px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.perm-save:hover { background: #6C5CE7; color: #fff; }
.user-cx.muted { font-size: 13px; color: #9A9CB0; }

/* ----- Redesigned user management (matches the approved screenshot) ----- */
.users-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ustats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.ustat { display: flex; align-items: center; gap: 12px; background: #FAFAFE; border: 1px solid #F0F0F6; border-radius: 14px; padding: 16px; }
.ustat .ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; }
.ustat .v { font-size: 22px; font-weight: 800; line-height: 1; }
.ustat .k { font-size: 12.5px; color: #9A9CB0; margin-top: 5px; }
.create-form { background: #FAFAFE; border: 1px solid #ECECF3; border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; }
.cf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.user-search { width: 100%; border: 1px solid #ECECF3; border-radius: 12px; padding: 11px 15px; font: inherit; font-size: 13.5px; margin-bottom: 14px; }
.user-search:focus { outline: none; border-color: #6C5CE7; box-shadow: 0 0 0 3px rgba(108,92,231,0.12); }
.utable-wrap { overflow-x: auto; border: 1px solid #F0F0F6; border-radius: 14px; }
.utable { width: 100%; border-collapse: collapse; }
.utable thead th { background: #F5F5FB; text-align: right; font-size: 12.5px; font-weight: 700; color: #6C5CE7; padding: 13px 16px; white-space: nowrap; }
.utable tbody td { padding: 13px 16px; font-size: 13.5px; border-top: 1px solid #F1F1F7; }
.ucell { display: flex; align-items: center; gap: 11px; }
.uavatar { width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #6C5CE7, #8B7BF0); }
.uname { font-weight: 700; }
.role-badge { font-size: 12px; font-weight: 700; color: #5A5C70; background: #F1F0FB; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.role-badge.admin { color: #5B57E0; background: #E9E8FB; }
.ucx { color: #6A6C80; }
.ustatus { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #2FA37C; }
.ustatus .dot { width: 8px; height: 8px; border-radius: 50%; background: #2FA37C; }
.uactions { display: flex; gap: 8px; align-items: center; }
.iconbtn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid #ECECF3; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.iconbtn:hover { background: #F8F8FC; }
.iconbtn.del:hover { background: #FDECEC; border-color: #F5C6C6; }
.perm-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #FAFAFE; border-radius: 10px; padding: 12px 14px; }
.perm-edit .pe-label { font-size: 13px; font-weight: 700; color: #5A5C70; }
.utable-foot { font-size: 12.5px; color: #9A9CB0; margin-top: 12px; }
@media (max-width: 620px) { .ustats { grid-template-columns: 1fr; } .cf-row { grid-template-columns: 1fr; } }
