/* ====================================================
   NASSAJ PMC — Snag & De-snag System
   Design System — main.css
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────── */
:root {
  --gold:        #C9A84C;
  --gold-light:  #E8C96A;
  --gold-dark:   #9E7A2E;
  --navy:        #1A2B4A;
  --navy-mid:    #243558;
  --navy-light:  #2E4270;
  --white:       #FFFFFF;
  --off-white:   #F5F3EE;
  --gray-100:    #F0EDE8;
  --gray-200:    #E2DDD5;
  --gray-400:    #9E9590;
  --gray-600:    #5C5650;
  --gray-800:    #2E2A25;

  --status-open:       #E74C3C;
  --status-open-bg:    rgba(231,76,60,0.12);
  --status-inprogress: #F39C12;
  --status-inprogress-bg: rgba(243,156,18,0.12);
  --status-review:     #3498DB;
  --status-review-bg:  rgba(52,152,219,0.12);
  --status-closed:     #27AE60;
  --status-closed-bg:  rgba(39,174,96,0.12);

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.3);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Tajawal', sans-serif;
}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--gray-800);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ── Layout ────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 100;
  box-shadow: -4px 0 30px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.sidebar-logo .logo-text span {
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 400;
  display: block;
}

.sidebar-user {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info .user-name { color: var(--white); font-size: 14px; font-weight: 600; }
.user-info .user-role {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-section-title {
  color: rgba(201,168,76,0.6);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 24px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item i { width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: var(--gold-light);
  background: rgba(201,168,76,0.1);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--gold);
  border-radius: 3px 0 0 3px;
}
.nav-badge {
  margin-right: auto;
  background: var(--status-open);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.logout-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: var(--radius-sm);
  color: #E74C3C;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.logout-btn:hover { background: rgba(231,76,60,0.2); }

/* ── Main Content ──────────────────────────────────── */
.main-content {
  margin-right: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-title h1 { font-size: 22px; font-weight: 800; color: var(--navy); }
.topbar-title p { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--white);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,168,76,0.4);
}
.btn-navy {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
}
.btn-navy:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger {
  background: rgba(231,76,60,0.1);
  border: 1.5px solid rgba(231,76,60,0.3);
  color: var(--status-open);
}
.btn-danger:hover { background: rgba(231,76,60,0.2); }
.btn-success {
  background: rgba(39,174,96,0.1);
  border: 1.5px solid rgba(39,174,96,0.3);
  color: var(--status-closed);
}
.btn-success:hover { background: rgba(39,174,96,0.2); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Page Content ──────────────────────────────────── */
.page-content { padding: 28px 32px; flex: 1; }

/* ── Stats Grid ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.stat-card.red::before   { background: var(--status-open); }
.stat-card.amber::before { background: var(--status-inprogress); }
.stat-card.blue::before  { background: var(--status-review); }
.stat-card.green::before { background: var(--status-closed); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.red   { background: var(--status-open-bg); color: var(--status-open); }
.stat-icon.amber { background: var(--status-inprogress-bg); color: var(--status-inprogress); }
.stat-icon.blue  { background: var(--status-review-bg); color: var(--status-review); }
.stat-icon.green { background: var(--status-closed-bg); color: var(--status-closed); }

.stat-info .stat-number { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-info .stat-label  { font-size: 13px; color: var(--gray-400); margin-top: 3px; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.card-body { padding: 24px; }

/* ── Table ─────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: right;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(201,168,76,0.04); }
tbody td { padding: 14px 16px; font-size: 13.5px; color: var(--gray-800); vertical-align: middle; }

/* ── Status Badge ──────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.open        { background: var(--status-open-bg);        color: var(--status-open); }
.status-badge.in-progress { background: var(--status-inprogress-bg);  color: var(--status-inprogress); }
.status-badge.in-review   { background: var(--status-review-bg);      color: var(--status-review); }
.status-badge.closed      { background: var(--status-closed-bg);      color: var(--status-closed); }
.status-badge::before { content: '●'; font-size: 8px; }

/* ── Priority Badge ────────────────────────────────── */
.priority-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}
.priority-badge.critical { background: rgba(231,76,60,0.1);  color: var(--status-open); border: 1px solid rgba(231,76,60,0.25); }
.priority-badge.major    { background: rgba(243,156,18,0.1); color: var(--status-inprogress); border: 1px solid rgba(243,156,18,0.25); }
.priority-badge.minor    { background: rgba(39,174,96,0.1);  color: var(--status-closed); border: 1px solid rgba(39,174,96,0.25); }

/* ── Role Badge ────────────────────────────────────── */
.role-superadmin { background: rgba(231,76,60,0.15); color: #C0392B; }
.role-contractor  { background: rgba(155,89,182,0.15); color: #9B59B6; }
.role-re          { background: rgba(52,152,219,0.15); color: #2980B9; }
.role-pmc         { background: rgba(201,168,76,0.2);  color: var(--gold-dark); }
.role-client      { background: rgba(39,174,96,0.15);  color: #1E8449; }
.role-certifying  { background: rgba(231,76,60,0.12);  color: #C0392B; }

/* Super Admin nav item gets a special glow */
.nav-item[href="admin.html"] {
  position: relative;
}
.nav-item[href="admin.html"].active {
  color: #FF6B6B;
  background: rgba(231,76,60,0.12);
}
.nav-item[href="admin.html"].active::before {
  background: #E74C3C;
}
.nav-item[href="admin.html"]:not(.active):hover {
  color: #FF8080;
}

/* ── Form Styles ───────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.form-label .required { color: var(--status-open); margin-right: 3px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  transition: var(--transition);
  font-family: var(--font);
  direction: rtl;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11px; color: var(--gray-400); }

/* ── Filter Bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.filter-bar .form-input,
.filter-bar .form-select {
  background: var(--white);
  max-width: 200px;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
}
.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}
.search-input-wrap .form-input { padding-left: 36px; }

/* ── Timeline ──────────────────────────────────────── */
.timeline { padding: 0; }
.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  right: 19px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.timeline-body .timeline-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.timeline-body .timeline-time  { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.timeline-body .timeline-desc  { font-size: 13px; color: var(--gray-600); margin-top: 5px; }

/* ── Progress Bar ──────────────────────────────────── */
.progress-wrap { }
.progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-label span { font-size: 13px; font-weight: 600; }
.progress-bar-bg {
  height: 10px;
  background: var(--gray-200);
  border-radius: 5px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.8s ease;
}

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.alert-info    { background: var(--status-review-bg); color: var(--status-review); border: 1px solid rgba(52,152,219,0.25); }
.alert-warning { background: var(--status-inprogress-bg); color: var(--status-inprogress); border: 1px solid rgba(243,156,18,0.25); }
.alert-success { background: var(--status-closed-bg); color: var(--status-closed); border: 1px solid rgba(39,174,96,0.25); }
.alert-danger  { background: var(--status-open-bg); color: var(--status-open); border: 1px solid rgba(231,76,60,0.25); }

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-size: 18px; font-weight: 800; color: var(--navy); }
.modal-close {
  width: 32px; height: 32px; border: none; background: var(--gray-100);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Empty State ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--gray-200); }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  gap: 0;
  margin-bottom: 24px;
}
.tab-btn {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--gold-dark); border-bottom-color: var(--gold); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Snag Detail Header ────────────────────────────── */
.snag-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 28px 32px;
  color: var(--white);
  margin: -28px -32px 28px;
}
.snag-header .snag-id { font-size: 13px; color: var(--gold-light); margin-bottom: 6px; font-weight: 600; }
.snag-header h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.snag-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.snag-meta-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,0.75); }
.snag-meta-item i { color: var(--gold-light); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 220px; }
  .main-content { margin-right: 220px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 14px 20px; }
}
@media (max-width: 600px) {
  .sidebar { transform: translateX(260px); }
  .main-content { margin-right: 0; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Login Page ────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1a3a6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-circle {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-gold);
}
.login-logo h1 { font-size: 26px; font-weight: 900; color: var(--navy); }
.login-logo p  { font-size: 14px; color: var(--gray-400); margin-top: 4px; }
.login-divider {
  text-align: center;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
  margin: 20px 0;
  position: relative;
}
.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 60px);
  height: 1px;
  background: var(--gray-200);
}
.login-divider::before { right: 0; }
.login-divider::after  { left: 0; }
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.role-option {
  padding: 12px 10px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.role-option i { display: block; font-size: 20px; margin-bottom: 6px; }
.role-option:hover { border-color: var(--gold); color: var(--gold-dark); }
.role-option.selected { border-color: var(--gold); background: rgba(201,168,76,0.08); color: var(--gold-dark); }

/* ── Certificate ───────────────────────────────────── */
.certificate-page {
  background: #f9f7f2;
  min-height: 100vh;
}
.cert-print-area {
  background: white;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px;
  box-shadow: var(--shadow-lg);
}
.cert-header {
  border-bottom: 4px double var(--gold);
  padding-bottom: 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cert-logo-area h2 { font-size: 28px; font-weight: 900; color: var(--navy); }
.cert-logo-area p { color: var(--gold-dark); font-size: 14px; font-weight: 600; }
.cert-doc-ref { text-align: left; font-size: 12px; color: var(--gray-400); }
.cert-title {
  text-align: center;
  margin-bottom: 32px;
}
.cert-title h1 {
  font-size: 22px;
  font-weight: 900;
  color: var(--navy);
  border: 2px solid var(--navy);
  display: inline-block;
  padding: 10px 32px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}
.cert-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--gray-200); margin-bottom: 24px; }
.cert-info-cell {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  border-left: 1px solid var(--gray-200);
  font-size: 13px;
}
.cert-info-cell:nth-child(even) { border-left: none; }
.cert-info-label { font-weight: 700; color: var(--gray-600); font-size: 11px; text-transform: uppercase; }
.cert-info-value { color: var(--navy); font-weight: 600; margin-top: 3px; }

.cert-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.sig-block { text-align: center; }
.sig-line { border-bottom: 1.5px solid var(--navy); margin: 40px 10px 8px; }
.sig-label { font-size: 12px; font-weight: 700; color: var(--navy); }
.sig-sublabel { font-size: 11px; color: var(--gray-400); }

@media print {
  .topbar, .sidebar, .topbar-actions, .no-print { display: none !important; }
  .main-content { margin-right: 0; }
  .cert-print-area { box-shadow: none; padding: 20px; }
  body { background: white; }
}

/* ── Animations ────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.fade-in    { animation: fadeInUp 0.4s ease forwards; }
.fade-in-d1 { animation-delay: 0.05s; opacity: 0; }
.fade-in-d2 { animation-delay: 0.10s; opacity: 0; }
.fade-in-d3 { animation-delay: 0.15s; opacity: 0; }
.fade-in-d4 { animation-delay: 0.20s; opacity: 0; }

/* ── Tooltip ───────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 50%;
  transform: translateX(50%);
  background: var(--gray-800);
  color: white;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Notification Toast ────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  min-width: 280px;
  animation: fadeInUp 0.3s ease;
  border-right: 4px solid var(--gold);
}
.toast.success { border-right-color: var(--status-closed); }
.toast.error   { border-right-color: var(--status-open); }
.toast i { font-size: 18px; }
.toast.success i { color: var(--status-closed); }
.toast.error   i { color: var(--status-open); }
