@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f1117;
  --bg-raised: #161b27;
  --surface: #1a2030;
  --surface-soft: #111621;
  --surface-white: #1a2030;
  --ink: #e8edf8;
  --muted: #8a9bc0;
  --line: #2a3347;
  --line-dark: #3a4a67;
  --emerald: #4f7cff;
  --mint: #00d4aa;
  --lime: #7c5cfc;
  --amber: #7c5cfc;
  --coral: #ff6b81;
  --blue: #4f7cff;
  --focus: #7c9cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  --shadow-small: 0 12px 34px rgba(0, 0, 0, .24);
  --font-ar: 'Cairo', sans-serif;
  --font-latin: 'DM Mono', monospace;
  --font-mono: 'DM Mono', monospace;
  --radius: 14px;
}

body.app-page {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 85% -15%, rgba(79, 124, 255, .12), transparent 34rem),
    var(--bg);
  font-family: var(--font-ar);
}

.app-topbar {
  height: 68px;
  border-bottom-color: var(--line);
  background: rgba(15, 17, 23, .88);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
}

.brand {
  font-size: 16px;
  letter-spacing: -.03em;
}

.brand-mark {
  border-radius: 11px;
  background: linear-gradient(135deg, #4f7cff, #7c5cfc);
  color: white;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .25);
}

.nav-actions a {
  color: #aab6d0;
  transition: color .18s ease, background .18s ease;
}

.nav-actions a:hover,
.nav-actions a.active {
  color: #fff;
}

.nav-actions a:after {
  background: linear-gradient(90deg, var(--blue), #9b7cff);
}

.nav-avatar {
  border-color: var(--line-dark) !important;
  background: var(--bg-raised);
  color: #d7dded !important;
}

.nav-actions a.nav-logout {
  display: inline-flex;
  min-width: 0;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-inline-start: 10px;
  padding: 0 12px;
  border: 1px solid #554052;
  border-radius: 8px;
  background: rgba(255, 107, 129, .08);
  color: #ffb1bd;
  font-size: 12px;
}

.nav-actions a.nav-logout:after {
  display: none;
}

.nav-actions a.nav-logout:hover {
  border-color: #a65368;
  background: rgba(255, 107, 129, .16);
  color: #ffd2d9;
}

.nav-logout b {
  font-family: var(--font-mono);
  font-weight: 500;
}

.workspace-shell {
  width: min(1380px, 100%);
  padding-top: clamp(30px, 4vw, 56px);
}

.workspace-heading,
.creator-heading,
.grading-heading {
  border-bottom-color: var(--line);
}

.workspace-heading h1,
.creator-heading h1,
.grading-heading h1 {
  color: #f3f5fb;
  letter-spacing: -.035em;
}

.workspace-heading p,
.metric-label,
.metric-panel small,
.section-heading .eyebrow,
.creator-progress,
.grading-state {
  color: var(--muted);
}

.eyebrow {
  color: #8daaff;
}

.primary {
  background: linear-gradient(135deg, #4f7cff, #7157e8);
  color: white;
  box-shadow: 0 10px 24px rgba(79, 124, 255, .22);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #638bff, #8269f0);
  box-shadow: 0 14px 30px rgba(79, 124, 255, .3);
}

.secondary {
  border-color: var(--line-dark);
  background: #20283a;
  color: #e8edf8;
}

.secondary:hover:not(:disabled) {
  border-color: #62749b;
  background: #273149;
}

button[aria-busy="true"] {
  position: relative;
  cursor: progress;
}

button[aria-busy="true"]:disabled {
  opacity: .78;
}

.async-action-active {
  cursor: progress;
  opacity: .72;
  pointer-events: none;
}

.async-action-feedback {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  min-width: 0;
  padding: 3px 5px;
  border-radius: inherit;
  background: rgba(15, 17, 23, .94);
  color: #fff;
  font-size: clamp(9px, 2.8vw, 12px);
  line-height: 1.1;
  text-align: center;
}

.async-action-feedback-label {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.async-action-feedback-with-skeleton .async-action-skeleton {
  position: absolute;
  z-index: 0;
  inset: 4px;
  grid-column: auto;
  gap: 4px;
  width: auto;
  margin: 0;
  padding: 6px;
  border: 0;
  background: transparent;
  opacity: .35;
  pointer-events: none;
}

.async-action-feedback::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: currentColor;
  border-radius: 50%;
  content: "";
  animation: async-action-spin .8s linear infinite;
}

.async-action-skeleton {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  width: min(100%, 360px);
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(26, 32, 48, .72);
}

.async-action-skeleton i {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #20283a 25%, #35415a 45%, #20283a 65%);
  background-size: 220% 100%;
  animation: async-action-shimmer 1.4s ease-in-out infinite;
}

.async-action-skeleton i:nth-child(2) {
  width: 78%;
}

.async-action-skeleton i:nth-child(3) {
  width: 52%;
}

.upload-button[aria-busy="true"] {
  cursor: progress;
  opacity: .78;
}

@keyframes async-action-spin {
  to { transform: rotate(360deg); }
}

@keyframes async-action-shimmer {
  to { background-position: -220% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .async-action-feedback::before,
  .async-action-skeleton i {
    animation: none;
  }
}
