/* Irsyad Digital — Emerald Ivory Theme v1.0.20 */
/* Poppins + Scheherazade + Tabler Icons diload melalui WordPress enqueue */

/* ── Pembolehubah Warna ───────────────────────────────── */
:root {
  /* Emerald */
  --em-dark:#0E4D3A; --em-mid:#0F5B46; --em-light:#1A7A5E;
  --em-faint:rgba(15,91,70,0.08); --em-border:rgba(15,91,70,0.2);

  /* Gold / Amber */
  --gold:#D4AF37; --gold-mid:#D4AF37; --gold-light:#FBF8EE;
  --gold-border:#E8D58A; --gold-faint:rgba(212,175,55,0.12);

  /* Ivory / Surface */
  --ivory:#F8F5EE; --ivory2:#F0EDE4; --ivory3:#E8E4D8;
  --white:#FFFFFF;

  /* Ink */
  --ink:#1A1F1C; --ink2:#2D3530; --muted:#7A8580;

  /* Sempadan */
  --border:#DDD8CC; --border2:#C8C3B5;

  /* Semantik */
  --red:#DC2626; --red-bg:#FEF2F2;
  --green:#15803D; --green-bg:#F0FDF4; --green-mid:#16A34A;
  --amber:#B45309; --amber-bg:#FFFBEB;
  --blue:#1D4ED8; --blue-bg:#EFF6FF;

  /* Tipografi */
  --font:'Poppins',sans-serif;
  --font-ar:'Scheherazade New',serif;

  /* Bentuk */
  --radius:8px; --radius-lg:14px; --radius-xl:20px;
  --transition:all 0.18s ease;
}

/* ── Mod Gelap (Dark Emerald — ikut rekabentuk) ─────────── */
.irsyad-dark {
  /* Background gelap hijau seperti gambar rujukan */
  --ivory:#0F1412;    /* content area — hampir hitam hijau */
  --ivory2:#141C18;   /* panel input */
  --ivory3:#1A2420;   /* hover state */
  --white:#192018;    /* kad/panel */

  /* Teks */
  --ink:#E8EDE8; --ink2:#B8C4BC; --muted:#6A8070;

  /* Sempadan */
  --border:#263028; --border2:#304038;

  /* Gold — kekal terang supaya nampak */
  --gold:#D4AF37; --gold-mid:#D4AF37;
  --gold-light:#1C2418; --gold-border:#5A4A10;
  --gold-faint:rgba(212,175,55,0.1);

  /* Emerald — lebih terang dalam dark */
  --em-faint:rgba(15,91,70,0.2); --em-border:rgba(15,91,70,0.35);
}

/* ── Asas ─────────────────────────────────────────────── */
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:var(--font); }

#irsyad-app {
  display:flex; height:100vh;
  border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; background:var(--ivory);
  font-family:var(--font); color:var(--ink);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR — Emerald
══════════════════════════════════════════════════════════ */
.ir-sidebar {
  width:240px; flex-shrink:0;
  background:var(--em-mid);
  display:flex; flex-direction:column;
  position:relative; overflow:hidden;
}

/* Motif geometri Islam di bahagian bawah sidebar */
.ir-sidebar::after {
  content:'';
  position:absolute;
  bottom:0; left:0; right:0;
  height:180px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='0.8'%3E%3Cpolygon points='30,2 57,17 57,43 30,58 3,43 3,17'/%3E%3Cpolygon points='30,10 51,22 51,38 30,50 9,38 9,22'/%3E%3Cpolygon points='30,18 45,27 45,33 30,42 15,33 15,27'/%3E%3Cline x1='30' y1='2' x2='30' y2='18'/%3E%3Cline x1='57' y1='17' x2='45' y2='27'/%3E%3Cline x1='57' y1='43' x2='45' y2='33'/%3E%3Cline x1='30' y1='58' x2='30' y2='42'/%3E%3Cline x1='3' y1='43' x2='15' y2='33'/%3E%3Cline x1='3' y1='17' x2='15' y2='27'/%3E%3C/g%3E%3C/svg%3E");
  background-size:60px 60px;
  opacity:1;
  pointer-events:none;
  mask-image:linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  -webkit-mask-image:linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index:0;
}

/* Logo bahagian atas */
.ir-logo {
  padding:20px 18px 16px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  position:relative; z-index:1;
  display:flex; flex-direction:column; align-items:center;
  text-align:center;
}
.ir-logo-img {
  width:52px; height:52px; object-fit:contain;
  margin-bottom:10px;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.ir-logo-img-placeholder {
  width:52px; height:52px; border-radius:50%;
  background:rgba(212,175,55,0.15);
  border:1.5px solid rgba(212,175,55,0.3);
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 10px; font-size:20px; color:var(--gold);
}
.ir-logo-ar {
  font-family:var(--font-ar); font-size:20px;
  color:var(--gold); line-height:1.3; margin-bottom:3px;
}
.ir-logo-en {
  font-size:7.5px; letter-spacing:2.5px; text-transform:uppercase;
  color:rgba(255,255,255,0.4); margin-bottom:2px;
}
.ir-logo-tag {
  font-size:8.5px; color:rgba(255,255,255,0.25); font-weight:400;
}

/* Badge institusi */
.ir-inst-badge {
  margin:8px 12px;
  padding:7px 12px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:var(--radius);
  position:relative; z-index:1;
}
.ir-inst-label {
  font-size:7.5px; letter-spacing:1px;
  color:rgba(255,255,255,0.3); text-transform:uppercase;
  margin-bottom:3px;
}
.ir-inst-name {
  font-size:10.5px; color:rgba(255,255,255,0.8);
  font-weight:500; line-height:1.3;
}
.ir-inst-logo {
  max-height:24px; max-width:100%; object-fit:contain;
  margin-bottom:4px; display:block;
}

/* Nav */
.ir-nav { flex:1; padding:8px 0; overflow-y:auto; position:relative; z-index:1; }
.ir-nav-sec {
  font-size:8.5px; letter-spacing:1.5px; text-transform:uppercase;
  color:rgba(255,255,255,0.25); padding:10px 18px 4px;
  font-weight:500;
}
.ir-nav-item {
  display:flex; align-items:center; gap:10px;
  padding:9px 16px; margin:1px 8px;
  font-size:12px; color:rgba(255,255,255,0.55);
  cursor:pointer; border-radius:var(--radius);
  border:1px solid transparent;
  transition:var(--transition); font-weight:400;
}
.ir-nav-item:hover {
  color:rgba(255,255,255,0.85);
  background:rgba(255,255,255,0.06);
}
.ir-nav-item.active {
  color:#fff;
  background:rgba(212,175,55,0.15);
  border-color:rgba(212,175,55,0.25);
  font-weight:500;
}
.ir-nav-item.active i { color:var(--gold); }
.ir-nav-item i { font-size:16px; opacity:0.8; }

/* Kuota */
.ir-quota {
  padding:10px 16px;
  border-top:1px solid rgba(255,255,255,0.07);
  position:relative; z-index:1;
}
.ir-quota-label {
  font-size:9.5px; color:rgba(255,255,255,0.3);
  margin-bottom:6px; display:flex; justify-content:space-between;
  letter-spacing:0.3px;
}
.ir-quota-label span { color:var(--gold); font-weight:500; }
.ir-quota-bar {
  height:3px; background:rgba(255,255,255,0.1);
  border-radius:2px; overflow:hidden;
}
.ir-quota-fill {
  height:100%; background:var(--gold);
  border-radius:2px; transition:width 0.4s ease;
}
.ir-quota-fill.warn { background:var(--red); }

/* User strip */
.ir-user-strip {
  padding:10px 12px 12px;
  border-top:1px solid rgba(255,255,255,0.07);
  display:flex; flex-direction:column; gap:8px;
  position:relative; z-index:1;
}
.ir-user-info { display:flex; align-items:center; gap:10px; }
.ir-avatar {
  width:34px; height:34px; border-radius:50%;
  background:rgba(212,175,55,0.2);
  border:1.5px solid rgba(212,175,55,0.4);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; color:var(--gold); flex-shrink:0;
}
.ir-uname { font-size:11.5px; color:rgba(255,255,255,0.8); font-weight:500; }
.ir-urole { font-size:9.5px; color:rgba(255,255,255,0.3); }
.ir-logout-btn {
  display:flex; align-items:center; justify-content:center; gap:6px;
  width:100%; padding:7px 0;
  background:rgba(220,38,38,0.1); border:1px solid rgba(220,38,38,0.2);
  border-radius:var(--radius); color:rgba(255,120,120,0.7);
  font-size:11px; font-weight:500; cursor:pointer;
  transition:var(--transition);
}
.ir-logout-btn:hover {
  background:rgba(220,38,38,0.2); border-color:rgba(220,38,38,0.4);
  color:#f87171;
}
.ir-logout-btn i { font-size:13px; }

/* ══════════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════════ */
.ir-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }

.ir-topbar {
  padding:10px 24px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:12px;
  background:var(--white); flex-shrink:0;
}
.ir-topbar-left { flex-shrink:0; min-width:0; flex:1; }
.ir-page-title { font-size:17px; font-weight:600; color:var(--ink); }
.ir-page-sub { font-size:10px; color:var(--muted); margin-top:2px; font-weight:400; text-transform:uppercase; letter-spacing:0.5px; }
.ir-topbar-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }

/* Search dropdown */
.ir-search-dropdown {
  position:absolute; top:calc(100% + 6px); left:0; right:0;
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); z-index:999;
  box-shadow:0 8px 24px rgba(0,0,0,0.12);
  overflow:hidden; max-height:360px; overflow-y:auto;
}
.ir-search-result {
  padding:10px 14px; cursor:pointer;
  border-bottom:1px solid var(--border);
  transition:background 0.12s;
  display:flex; align-items:flex-start; gap:10px;
}
.ir-search-result:last-child { border-bottom:none; }
.ir-search-result:hover { background:var(--em-faint); }
.ir-search-result-icon {
  width:32px; height:32px; border-radius:var(--radius);
  background:var(--em-faint); border:1px solid var(--em-border);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; color:var(--em-mid); font-size:14px;
}
.ir-search-result-title { font-size:12px; font-weight:500; color:var(--ink); margin-bottom:2px; }
.ir-search-result-meta { font-size:10px; color:var(--muted); display:flex; gap:8px; }
.ir-search-empty { padding:16px; text-align:center; font-size:12px; color:var(--muted); }
.ir-search-loading { padding:12px 14px; font-size:12px; color:var(--muted); display:flex; align-items:center; gap:8px; }

/* Autosave bar — bar hijau kecil di topbar */
.ir-autosave-bar {
  display:flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:20px;
  font-size:10.5px; font-weight:500;
  background:var(--green-bg); color:var(--green);
  border:1px solid #BBF7D0;
  transition:all 0.3s ease;
  white-space:nowrap;
}
.ir-autosave-bar.saving {
  background:var(--amber-bg); color:var(--amber);
  border-color:#FDE68A;
}
.ir-autosave-bar.hidden { opacity:0; pointer-events:none; }
.ir-autosave-bar i { font-size:12px; }

/* Search bar */
.ir-topbar-search {
  width:220px; position:relative; flex-shrink:0;
}
.ir-topbar-search > i {
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  font-size:14px; color:var(--muted); pointer-events:none; z-index:1;
}
.ir-topbar-search input {
  width:100%; padding:7px 12px 7px 32px;
  border:1px solid var(--border); border-radius:20px;
  font-size:12px; font-family:var(--font);
  background:var(--ivory); color:var(--ink);
  transition:var(--transition); display:block;
}
.ir-topbar-search input:focus {
  outline:none; border-color:var(--em-mid);
  box-shadow:0 0 0 3px rgba(15,91,70,0.08);
  background:var(--white); width:260px;
}
.ir-topbar-search input::placeholder { color:var(--muted); }

/* Avatar topbar */
.ir-topbar-user {
  display:flex; align-items:center; gap:10px;
  padding:6px 12px 6px 6px;
  border:1px solid var(--border); border-radius:var(--radius-xl);
  cursor:default; background:var(--ivory);
}
.ir-topbar-avatar {
  width:32px; height:32px; border-radius:50%;
  background:var(--em-mid); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; flex-shrink:0;
}
.ir-topbar-name { font-size:12px; font-weight:500; color:var(--ink); white-space:nowrap; }
.ir-topbar-role { font-size:10px; color:var(--muted); }

/* Toggle dark mode button dalam topbar */
.ir-theme-toggle {
  width:34px; height:34px; border:1px solid var(--border);
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--muted); transition:var(--transition);
  background:var(--ivory); flex-shrink:0;
}
.ir-theme-toggle:hover { border-color:var(--em-border); color:var(--em-mid); background:var(--em-faint); }

.ir-btn-icon {
  width:32px; height:32px; border:1px solid var(--border);
  border-radius:var(--radius); display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--muted); transition:var(--transition); background:transparent;
}
.ir-btn-icon:hover { border-color:var(--em-border); color:var(--em-mid); background:var(--em-faint); }

.ir-content { flex:1; overflow-y:auto; padding:22px 26px; background:var(--ivory); }

/* ══════════════════════════════════════════════════════════
   BUTANG
══════════════════════════════════════════════════════════ */
.ir-btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 16px; border-radius:var(--radius);
  font-size:12px; font-weight:500; font-family:var(--font);
  cursor:pointer; transition:var(--transition);
  border:1px solid var(--border);
  background:var(--white); color:var(--muted);
}
.ir-btn:hover { border-color:var(--em-border); color:var(--em-mid); background:var(--em-faint); }
.ir-btn.primary {
  background:var(--em-mid); color:#fff;
  border-color:var(--em-mid); font-weight:500;
}
.ir-btn.primary:hover { background:var(--em-dark); border-color:var(--em-dark); }
.ir-btn.danger { border-color:#FCA5A5; color:var(--red); }
.ir-btn.danger:hover { background:var(--red-bg); }
.ir-btn i { font-size:14px; }
.ir-btn:disabled { opacity:0.45; cursor:not-allowed; }

/* ══════════════════════════════════════════════════════════
   PANEL INPUT FEATURE
══════════════════════════════════════════════════════════ */
.ir-input-panel {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:20px; margin-bottom:16px;
}

/* Header panel — ikon + tajuk */
.ir-panel-header {
  display:flex; align-items:center; gap:14px;
  margin-bottom:18px; padding-bottom:14px;
  border-bottom:1px solid var(--border);
}
.ir-panel-icon {
  width:44px; height:44px; border-radius:50%;
  background:var(--em-faint); border:1.5px solid var(--em-border);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.ir-panel-icon i { font-size:20px; color:var(--em-mid); }
.ir-panel-title { font-size:15px; font-weight:600; color:var(--ink); }
.ir-panel-sub { font-size:11px; color:var(--muted); margin-top:2px; }
.ir-row { display:flex; gap:12px; margin-bottom:12px; }
.ir-field { flex:1; }
.ir-label {
  font-size:11px; color:var(--muted); margin-bottom:5px;
  font-weight:500; letter-spacing:0.3px; display:block;
}

.ir-select, .ir-input, .ir-textarea {
  width:100%; padding:9px 12px; border:1px solid var(--border);
  border-radius:var(--radius); font-size:12.5px; font-family:var(--font);
  color:var(--ink); background:var(--ivory); transition:var(--transition);
}
.ir-select:focus, .ir-input:focus, .ir-textarea:focus {
  outline:none; border-color:var(--em-mid);
  box-shadow:0 0 0 3px rgba(15,91,70,0.08);
  background:var(--white);
}
.ir-textarea { resize:vertical; min-height:100px; line-height:1.7; }

/* Counter karakter */
.ir-textarea-wrap { position:relative; margin-bottom:4px; }
.ir-char-count {
  position:absolute; bottom:8px; right:10px;
  font-size:10px; color:var(--muted); pointer-events:none;
}
.ir-char-count.near { color:var(--amber); }
.ir-char-count.full { color:var(--red); }

/* Upload */
.ir-upload-strip {
  display:flex; align-items:center; gap:8px; padding:10px 14px;
  border:1.5px dashed var(--border2); border-radius:var(--radius);
  cursor:pointer; transition:var(--transition); color:var(--muted);
  font-size:12px; margin-bottom:10px; background:var(--ivory);
}
.ir-upload-strip:hover { border-color:var(--em-mid); color:var(--em-mid); background:var(--em-faint); }
.ir-file-chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.ir-file-chip {
  display:flex; align-items:center; gap:6px; padding:4px 10px;
  background:var(--em-faint); border:1px solid var(--em-border);
  border-radius:20px; font-size:11px; color:var(--em-mid); max-width:220px;
}
.ir-file-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.ir-file-chip .chip-icon { font-size:12px; flex-shrink:0; }
.ir-file-chip .chip-remove {
  flex-shrink:0; width:16px; height:16px;
  background:var(--em-mid); color:#fff; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:9px; cursor:pointer; transition:background 0.15s; margin-left:2px;
}
.ir-file-chip .chip-remove:hover { background:var(--red); }

/* Toggle */
.ir-action-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ir-toggle-wrap { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--muted); cursor:pointer; }
.ir-toggle-wrap.disabled { cursor:not-allowed; opacity:0.4; }
.ir-toggle {
  width:32px; height:18px; border-radius:9px; background:var(--em-mid);
  position:relative; cursor:pointer; flex-shrink:0; transition:background 0.2s;
}
.ir-toggle::after {
  content:''; position:absolute; width:14px; height:14px;
  border-radius:50%; background:#fff; top:2px; right:2px; transition:right 0.2s;
}
.ir-toggle.off { background:var(--border2); }
.ir-toggle.off::after { right:16px; }
.ir-toggle.locked { cursor:not-allowed; pointer-events:none; }

/* ══════════════════════════════════════════════════════════
   OUTPUT PANEL
══════════════════════════════════════════════════════════ */
.ir-output-panel {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); overflow:hidden; margin-bottom:14px;
}
.ir-out-header {
  padding:10px 16px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  background:var(--ivory2); flex-wrap:wrap; gap:8px;
}
.ir-out-status { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:500; }
.ir-status-dot { width:7px; height:7px; border-radius:50%; }
.ir-status-dot.generating { background:var(--amber); animation:pulse 1s infinite; }
.ir-status-dot.selesai { background:var(--green-mid); }
.ir-out-actions { display:flex; gap:6px; flex-wrap:wrap; }

.ir-out-body {
  padding:20px 24px; overflow-y:auto;
  flex:1; min-height:300px;
  font-size:13px; line-height:1.85; color:var(--ink);
}
.ir-out-body h1,.ir-out-body h2 {
  font-size:14.5px; font-weight:600; color:var(--em-dark);
  margin:18px 0 8px; padding-bottom:6px;
  border-bottom:1px solid var(--em-faint);
}
.ir-out-body h3 { font-size:13px; font-weight:600; color:var(--em-mid); margin:14px 0 6px; }
.ir-out-body h4 { font-size:12.5px; font-weight:500; color:var(--ink); margin:10px 0 4px; }
.ir-out-body p { margin-bottom:10px; }
.ir-out-body ul,.ir-out-body ol { padding-left:20px; margin-bottom:10px; }
.ir-out-body li { margin-bottom:5px; }
.ir-out-body hr { border:none; border-top:1px solid var(--border); margin:16px 0; }
.ir-out-body strong { color:var(--ink); font-weight:600; }
.ir-out-body table { width:100%; border-collapse:collapse; margin:12px 0; font-size:12px; }
.ir-out-body th { background:var(--em-mid); color:#fff; padding:8px 12px; text-align:left; font-weight:500; }
.ir-out-body td { padding:7px 12px; border-bottom:1px solid var(--border); }
.ir-out-body tr:nth-child(even) td { background:var(--ivory); }
.ir-out-body .arabic {
  font-family:var(--font-ar); font-size:19px; direction:rtl;
  text-align:right; color:var(--em-dark); line-height:2.2;
  background:var(--em-faint); border-left:3px solid var(--em-mid);
  padding:12px 16px; border-radius:0 var(--radius) var(--radius) 0; margin:10px 0;
}

/* Generating panel */
.ir-generating-wrap { padding:32px; text-align:center; }
.ir-generating-text { font-size:12px; color:var(--muted); margin-top:12px; }

/* ══════════════════════════════════════════════════════════
   SEJARAH & SENARAI
══════════════════════════════════════════════════════════ */
.ir-conv-list { display:flex; flex-direction:column; gap:6px; }
.ir-conv-item {
  padding:10px 14px; border:1px solid var(--border);
  border-radius:var(--radius); cursor:pointer;
  transition:var(--transition); background:var(--white);
}
.ir-conv-item:hover { border-color:var(--em-border); background:var(--em-faint); }
.ir-conv-title { font-size:12px; font-weight:500; color:var(--ink); margin-bottom:3px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.ir-conv-meta { font-size:10px; color:var(--muted); display:flex; gap:8px; }

/* Status badge */
.ir-status-badge {
  font-size:10px; padding:3px 8px; border-radius:10px; font-weight:500;
  display:inline-flex; align-items:center; gap:4px; white-space:nowrap;
}
.ir-status-badge i { font-size:11px; }
.ir-status-draft    { background:#FFFBEB; color:#B45309; border:1px solid #FDE68A; }
.ir-status-semakan  { background:#EFF6FF; color:#1D4ED8; border:1px solid #BFDBFE; }
.ir-status-selesai  { background:#F0FDF4; color:#15803D; border:1px solid #BBF7D0; }

/* ══════════════════════════════════════════════════════════
   ADMIN PANELS
══════════════════════════════════════════════════════════ */
.ir-admin-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:20px; }
.ir-stat-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px 18px; }
.ir-stat-label { font-size:11px; color:var(--muted); margin-bottom:6px; }
.ir-stat-val { font-size:26px; font-weight:600; color:var(--em-dark); }

.ir-table { width:100%; border-collapse:collapse; font-size:12px; }
.ir-table th {
  padding:9px 14px; background:var(--em-mid); color:rgba(255,255,255,0.9);
  text-align:left; font-weight:500; font-size:11px; letter-spacing:0.3px;
}
.ir-table th:first-child { border-radius:var(--radius) 0 0 0; }
.ir-table th:last-child { border-radius:0 var(--radius) 0 0; }
.ir-table td { padding:10px 14px; border-bottom:1px solid var(--border); color:var(--ink); vertical-align:middle; }
.ir-table td .ir-btn { vertical-align:middle; }
.ir-table tr:last-child td { border-bottom:none; }
.ir-table tr:hover td { background:var(--em-faint); }

/* Settings */
.ir-settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ir-settings-full { grid-column:1/-1; }
.ir-settings-group {
  border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:18px; margin-bottom:16px; background:var(--white);
}
.ir-settings-group h3 {
  font-size:13px; font-weight:600; color:var(--em-dark); margin-bottom:14px;
  padding-bottom:10px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:7px;
}
.ir-settings-group h3 i { color:var(--em-mid); }

/* ══════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════ */
.ir-login-wrap {
  display:flex; align-items:center; justify-content:center;
  width:100%; height:100%;
  min-height:500px; padding:40px 20px;
  background:var(--ivory);
}
.ir-login-card {
  width:100%; max-width:400px; background:var(--white);
  border:1px solid var(--border); border-radius:var(--radius-xl);
  padding:36px 32px; position:relative; overflow:hidden;
}
.ir-login-card::before {
  content:'';
  position:absolute; top:0; left:0; right:0; height:4px;
  background:linear-gradient(90deg, var(--em-dark), var(--em-mid), var(--gold));
}
.ir-login-logo { text-align:center; margin-bottom:28px; }
.ir-login-logo-ar { font-family:var(--font-ar); font-size:30px; color:var(--em-mid); }
.ir-login-logo-en { font-size:10px; letter-spacing:3px; text-transform:uppercase; color:var(--muted); margin-top:4px; }
.ir-login-title { font-size:17px; font-weight:600; color:var(--ink); text-align:center; margin-bottom:6px; }
.ir-login-sub { font-size:12px; color:var(--muted); text-align:center; margin-bottom:28px; }

/* ══════════════════════════════════════════════════════════
   ALERT
══════════════════════════════════════════════════════════ */
.ir-alert {
  padding:10px 14px; border-radius:var(--radius); font-size:12px;
  margin-bottom:10px; display:flex; align-items:flex-start; gap:8px;
}
.ir-alert.success { background:var(--green-bg); color:var(--green); border:1px solid #BBF7D0; }
.ir-alert.error   { background:var(--red-bg); color:var(--red); border:1px solid #FECACA; }
.ir-alert.warn    { background:var(--amber-bg); color:var(--amber); border:1px solid #FDE68A; }
.ir-alert i { font-size:15px; margin-top:1px; flex-shrink:0; }

/* ══════════════════════════════════════════════════════════
   TENANT CARDS
══════════════════════════════════════════════════════════ */
.ir-tenant-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; margin-top:10px; }
.ir-tenant-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; }
.ir-tenant-card-header { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.ir-tenant-stats { display:flex; gap:20px; margin-bottom:10px; font-size:12px; }
.ir-tenant-stats strong { font-size:14px; display:block; }

/* ══════════════════════════════════════════════════════════
   FEAT ASSIGN & MODAL
══════════════════════════════════════════════════════════ */
.ir-feat-assign-row {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  border:1px solid var(--border); border-radius:var(--radius);
  margin-bottom:8px; transition:background 0.15s;
}
.ir-feat-assign-row:hover { background:var(--em-faint); border-color:var(--em-border); }
.ir-feat-assign-row input[type=checkbox] { width:16px; height:16px; cursor:pointer; accent-color:var(--em-mid); }

.ir-modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.5);
  display:flex; align-items:center; justify-content:center;
  z-index:9999; padding:16px;
}
.ir-modal {
  background:var(--white); border-radius:var(--radius-lg); padding:24px;
  width:100%; max-width:680px; max-height:90vh; overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.ir-modal-header {
  display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:18px;
}
.ir-status-draft { background:var(--ivory); color:var(--muted); }

/* ══════════════════════════════════════════════════════════
   SPINNER & ANIMASI
══════════════════════════════════════════════════════════ */
.ir-spinner {
  width:20px; height:20px; border:2px solid var(--border);
  border-top-color:var(--em-mid); border-radius:50%;
  animation:spin 0.7s linear infinite; display:inline-block;
}

@keyframes spin    { to { transform:rotate(360deg); } }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeIn  { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.ir-fade { animation:fadeIn 0.22s ease; }

/* ══════════════════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════════════════ */
.ir-content::-webkit-scrollbar, .ir-out-body::-webkit-scrollbar, .ir-nav::-webkit-scrollbar { width:4px; }
.ir-content::-webkit-scrollbar-track, .ir-out-body::-webkit-scrollbar-track { background:transparent; }
.ir-content::-webkit-scrollbar-thumb, .ir-out-body::-webkit-scrollbar-thumb { background:var(--border2); border-radius:2px; }
.ir-content::-webkit-scrollbar-thumb:hover, .ir-out-body::-webkit-scrollbar-thumb:hover { background:var(--em-mid); }

/* Butang dalam sel jadual — pastikan selari mendatar */
td .ir-btn, td .ir-btn-icon {
  display:inline-flex; align-items:center; vertical-align:middle;
}
