/* App styles — consume the firm tokens from tokens.css (load that first).
   Skeleton (gray scale, Heebo, radii, shadows) is shared with the suite.
   Accent is periodic-reports' OWN violet identity (matches the .ico-pr launcher tile) —
   "same family, different sibling", not an indigo AR clone. */
:root {
  --accent-100: #EDE9FE;  /* violet-100 */
  --accent-500: #8B5CF6;  /* violet-500 */
  --accent-600: #7C3AED;  /* violet-600 — primary */
  --accent-700: #6D28D9;  /* violet-700 — hover */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-he);
  line-height: var(--leading-he);
  background: var(--gray-50);
  color: var(--gray-900);
}
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* loading */
#loading { display: flex; align-items: center; justify-content: center; }
.spinner {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  border: 4px solid var(--gray-200); border-top-color: var(--accent-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
#login { display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-xl);
  padding: var(--sp-8); width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: var(--sp-3);
  box-shadow: var(--shadow-lg);
}
.login-logo { max-width: 180px; height: auto; align-self: center; margin-bottom: var(--sp-2); }
.card .sub { margin: 0 0 var(--sp-2); color: var(--gray-500); font-size: var(--text-sm); text-align: center; }
.card label { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--text-sm); color: var(--gray-700); }
.card input {
  padding: var(--sp-3); border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: var(--text-base); font-family: inherit; transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.card input:focus {
  outline: none; border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-100);
}
.card button {
  margin-top: var(--sp-2); padding: var(--sp-3); border: none; border-radius: var(--radius-md);
  background: var(--accent-600); color: #fff; font-size: var(--text-base); font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background var(--transition-fast);
}
.card button:hover { background: var(--accent-700); }
.error { color: var(--danger-700); font-size: var(--text-sm); margin: 0; }

/* app shell */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-5); background: #fff; border-bottom: 1px solid var(--gray-200);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); }
.brand-logo { height: 28px; width: auto; }
.brand-app { font-weight: 600; color: var(--accent-600); font-size: var(--text-base); }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-4); }
.who { color: var(--gray-500); font-size: var(--text-sm); }
.link { background: none; border: none; color: var(--accent-600); cursor: pointer; font-family: inherit; font-size: var(--text-sm); }
.apps-launcher { position: relative; }
#apps-btn {
  background: none; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3); cursor: pointer; font-family: inherit; color: var(--gray-700);
}
.apps-menu {
  position: absolute; inset-inline-start: 0; top: 110%; margin: 0; padding: var(--sp-1);
  list-style: none; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); min-width: 180px; box-shadow: var(--shadow-lg);
}
.apps-menu li { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); }
.apps-menu li a { color: var(--gray-900); text-decoration: none; display: block; }
.apps-menu li:hover { background: var(--gray-50); }
.apps-menu li.current { color: var(--accent-600); font-weight: 600; }
.content { padding: var(--sp-8) var(--sp-5); }
.muted { color: var(--gray-500); }
