/* SAP Student Sales Copilot — calm light theme */
:root {
  --bc-blue: #1769e0;
  --bc-blue-600: #0f56c4;
  --bc-blue-50: #edf4ff;
  --bc-navy: #092b57;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dfe6f0;
  --surface: #f4f7fb;
  --green: #15803d;
  --green-50: #ecfdf3;
  --amber: #b45309;
  --amber-50: #fff7ed;
  --red: #b91c1c;
  --red-50: #fef2f2;
}
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"], .ar { font-family: "IBM Plex Sans Arabic", "Inter", sans-serif; }
.num { font-variant-numeric: tabular-nums; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.025); }
.app-header { background: rgba(255,255,255,.94); box-shadow: 0 1px 0 rgba(15,23,42,.03); z-index: 10; }
.app-sidebar { background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%) !important; }
.app-sidebar { transition: width .18s ease, padding .18s ease; }
.app-sidebar.collapsed { width: 68px !important; padding-left: 9px !important; padding-right: 9px !important; }
.app-sidebar.collapsed .nav-label, .app-sidebar.collapsed .mt-auto { display: none; }
.app-sidebar.collapsed .nav-item, .app-sidebar.collapsed .sidebar-toggle { justify-content: center; }
.sidebar-toggle { margin-left: auto; }
.app-sidebar.collapsed .sidebar-toggle { margin-left: 0; }
.mapping-table-card { width: 100%; }
.app-sidebar .nav-item { min-height: 38px; }
.page-enter { animation: pageIn .18s ease-out; }
@keyframes pageIn { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-pop { animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.toast-slide { animation: toastSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.muted { color: var(--muted); }
.label { font-size: 11px; color: var(--muted); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 500; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface); border-color: #d6dce6; }
.btn:focus-visible, .seg:focus-visible, .nav-item:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--bc-blue); outline-offset: 1px;
}
.btn-primary { background: var(--bc-blue); border-color: var(--bc-blue); color: #fff; }
.btn-primary:hover { background: var(--bc-blue-600); border-color: var(--bc-blue-600); }
.btn-success { background: var(--green-50) !important; border-color: #bbf7d0 !important; color: var(--green) !important; }
.btn-icon { width: 34px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; }
.pill-green { background: var(--green-50); color: var(--green); }
.pill-blue { background: var(--bc-blue-50); color: var(--bc-blue); }
.pill-amber { background: var(--amber-50); color: var(--amber); }
.pill-red { background: var(--red-50); color: var(--red); }
.pill-gray { background: #f1f5f9; color: #475569; }

.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: #334155; font-weight: 550; cursor: pointer; border: 0; background: none; text-align: left; font-size: 12.5px; transition: background .15s, color .15s, transform .15s; }
.nav-item:hover { background: var(--surface); }
.nav-item:hover { transform: translateX(1px); }
.nav-item.active { background: var(--bc-blue-50); color: var(--bc-blue); box-shadow: inset 3px 0 0 var(--bc-blue); }

.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 2px; margin-right: 22px; border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; font-size: 12.5px; }
.tab.active { color: var(--bc-blue); border-bottom-color: var(--bc-blue); }

.seg { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 4px; cursor: pointer; text-align: center; font-weight: 500; font-size: 12.5px; }
.seg:hover { border-color: #c7d2e3; }
.seg.active { border-color: var(--bc-blue); background: var(--bc-blue-50); color: var(--bc-blue); box-shadow: 0 0 0 1px var(--bc-blue) inset; }

.input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; background: #fff; width: 100%; }
.input:focus { border-color: var(--bc-blue); outline: none; box-shadow: 0 0 0 3px rgba(11,79,209,.12); }

.tooltip { position: relative; cursor: help; border-bottom: 1px dotted currentColor; }
.tooltip::after { content: attr(data-tooltip); position: absolute; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: #102a4f; color: #fff; font-size: 11px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .14s, transform .14s; z-index: 30; box-shadow: 0 8px 24px rgba(15,23,42,.18); }
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; transform: translateY(0); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; cursor: pointer; user-select: none; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f0f2f6; vertical-align: top; }
.tbl tr:hover td { background: #fafbfd; }

.tbl-compact th { padding: 5px 8px !important; font-size: 11px !important; }
.tbl-compact td { padding: 4.5px 8px !important; font-size: 11.5px !important; vertical-align: middle !important; }

.skel { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #dfe4ec; border-radius: 8px; }
kbd { font-family: inherit; font-size: 10.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: #fff; }

@media (max-width: 980px) {
  .app-header { padding-left: 14px !important; padding-right: 14px !important; }
  .app-header .text-\[15px\] { font-size: 14px; }
  .app-header .text-\[11\.5px\] { display: none; }
  .app-header .btn span { display: none; }
  .app-header .btn { padding-left: 9px !important; padding-right: 9px !important; }
  .app-sidebar { width: 68px !important; padding: 10px 8px !important; }
  .app-sidebar .nav-item { justify-content: center; padding: 10px 0; }
  .app-sidebar .nav-label, .app-sidebar .mt-auto { display: none; }
  .app-sidebar .nav-item.active { box-shadow: inset 0 -3px 0 var(--bc-blue); }
}

@media (max-width: 700px) {
  body { font-size: 12.5px; }
  .app-header { height: auto !important; min-height: 58px; gap: 10px; flex-wrap: wrap; padding-top: 10px !important; padding-bottom: 10px !important; }
  .app-header > div:last-child { margin-left: auto; }
  main { padding: 12px !important; }
  form { flex-wrap: wrap; }
  form > .relative { min-width: 100%; max-width: none !important; }
  form > .btn-primary { flex: 1; justify-content: center; }
  .card { border-radius: 12px; }
  .tbl { min-width: 620px; }
  .quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tooltip::after { left: auto; right: 0; }
}

@media (max-width: 460px) {
  .app-header .pill { display: none; }
  .app-header .w-px, .app-header .leading-\[1\.05\] { display: none; }
  .app-header .gap-4 { gap: 8px; }
  .quick-actions-grid { grid-template-columns: 1fr !important; }
  .app-sidebar { width: 54px !important; }
  .app-sidebar .nav-item { min-height: 36px; }
}

