/* GovCare Dashboard — Global Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { direction: rtl; font-family: var(--gc-font-ar); background: var(--gc-bg); color: var(--gc-text); }
body { min-height: 100vh; overflow-x: hidden; line-height: 1.5; }
body.gc-overlay-active { overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: var(--gc-font-ar); }

/* ── Sidebar ── */
.gc-sidebar {
  position: fixed; right: 0; top: 0; height: 100vh;
  background: var(--gc-navy); display: flex; flex-direction: column;
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1); z-index: 100;
  border-left: 1px solid rgba(255,255,255,0.06); overflow: hidden;
}
.gc-sidebar-logo {
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; min-height: 78px;
}
.gc-sidebar-nav {
  flex: 1; padding: 12px 8px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.gc-nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 2px; border-radius: 8px;
  border: none; background: transparent; color: rgba(197,211,224,0.75);
  font-size: 13px; font-family: var(--gc-font-ar); font-weight: 500;
  transition: all 0.15s ease; direction: rtl; text-align: right; white-space: nowrap;
}
.gc-nav-item i { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.gc-nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(220,230,240,0.95); }
.gc-nav-item.active {
  background: rgba(20,93,160,0.3); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gc-gold);
}
.gc-nav-item.active i { opacity: 1; color: var(--gc-gold); }
.gc-sidebar-toggle {
  padding: 12px; border: none; background: rgba(255,255,255,0.03);
  color: rgba(197,211,224,0.5); display: flex; align-items: center; justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.06); transition: background 0.15s;
}
.gc-sidebar-toggle:hover { background: rgba(255,255,255,0.07); }
.gc-sidebar-toggle i { width: 18px; height: 18px; }
.gc-sidebar-footer {
  padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 10px; color: rgba(168,191,207,0.4); font-family: var(--gc-font-en);
}

/* ── Main Layout ── */
.gc-main {
  margin-right: var(--sidebar-w);
  transition: margin-right 0.28s cubic-bezier(0.4,0,0.2,1);
  min-height: 100vh; display: flex; flex-direction: column;
  min-width: 0; /* prevent flex child overflow */
  max-width: 100vw; /* safety cap */
}
.gc-main.gc-main--collapsed { margin-right: 68px; }
.gc-content {
  padding: 24px 28px; flex: 1;
  min-width: 0; /* prevent child overflow past sidebar */
  max-width: 100%; /* safety: no horizontal page scroll */
  overflow-x: hidden; /* catch any stray overflow */
}

/* ── TopBar ── */
.gc-topbar {
  min-height: 56px; height: auto;
  background: var(--gc-surface); border-bottom: 1px solid var(--gc-border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 10px 24px; gap: 10px;
  position: sticky; top: 0; z-index: 50;
  direction: rtl; min-width: 0;
}
.gc-topbar-right {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 300px; min-width: 0; flex-wrap: wrap;
}
.gc-topbar-title-wrap { min-width: 0; flex-shrink: 1; }
.gc-topbar-title {
  font-size: 16px; font-weight: 700; color: var(--gc-text); font-family: var(--gc-font-ar);
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 360px;
}
.gc-topbar-subtitle {
  font-size: 11px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px; display: block;
}
.gc-scope-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 6px; background: var(--gc-muted); font-size: 11px;
  color: var(--gc-text-secondary); font-family: var(--gc-font-ar);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px; flex-shrink: 1;
}
.gc-scope-badge i { width: 13px; height: 13px; flex-shrink: 0; }
.gc-topbar-left {
  display: flex; align-items: center; gap: 8px; direction: ltr;
  flex-shrink: 0; flex-wrap: wrap;
}
.gc-topbar-update {
  font-size: 11px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; flex-shrink: 0;
}
.gc-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gc-success); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.gc-date-select {
  padding: 6px 12px; border: 1px solid var(--gc-border); border-radius: 6px;
  background: var(--gc-surface); font-size: 12px; font-family: var(--gc-font-ar);
  color: var(--gc-text); cursor: pointer; direction: rtl;
}
.gc-topbar-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--gc-border);
  background: var(--gc-surface); display: flex; align-items: center; justify-content: center;
  color: var(--gc-text-secondary); transition: all 0.15s; position: relative; flex-shrink: 0;
}
a.gc-topbar-btn { text-decoration: none; cursor: pointer; }
.gc-topbar-btn:hover { background: var(--gc-muted); color: var(--gc-text); }
.gc-topbar-btn i { width: 18px; height: 18px; }
.gc-notif-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gc-critical);
  position: absolute; top: 6px; right: 6px; border: 2px solid var(--gc-surface);
}

/* ── KPI Cards ── */
.gc-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.gc-kpi-grid > * { min-width: 0; } /* prevent grid children overflow */
.gc-kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.gc-kpi-card {
  background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 16px 18px;
  box-shadow: var(--gc-shadow-sm); border: 1px solid var(--gc-border-light);
  transition: box-shadow 0.2s, transform 0.15s;
  min-width: 0; overflow: hidden;
}
.gc-kpi-card:hover { box-shadow: var(--gc-shadow-md); transform: translateY(-1px); }
.gc-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.gc-kpi-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center;
}
.gc-kpi-icon i { width: 20px; height: 20px; }
.gc-kpi-trend { display: flex; align-items: center; gap: 3px; font-size: 12px; font-family: var(--gc-font-en); font-weight: 600; }
.gc-kpi-trend i { width: 14px; height: 14px; }
.gc-kpi-value { font-size: 26px; font-weight: 700; font-family: var(--gc-font-en); line-height: 1.1; margin-bottom: 4px; }
.gc-kpi-unit { font-size: 15px; font-weight: 500; opacity: 0.7; margin-right: 3px; font-family: var(--gc-font-ar); }
.gc-kpi-label { font-size: 12px; color: var(--gc-text-secondary); font-weight: 500; line-height: 1.4; }
.gc-kpi-sub { font-size: 11px; color: var(--gc-text-tertiary); margin-top: 4px; }

/* ── Chart Cards ── */
.gc-chart-card {
  background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 18px;
  box-shadow: var(--gc-shadow-sm); border: 1px solid var(--gc-border-light);
  min-width: 0; /* prevent overflow in grid/flex containers */
}
.gc-chart-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.gc-chart-title { font-size: 15px; font-weight: 700; color: var(--gc-text); font-family: var(--gc-font-ar); line-height: 1.35; }
.gc-chart-subtitle { font-size: 12px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); }
.gc-chart-action {
  display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500;
  color: var(--gc-blue); background: none; border: none; font-family: var(--gc-font-ar);
  cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: background 0.15s;
}
.gc-chart-action:hover { background: var(--gc-blue-soft); }
.gc-chart-action i { width: 14px; height: 14px; }
.gc-chart-body { }

/* ── Grids ── */
.gc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.gc-grid-2 > * { min-width: 0; }
.gc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.gc-grid-3 > * { min-width: 0; }

/* ── Bar Chart ── */
.gc-bar-chart { display: flex; align-items: stretch; gap: 8px; padding: 8px 0; }
.gc-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gc-bar-track { width: 100%; flex: 1; position: relative; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--gc-muted); min-height: 20px; }
.gc-bar-fill {
  position: absolute; bottom: 0; width: 100%; border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}
/* bar animation handled inline */
.gc-bar-label { font-size: 10px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.gc-bar-value { font-size: 11px; font-weight: 600; color: var(--gc-text-secondary); font-family: var(--gc-font-en); }

/* ── Line Chart ── */
.gc-line-chart-area { padding: 8px 0; }

/* ── Progress ── */
.gc-progress-row { margin-bottom: 2px; }
.gc-progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar); }
.gc-progress-track { width: 100%; background: var(--gc-muted); border-radius: 999px; overflow: hidden; }
.gc-progress-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }

/* ── Table ── */
.gc-table-wrap {
  width: 100%; max-width: 100%;
  overflow-x: auto; overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* Scroll shadow indicators via background gradients (RTL-aware) */
  background:
    linear-gradient(to left, var(--gc-surface) 30%, transparent) right center / 40px 100% no-repeat,
    linear-gradient(to right, var(--gc-surface) 30%, transparent) left center / 40px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(11,46,74,0.10), transparent) right center / 12px 100% no-repeat,
    radial-gradient(farthest-side at 0% 50%, rgba(11,46,74,0.10), transparent) left center / 12px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.gc-table {
  width: max-content; min-width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px; font-family: var(--gc-font-ar);
}
/* Wide operational tables get a larger min-width */
.gc-table.gc-table-wide { min-width: 1200px; }
.gc-table.gc-table-wider { min-width: 1400px; }
.gc-table.gc-table-widest { min-width: 1600px; }
.gc-table th {
  padding: 10px 12px; text-align: right; font-weight: 600; font-size: 12px; line-height: 1.4;
  color: var(--gc-text-secondary); background: var(--gc-muted); border-bottom: 1px solid var(--gc-border);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.gc-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--gc-border-light);
  color: var(--gc-text); vertical-align: middle; background: var(--gc-surface);
  overflow: hidden; box-sizing: border-box; /* Sprint 03.1: prevent text escape */
}
.gc-table tbody tr:hover td { background: #F7FAFD; transform: none; }
.gc-table tbody tr,
.gc-table tbody tr:hover,
.gc-table tbody tr:hover td { transform: none !important; }

/* ── Sticky Columns — REMOVED in Sprint 03.1A (premature, will return in Sprint 05) ── */
/* All columns scroll normally. No position:sticky on first/last cells. */

/* ── Table Footer / Pagination placeholder ── */
.gc-table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 12px; color: var(--gc-text-tertiary);
  font-family: var(--gc-font-ar); border-top: 1px solid var(--gc-border-light);
}
.gc-table-footer-count { display: flex; align-items: center; gap: 6; }
.gc-table-footer-pages { display: flex; align-items: center; gap: 8; }

/* ── Table Scroll Hint ── */
.gc-scroll-hint {
  display: none; align-items: center; gap: 6px;
  padding: 4px 2px; margin-bottom: 4px;
  font-size: 11px; color: var(--gc-text-tertiary);
  font-family: var(--gc-font-ar);
}
.gc-scroll-hint i { width: 14px; height: 14px; opacity: 0.4; flex-shrink: 0; }

/* ── Ticket ID LTR Isolation (Sprint 03.1) ── */
.gc-ticket-id {
  display: inline-block;
  direction: ltr; unicode-bidi: isolate;
  white-space: nowrap;
  min-width: max-content;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--gc-font-en); font-weight: 700;
  line-height: 1.4;
}

/* ── Ticket ID Column Width (Sprint 03.1A) ── */
.gc-col-ticket { width: 180px; min-width: 180px; max-width: 180px; white-space: nowrap; }

/* ── Sticky Ticket ID Column (Sprint 05, shadows 05.1) ── */
.gc-col-ticket-sticky {
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--gc-surface);
  box-shadow: -8px 0 10px -10px rgba(11,46,74,0.28);
}
.gc-table thead .gc-col-ticket-sticky {
  z-index: 7;
  background: var(--gc-muted);
}
.gc-table tbody tr:hover .gc-col-ticket-sticky { background: #F7FAFD; }
.gc-row-selected .gc-col-ticket-sticky { background: #EEF5FB !important; }

/* ── Sticky Actions Column (Sprint 05, width 05.1) ── */
.gc-col-actions-sticky {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--gc-surface);
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  white-space: nowrap;
  box-shadow: 8px 0 10px -10px rgba(11,46,74,0.28);
}
.gc-table thead .gc-col-actions-sticky {
  z-index: 7;
  background: var(--gc-muted);
}
.gc-table tbody tr:hover .gc-col-actions-sticky { background: #F7FAFD; }
.gc-row-selected .gc-col-actions-sticky { background: #EEF5FB !important; }

/* ── Action Popover (Sprint 05, z-index 05.1) ── */
.gc-action-popover {
  position: fixed;
  z-index: 900;
  min-width: 190px;
  max-width: 240px;
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(11,46,74,0.16);
  padding: 6px;
  direction: rtl;
}

/* ── Table Action Button (Sprint 05) ── */
.gc-table-action-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--gc-border);
  background: var(--gc-surface); color: var(--gc-text-secondary);
  cursor: pointer; transition: background 0.15s; flex-shrink: 0;
}
.gc-table-action-btn:hover { background: var(--gc-muted); color: var(--gc-blue); }
.gc-table-action-btn:focus-visible { outline: 2px solid var(--gc-blue); outline-offset: 2px; }
.gc-table-action-btn i { width: 16px; height: 16px; }

/* ── Table Badge / Chip Overflow Safety (Sprint 03.1) ── */
.gc-table .cp-badge,
.gc-table .gc-status-chip,
.gc-table .gc-pressure-badge,
.gc-table .gc-sla-pill,
.gc-table .gc-priority-tag {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex-shrink: 0;
}

.gc-td-rank { font-family: var(--gc-font-en); font-weight: 700; color: var(--gc-text-tertiary); width: 32px; }

/* ── City Row ── */
.gc-city-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.gc-city-name { font-size: 13px; font-weight: 500; color: var(--gc-text); display: flex; align-items: center; gap: 8px; min-width: 140px; font-family: var(--gc-font-ar); }
.gc-city-rank {
  width: 22px; height: 22px; border-radius: 6px; background: var(--gc-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--gc-text-tertiary); font-family: var(--gc-font-en); flex-shrink: 0;
}
.gc-city-sla { font-size: 13px; font-weight: 700; font-family: var(--gc-font-en); min-width: 50px; text-align: left; }

/* ── Channel Row ── */
.gc-channel-row { display: flex; align-items: center; gap: 12px; }
.gc-channel-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--gc-blue-soft);
  display: flex; align-items: center; justify-content: center; color: var(--gc-blue); flex-shrink: 0;
}
.gc-channel-icon i { width: 18px; height: 18px; }

/* ── Alerts ── */
.gc-alerts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gc-alert-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px;
  border-radius: 8px; border: 1px solid var(--gc-border-light);
}
.gc-alert-item i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.gc-alert-critical { background: var(--gc-critical-soft); border-color: rgba(199,53,45,0.15); }
.gc-alert-critical i { color: var(--gc-critical); }
.gc-alert-warning { background: var(--gc-warning-soft); border-color: rgba(217,144,0,0.15); }
.gc-alert-warning i { color: var(--gc-warning); }
.gc-alert-info { background: var(--gc-info-soft); border-color: rgba(14,116,144,0.15); }
.gc-alert-info i { color: var(--gc-info); }

/* ── Status Chip ── */
.gc-status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  font-family: var(--gc-font-ar); line-height: 1.25;
}

/* ── Tab Buttons ── */
.gc-tab-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--gc-border);
  background: var(--gc-surface); font-size: 12px; font-family: var(--gc-font-ar);
  color: var(--gc-text-secondary); transition: all 0.15s;
}
.gc-tab-btn:hover { background: var(--gc-muted); }
.gc-tab-btn.active { background: var(--gc-blue); color: #fff; border-color: var(--gc-blue); }

/* ── Action Button ── */
.gc-action-btn {
  display: flex; align-items: center; gap: 4px; padding: 5px 12px;
  border-radius: 6px; border: 1px solid var(--gc-border); background: var(--gc-surface);
  font-size: 12px; font-family: var(--gc-font-ar); color: var(--gc-blue);
  cursor: pointer; transition: all 0.15s;
}
.gc-action-btn:hover { background: var(--gc-blue-soft); }
.gc-action-btn i { width: 14px; height: 14px; }

/* ── Placeholder Screen ── */
.gc-placeholder { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.gc-placeholder-inner { text-align: center; }

/* ── Screen ── */
/* Screen transition handled by React */

/* ── Responsive ── */
@media (max-width: 1400px) {
  .gc-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .gc-grid-3 { grid-template-columns: 1fr 1fr; }
  .gc-alerts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .gc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .gc-grid-2 { grid-template-columns: 1fr; }
  .gc-grid-3 { grid-template-columns: 1fr; }
}

/* ── Shell Responsive (Sprint 02) ── */
@media (max-width: 900px) {
  .gc-topbar { padding: 8px 14px; gap: 8px; }
  .gc-topbar-title { max-width: 260px; font-size: 15px; }
  .gc-topbar-subtitle { max-width: 220px; }
  .gc-scope-badge { max-width: 180px; }
  .gc-role-badge { max-width: 160px; }
  .gc-content { padding: 16px 14px; }
}

/* ══════ NEW STYLES — MGT02 & MGT03 ══════ */

/* ── Filter Bar ── */
.gc-filter-bar { background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 12px 16px; margin-bottom: 20px; border: 1px solid var(--gc-border-light); box-shadow: var(--gc-shadow-sm); min-width: 0; }
.gc-filter-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; min-width: 0; }
.gc-filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 100px; flex: 1 1 120px; max-width: 220px; }
.gc-filter-label { font-size: 11px; font-weight: 600; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); }
.gc-filter-select { padding: 7px 10px; border: 1px solid var(--gc-border); border-radius: 6px; background: var(--gc-bg); font-size: 12px; font-family: var(--gc-font-ar); color: var(--gc-text); cursor: pointer; direction: rtl; width: 100%; min-width: 0; }
.gc-filter-select:focus { border-color: var(--gc-blue); outline: none; box-shadow: 0 0 0 2px rgba(20,93,160,0.12); }
.gc-filter-reset { display: flex; align-items: center; gap: 4px; padding: 7px 14px; border: 1px solid var(--gc-border); border-radius: 6px; background: var(--gc-surface); font-size: 12px; font-family: var(--gc-font-ar); color: var(--gc-text-secondary); cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.gc-filter-reset:hover { background: var(--gc-muted); }
.gc-filter-reset i { width: 14px; height: 14px; }

/* ── KPI Grid Variants ── */
.gc-kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.gc-kpi-grid-7 { grid-template-columns: repeat(7, 1fr); }
.gc-kpi-card-compact { padding: 14px 16px; }
.gc-kpi-icon-sm { width: 34px; height: 34px; border-radius: 8px; }
.gc-kpi-icon-sm i { width: 17px; height: 17px; }

/* ── Table Enhancements ── */
.gc-row-selected td { background: #EEF5FB !important; border-right: 3px solid var(--gc-blue); }
.gc-td-num { font-family: var(--gc-font-en); font-weight: 500; }
.gc-table-dept th, .gc-table-cities th { font-size: 11px; padding: 8px 10px; }
.gc-table-dept td, .gc-table-cities td { padding: 10px 10px; font-size: 12px; }

/* ── Pressure Badge ── */
.gc-pressure-badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; font-family: var(--gc-font-ar); white-space: nowrap; line-height: 1.25; }

/* ══════ Chart Layout System (Sprint 06C) ══════ */
.gc-chart-shell { display: flex; flex-direction: column; gap: 0; }
.gc-chart-viewport { position: relative; min-width: 0; }
.gc-chart-plot { position: relative; overflow: hidden; }
.gc-chart-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 6px 16px; direction: rtl; margin-bottom: 10px;
}
.gc-chart-legend-item {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  white-space: nowrap; font-size: 11px; font-weight: 500; line-height: 1.3;
  color: var(--gc-text-secondary); font-family: var(--gc-font-ar);
}
.gc-chart-legend-swatch { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 2px; }
.gc-chart-value-label {
  font-family: var(--gc-font-en); font-size: 10px; font-weight: 600;
  direction: ltr; unicode-bidi: isolate; pointer-events: none;
}
.gc-chart-marker-label {
  font-family: var(--gc-font-en); font-size: 10px; font-weight: 700;
  direction: ltr; unicode-bidi: isolate; pointer-events: none;
}
.gc-chart-tooltip {
  position: fixed; z-index: 850; pointer-events: none; max-width: 240px;
  padding: 8px 10px; border-radius: 9px; background: #FFFFFF;
  border: 1px solid var(--gc-border); box-shadow: var(--gc-shadow-md);
  color: var(--gc-text); font-family: var(--gc-font-ar);
  font-size: 11px; line-height: 1.45; direction: rtl;
}
.gc-chart-scroll { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.gc-chart-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; font-size: 13px; color: var(--gc-text-tertiary);
  font-family: var(--gc-font-ar);
}
/* Chart label halo helper — applied inline via paintOrder */

/* ── Two-line Clamp Utility (Sprint 06B) ── */
.gc-clamp-2,
.ca-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.45;
  max-height: 2.9em;
  overflow-wrap: anywhere;
}

/* ── Drawer ── */
.gc-drawer-overlay { position: fixed; inset: 0; background: rgba(11,46,74,0.3); backdrop-filter: blur(2px); z-index: 200; display: flex; justify-content: flex-start; }
.gc-drawer { width: 480px; max-width: 90vw; height: 100vh; background: var(--gc-surface); box-shadow: -4px 0 24px rgba(11,46,74,0.12); overflow-y: auto; padding: 24px; direction: rtl; }
.gc-drawer-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--gc-border-light); }
.gc-drawer-title { font-size: 17px; font-weight: 700; color: var(--gc-text); font-family: var(--gc-font-ar); line-height: 1.35; }
.gc-drawer-sub { font-size: 12px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); }
.gc-drawer-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--gc-border); background: var(--gc-surface); display: flex; align-items: center; justify-content: center; color: var(--gc-text-secondary); cursor: pointer; }
.gc-drawer-close:hover { background: var(--gc-muted); }
.gc-drawer-close i { width: 18px; height: 18px; }
.gc-drawer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.gc-drawer-metric { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px; background: var(--gc-bg); }
.gc-drawer-metric-icon { color: var(--gc-text-secondary); }
.gc-drawer-metric-icon i { width: 16px; height: 16px; }
.gc-drawer-metric-value { font-size: 15px; font-weight: 700; font-family: var(--gc-font-en); color: var(--gc-text); }
.gc-drawer-metric-label { font-size: 10px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); }
.gc-drawer-section { margin-bottom: 18px; }
.gc-drawer-section-title { font-size: 13px; font-weight: 700; color: var(--gc-text); font-family: var(--gc-font-ar); margin-bottom: 10px; }
.gc-drawer-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.gc-drawer-info-item { padding: 10px 12px; border-radius: 8px; background: var(--gc-bg); }
.gc-drawer-info-label { display: block; font-size: 10px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); margin-bottom: 2px; }
.gc-drawer-info-value { font-size: 13px; font-weight: 600; color: var(--gc-text); font-family: var(--gc-font-ar); }
.gc-drawer-recommendation { padding: 14px; border-radius: 10px; background: var(--gc-gold-soft); border: 1px solid rgba(198,154,46,0.15); margin-bottom: 18px; }
.gc-drawer-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; background: var(--gc-warning-soft); border: 1px solid rgba(217,144,0,0.12); font-size: 12px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar); margin-bottom: 18px; }
.gc-drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--gc-border-light); }

/* ── Buttons ── */
.gc-btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: none; background: var(--gc-blue); color: #fff; font-size: 13px; font-weight: 600; font-family: var(--gc-font-ar); cursor: pointer; transition: all 0.15s; line-height: 1.3; }
.gc-btn-primary:hover { background: var(--gc-blue-light); }
.gc-btn-primary i { width: 16px; height: 16px; }
.gc-btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--gc-border); background: var(--gc-surface); color: var(--gc-text); font-size: 13px; font-weight: 500; font-family: var(--gc-font-ar); cursor: pointer; transition: all 0.15s; line-height: 1.3; }
.gc-btn-secondary:hover { background: var(--gc-muted); }
.gc-btn-secondary i { width: 16px; height: 16px; color: var(--gc-blue); }

/* ── Comparison Grid ── */
.gc-comparison-grid { display: grid; grid-template-columns: 120px repeat(3, 1fr); gap: 0; }
.gc-comp-cell { padding: 10px 12px; border-bottom: 1px solid var(--gc-border-light); font-size: 13px; font-family: var(--gc-font-ar); text-align: center; }
.gc-comp-header { font-weight: 700; background: var(--gc-muted); }
.gc-comp-city-header { font-size: 13px; }
.gc-comp-label { text-align: right; font-weight: 500; color: var(--gc-text-secondary); font-size: 12px; }
.gc-comp-value { font-family: var(--gc-font-en); font-weight: 500; }
.gc-comp-best { background: var(--gc-success-soft); font-weight: 700; color: var(--gc-success); }

/* ── Insight Card ── */
.gc-insight-card { background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 20px; box-shadow: var(--gc-shadow-sm); border: 1px solid var(--gc-border-light); border-right: 3px solid var(--gc-navy); }

/* ── Export Card ── */
.gc-export-card { background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 20px; box-shadow: var(--gc-shadow-sm); border: 1px solid var(--gc-border-light); }
.gc-export-meta { display: flex; flex-direction: column; gap: 8px; }
.gc-export-meta-row { display: flex; justify-content: space-between; font-size: 13px; font-family: var(--gc-font-ar); padding: 4px 0; border-bottom: 1px solid var(--gc-border-light); }
.gc-export-meta-label { color: var(--gc-text-secondary); }
.gc-export-meta-value { color: var(--gc-text); font-weight: 500; }

/* ── Aging Highlight ── */
.gc-aging-highlight { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; background: var(--gc-critical-soft); border: 1px solid rgba(199,53,45,0.1); font-size: 12px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar); margin-top: 10px; }

/* ── Delay Reason Tags ── */
.gc-delay-reason-tag { display: inline-flex; padding: 4px 10px; border-radius: 6px; background: var(--gc-muted); font-size: 11px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar); border: 1px solid var(--gc-border-light); }

/* ── Responsive for new grids ── */
@media (max-width: 1400px) {
  .gc-kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .gc-kpi-grid-7 { grid-template-columns: repeat(4, 1fr); }
  .gc-drawer-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .gc-kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .gc-kpi-grid-7 { grid-template-columns: repeat(2, 1fr); }
  .gc-drawer { width: 100%; max-width: 100vw; }
  .gc-filter-row { flex-direction: column; }
  .gc-filter-item { min-width: auto; }
  .gc-comparison-grid { grid-template-columns: 80px repeat(3, 1fr); }
}

/* ══════ SLA Screen Styles ══════ */
.gc-kpi-grid-8 { grid-template-columns: repeat(4, 1fr); }

/* Alert Strip */
.gc-sla-alert-strip {
  display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  background: var(--gc-critical-soft); border: 1px solid rgba(199,53,45,0.12);
  border-radius: var(--gc-radius-md); margin-bottom: 24px;
}
.gc-sla-alert-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--gc-critical); font-family: var(--gc-font-ar); white-space: nowrap; }
.gc-sla-alert-items { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.gc-sla-alert-chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; background: var(--gc-surface); font-size: 12px; font-family: var(--gc-font-ar); color: var(--gc-text-secondary); border-right: 3px solid transparent; }

/* Response Cards */
.gc-resp-card { background: var(--gc-surface); border-radius: var(--gc-radius-md); padding: 20px; box-shadow: var(--gc-shadow-sm); border: 1px solid var(--gc-border-light); }
.gc-resp-metric { padding: 10px; border-radius: 8px; background: var(--gc-bg); text-align: center; }

/* Risk Cards */
.gc-risk-card { padding: 16px; border-radius: var(--gc-radius-md); background: var(--gc-surface); border: 1px solid var(--gc-border-light); border-top: 3px solid transparent; text-align: center; }

/* Chart Insight */
.gc-chart-insight { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 6px; background: var(--gc-blue-soft); font-size: 12px; color: var(--gc-text-secondary); font-family: var(--gc-font-ar); margin-top: 10px; }

/* SLA Pills */
.gc-sla-pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; font-family: var(--gc-font-ar); }

/* Priority Tags */
.gc-priority-tag { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: var(--gc-font-ar); }
.gc-priority-crit { background: var(--gc-critical-soft); color: var(--gc-critical); }
.gc-priority-high { background: var(--gc-warning-soft); color: var(--gc-warning); }
.gc-priority-med { background: var(--gc-blue-soft); color: var(--gc-blue); }

/* Matrix Table */
.gc-matrix-table td { padding: 8px 6px; }
.gc-matrix-table th { padding: 8px 6px; font-size: 11px; }

/* Responsive SLA */
@media (max-width: 1400px) { .gc-kpi-grid-8 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .gc-kpi-grid-8 { grid-template-columns: repeat(2, 1fr); } .gc-sla-alert-strip { flex-direction: column; align-items: flex-start; } }

/* ══════ Timeline + Delayed Screen ══════ */
.gc-timeline { display: flex; flex-direction: column; gap: 0; }
.gc-timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.gc-timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; z-index: 1; }
.gc-timeline-line { position: absolute; right: 4px; top: 16px; bottom: 0; width: 2px; background: var(--gc-border-light); }
.gc-timeline-content { display: flex; flex-direction: column; gap: 2px; }

/* Governance Strip */
.gc-governance-strip { padding: 16px 20px; border-radius: var(--gc-radius-md); background: var(--gc-surface); border: 1px solid var(--gc-border-light); border-right: 3px solid var(--gc-navy); box-shadow: var(--gc-shadow-sm); }
/* Priority info tag */
.gc-priority-info { background: var(--gc-info-soft); color: var(--gc-info); }

/* Heat Cards */
.gc-heat-card { padding: 16px; border-radius: var(--gc-radius-md); background: var(--gc-surface); border: 1px solid var(--gc-border-light); border-top: 3px solid transparent; box-shadow: var(--gc-shadow-sm); transition: box-shadow 0.2s, transform 0.15s; }
.gc-heat-card:hover { box-shadow: var(--gc-shadow-md); transform: translateY(-1px); }

/* KPI Drill-down */
.gc-kpi-drill { cursor: pointer; border-radius: var(--gc-radius-md); transition: transform 0.15s, box-shadow 0.15s; }
.gc-kpi-drill:hover { transform: translateY(-2px); }
.gc-kpi-drill:hover .gc-kpi-card { box-shadow: var(--gc-shadow-md); border-color: var(--gc-blue); }
/* Permission-aware export */
.gc-btn-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.gc-permission-note { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 6px; background: var(--gc-muted); font-size: 11px; color: var(--gc-text-tertiary); font-family: var(--gc-font-ar); }
.gc-permission-note i { width: 14px; height: 14px; }
/* Role scope badge in topbar */
.gc-role-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 6px; background: rgba(20,93,160,0.08); font-size: 11px;
  color: var(--gc-blue); font-family: var(--gc-font-ar); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px; flex-shrink: 1;
}
.gc-role-badge i { width: 12px; height: 12px; flex-shrink: 0; }

/* ── LTR Token Utility (ticket IDs, numbers in RTL context) ── */
.gc-ltr-token { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ══════ Mobile / Tablet Responsive (all portals) ══════ */
.gc-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--gc-border);
  background: var(--gc-surface);
  color: var(--gc-text);
  flex-shrink: 0;
  margin-left: 8px;
}
.gc-mobile-menu-btn i { width: 20px; height: 20px; }

.gc-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
  border: 0;
  padding: 0;
  background: rgba(11, 46, 74, 0.45);
  cursor: pointer;
}

@media (max-width: 768px) {
  .gc-mobile-menu-btn { display: inline-flex; }
  body.gc-mobile-nav-open { overflow: hidden; }
  body.gc-mobile-nav-open .gc-sidebar-backdrop { display: block; }

  .gc-sidebar {
    width: min(88vw, var(--sidebar-w)) !important;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
    box-shadow: none;
  }
  .gc-sidebar.gc-sidebar--open {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(11, 46, 74, 0.25);
  }
  .gc-sidebar-toggle { display: none; }

  .gc-main,
  .gc-main.gc-main--collapsed {
    margin-right: 0 !important;
  }

  .gc-topbar { padding: 8px 12px; }
  .gc-topbar-right { flex: 1 1 100%; }
  .gc-topbar-title {
    max-width: none;
    white-space: normal;
    font-size: 15px;
  }
  .gc-topbar-subtitle {
    max-width: none;
    white-space: normal;
  }
  .gc-topbar-update { display: none; }
  .gc-content { padding: 14px 12px; }

  .gc-kpi-grid,
  .gc-kpi-grid-5,
  .gc-kpi-grid-7,
  .gc-kpi-grid-8,
  .adm-kpi-grid,
  .adm-kpi-grid-4 {
    grid-template-columns: 1fr !important;
  }

  .gc-filter-row { flex-direction: column; align-items: stretch; }
  .gc-filter-item { max-width: none; flex: 1 1 100%; }
  .gc-drawer-metrics,
  .gc-drawer-info-grid { grid-template-columns: 1fr; }
  .gc-comparison-grid { grid-template-columns: 1fr; }
  .gc-sla-alert-strip { flex-direction: column; align-items: flex-start; }

  .gc-table-wrap {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--gc-radius-sm);
  }
  .gc-scroll-hint { display: flex; }
}

@media (max-width: 600px) {
  .gc-kpi-grid { grid-template-columns: 1fr !important; }
  .gc-grid-2,
  .gc-grid-3 { grid-template-columns: 1fr; }
  .gc-topbar-left .gc-date-select { display: none; }
}

@media (max-width: 480px) {
  .gc-auth-page { padding: 16px 12px; }
  .gc-auth-card { padding: 24px 18px; }
}
