/* ============================================
   نظام التصميم - لوحة تحكم تعليمية Enterprise
   ============================================ */

:root {
  /* الألوان الأساسية - ميل نحو #2e1140 */
  --brand-900: #1f0b2e;
  --brand-800: #2e1140;
  --brand-700: #3d1857;
  --brand-600: #5b2483;
  --brand-500: #7c3aed;
  --brand-400: #9d6df0;
  --brand-300: #c4a7f5;
  --brand-100: #ede4fb;
  --brand-50: #f7f3fd;

  /* لون مميز ذهبي للفخامة */
  --gold-500: #d4a13b;
  --gold-400: #e0b862;

  /* محايدات */
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fafafd;
  --border: #e7e6f0;
  --text: #1c1830;
  --text-muted: #6c6880;
  --text-soft: #9a97ac;

  /* دلالات */
  --success: #16a34a;
  --success-bg: #e7f7ee;
  --warning: #d97706;
  --warning-bg: #fdf3e3;
  --danger: #dc2626;
  --danger-bg: #fdeaea;
  --info: #2563eb;
  --info-bg: #e8f0fe;

  /* أبعاد */
  --sidebar-w: 288px;
  --sidebar-w-collapsed: 84px;
  --topbar-h: 72px;
  --radius: 16px;
  --radius-sm: 10px;

  /* ظلال */
  --shadow-sm: 0 1px 2px rgba(31, 11, 46, 0.06);
  --shadow-md: 0 6px 20px rgba(31, 11, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(31, 11, 46, 0.12);
  --shadow-brand: 0 10px 30px rgba(46, 17, 64, 0.35);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
}

body {
  font-family: "Cairo", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

svg {
  flex-shrink: 0;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--brand-300);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-400);
}

input,
textarea,
select,
button {
  font-family: "Cairo", system-ui, -apple-system, sans-serif;
}

/* Unified premium chevron for every dropdown */
.unit-combo-trigger > b,
.file-combo-trigger > b,
.library-combo-trigger > b,
.permission-combo-trigger > b,
.multi-picker-trigger > b,
.course-combo-trigger > b,
.subject-trigger > b,
.select-shell > span,
.course-select-shell > span,
.video-select-wrap > i {
  position: relative;
  width: 31px !important;
  min-width: 31px;
  height: 31px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(101, 37, 142, .1);
  border-radius: 9px !important;
  color: transparent !important;
  background: linear-gradient(145deg, #f4eafb, #eadcf5) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 3px 8px rgba(79, 28, 107, .08);
  font-size: 0 !important;
  line-height: 0;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease !important;
}

.unit-combo-trigger > b::before,
.unit-combo-trigger > b::after,
.file-combo-trigger > b::before,
.file-combo-trigger > b::after,
.library-combo-trigger > b::before,
.library-combo-trigger > b::after,
.permission-combo-trigger > b::before,
.permission-combo-trigger > b::after,
.multi-picker-trigger > b::before,
.multi-picker-trigger > b::after,
.course-combo-trigger > b::before,
.course-combo-trigger > b::after,
.subject-trigger > b::before,
.subject-trigger > b::after,
.select-shell > span::before,
.select-shell > span::after,
.course-select-shell > span::before,
.course-select-shell > span::after,
.video-select-wrap > i::before,
.video-select-wrap > i::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 7px;
  height: 2px;
  border-radius: 3px;
  background: #64258d;
  transition: background .22s ease;
}

.unit-combo-trigger > b::before,
.file-combo-trigger > b::before,
.library-combo-trigger > b::before,
.permission-combo-trigger > b::before,
.multi-picker-trigger > b::before,
.course-combo-trigger > b::before,
.subject-trigger > b::before,
.select-shell > span::before,
.course-select-shell > span::before,
.video-select-wrap > i::before {
  right: 9px;
  transform: rotate(-45deg);
}

.unit-combo-trigger > b::after,
.file-combo-trigger > b::after,
.library-combo-trigger > b::after,
.permission-combo-trigger > b::after,
.multi-picker-trigger > b::after,
.course-combo-trigger > b::after,
.subject-trigger > b::after,
.select-shell > span::after,
.course-select-shell > span::after,
.video-select-wrap > i::after {
  left: 9px;
  transform: rotate(45deg);
}

.unit-combo-trigger[aria-expanded="true"] > b,
.file-combo-trigger[aria-expanded="true"] > b,
.library-combo-trigger[aria-expanded="true"] > b,
.permission-combo-trigger[aria-expanded="true"] > b,
.multi-picker-trigger[aria-expanded="true"] > b,
.course-combo-trigger[aria-expanded="true"] > b,
.subject-trigger[aria-expanded="true"] > b {
  transform: rotate(180deg) !important;
  border-color: transparent;
  background: linear-gradient(145deg, #71339a, #54206f) !important;
  box-shadow: 0 6px 14px rgba(84, 32, 111, .22);
}

.unit-combo-trigger[aria-expanded="true"] > b::before,
.unit-combo-trigger[aria-expanded="true"] > b::after,
.file-combo-trigger[aria-expanded="true"] > b::before,
.file-combo-trigger[aria-expanded="true"] > b::after,
.library-combo-trigger[aria-expanded="true"] > b::before,
.library-combo-trigger[aria-expanded="true"] > b::after,
.permission-combo-trigger[aria-expanded="true"] > b::before,
.permission-combo-trigger[aria-expanded="true"] > b::after,
.multi-picker-trigger[aria-expanded="true"] > b::before,
.multi-picker-trigger[aria-expanded="true"] > b::after,
.course-combo-trigger[aria-expanded="true"] > b::before,
.course-combo-trigger[aria-expanded="true"] > b::after,
.subject-trigger[aria-expanded="true"] > b::before,
.subject-trigger[aria-expanded="true"] > b::after {
  background: #fff;
}

.unit-combo-trigger:disabled > b,
.file-combo-trigger:disabled > b,
.library-combo-trigger:disabled > b,
.permission-combo-trigger:disabled > b,
.multi-picker-trigger:disabled > b,
.course-combo-trigger:disabled > b,
.subject-trigger:disabled > b {
  opacity: .58;
  box-shadow: none;
}

/* Polished guidance icon used by empty/select-first table states */
.table-state .state-icon,
.contents-state .contents-state-icon {
  position: relative;
  width: 50px !important;
  height: 50px !important;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(101, 37, 142, .1);
  border-radius: 15px !important;
  color: transparent !important;
  background: linear-gradient(145deg, #f5ecfb, #eadbf5) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(78, 28, 106, .1);
  font-size: 0 !important;
}

.table-state .state-icon::before,
.contents-state .contents-state-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  background: linear-gradient(145deg, #8145a8, #4d176f);
  transform: translate(-50%, -50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='6'/%3E%3Cpath d='M12 2v7M9.5 9h5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='6'/%3E%3Cpath d='M12 2v7M9.5 9h5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

