/* Pro-Muovere prototype — global rules that cannot be inline (layout frame, hover, focus,
   media queries). Everything else is inline style over tokens.js. Spec: design/docs/architecture.md. */

:root {
  --pm-primary: #1f5fa8;
  --pm-primary-hover: #174b86;
  --pm-header: #0f2a44;
  --pm-text: #1b2733;
  --pm-muted: #5b6b7a;
  --pm-bg: #f4f6f8;
  --pm-surface: #ffffff;
  --pm-border: #d9dee3;
  --pm-focus: #ffbf00;
  --pm-success: #15672f;
  --pm-danger: #b42318;
  --pm-header-h: 56px;
  --pm-menu-w: 248px;
  --pm-menu-collapsed-w: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--pm-bg);
  color: var(--pm-text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--pm-primary);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--pm-focus);
  outline-offset: 2px;
}

.pm-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #fff;
  color: var(--pm-primary);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1000;
}
.pm-skip-link:focus {
  left: 8px;
}

.pm-runtime-error,
.pm-loading {
  margin: 40px auto;
  max-width: 640px;
  padding: 16px 20px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--pm-border);
}
.pm-runtime-error {
  border-color: var(--pm-danger);
  color: var(--pm-danger);
}

/* ---------- The application frame (design-brief.md "The application frame") ---------- */

.pm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--pm-header-h);
  z-index: 50;
}

.pm-menu {
  position: fixed;
  top: var(--pm-header-h);
  bottom: 0;
  left: 0;
  width: var(--pm-menu-w);
  overflow-y: auto;
  z-index: 40;
  transition: width 0.15s ease;
}
.pm-shell--collapsed .pm-menu {
  width: var(--pm-menu-collapsed-w);
}

.pm-content {
  padding: calc(var(--pm-header-h) + 20px) 28px 48px calc(var(--pm-menu-w) + 28px);
  min-height: 100vh;
  transition: padding-left 0.15s ease;
}
.pm-shell--collapsed .pm-content {
  padding-left: calc(var(--pm-menu-collapsed-w) + 28px);
}

.pm-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pm-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pm-menu-item:hover {
  background: #eef1f4;
}
.pm-menu-item[aria-current='page'] {
  background: #e8f0fa;
  color: var(--pm-primary);
  font-weight: 600;
}
.pm-shell--collapsed .pm-menu-item {
  justify-content: center;
  padding: 10px 0;
}
.pm-shell--collapsed .pm-menu-label,
.pm-shell--collapsed .pm-menu-group,
.pm-shell--collapsed .pm-menu-foot-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
}
.pm-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}
.pm-chip[aria-current='true'] {
  background: #fff;
  color: var(--pm-header);
  font-weight: 600;
}

/* ---------- Buttons (design-brief.md "Buttons") ---------- */

.pm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.pm-btn--sm {
  padding: 5px 10px;
  font-size: 13px;
}
.pm-btn--primary {
  background: var(--pm-primary);
  color: #fff;
}
.pm-btn--primary:hover {
  background: var(--pm-primary-hover);
}
.pm-btn--success {
  background: var(--pm-success);
  color: #fff;
}
.pm-btn--success:hover {
  background: #0f4f23;
}
.pm-btn--secondary {
  background: #fff;
  color: var(--pm-text);
  border-color: var(--pm-border);
}
.pm-btn--secondary:hover {
  background: #f4f6f8;
}
.pm-btn--danger {
  background: var(--pm-danger);
  color: #fff;
}
.pm-btn--danger:hover {
  background: #8f1c13;
}
.pm-btn--ghost {
  background: transparent;
  color: var(--pm-primary);
}
.pm-btn--ghost:hover {
  background: #e8f0fa;
}
.pm-btn--on-dark {
  background: #fff;
  color: var(--pm-header);
}
.pm-btn--on-dark:hover {
  background: #e8f0fa;
}
.pm-btn:disabled {
  background: #eef1f4;
  color: #8a97a3;
  border-color: #e9edf0;
  cursor: not-allowed;
}
.pm-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.pm-iconbtn:hover {
  background: rgba(0, 0, 0, 0.06);
}
.pm-iconbtn--on-dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Tables and lists (design-brief.md "Search and lists") ---------- */

.pm-table {
  width: 100%;
  border-collapse: collapse;
}
.pm-table th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pm-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--pm-border);
}
.pm-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e9edf0;
  vertical-align: middle;
}
.pm-table tr[tabindex]:hover,
.pm-table tr[tabindex]:focus-visible {
  background: #f4f6f8;
  cursor: pointer;
}
.pm-table tr[aria-current='true'] {
  background: #e8f0fa;
}

.pm-rowlink {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.pm-rowlink:hover {
  background: #f4f6f8;
}

/* ---------- Side panel (design-brief.md "The side panel") ---------- */

.pm-scrim {
  position: fixed;
  top: var(--pm-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 42, 68, 0.45);
  z-index: 60;
}
.pm-panel {
  position: fixed;
  top: var(--pm-header-h);
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  z-index: 70;
  display: flex;
  flex-direction: column;
  animation: pm-slide-in 0.18s ease-out;
}
.pm-panel--wide {
  width: 640px;
}
@keyframes pm-slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ---------- Tabs ---------- */

.pm-tab {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--pm-muted);
  font-weight: 600;
  cursor: pointer;
}
.pm-tab[aria-selected='true'] {
  color: var(--pm-primary);
  border-bottom-color: var(--pm-primary);
}
.pm-tab:hover {
  color: var(--pm-text);
}

/* ---------- Forms ---------- */

.pm-input,
.pm-select,
.pm-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--pm-border);
  border-radius: 6px;
  background: #fff;
}
.pm-input:focus,
.pm-select:focus,
.pm-textarea:focus {
  border-color: var(--pm-primary);
}
.pm-input[aria-invalid='true'],
.pm-select[aria-invalid='true'] {
  border-color: var(--pm-danger);
}

/* ---------- Login role cards ---------- */

.pm-rolecard {
  display: block;
  padding: 16px;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.pm-rolecard:hover {
  border-color: var(--pm-primary);
  box-shadow: 0 2px 10px rgba(31, 95, 168, 0.15);
}

/* ---------- Toasts ---------- */

.pm-toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}

/* ---------- Responsive (desktop → tablet → smartphone) ---------- */

@media (max-width: 960px) {
  .pm-menu {
    width: var(--pm-menu-collapsed-w);
  }
  .pm-content {
    padding-left: calc(var(--pm-menu-collapsed-w) + 16px);
    padding-right: 16px;
  }
  .pm-shell--expanded-mobile .pm-menu {
    width: var(--pm-menu-w);
  }
}
@media (max-width: 640px) {
  .pm-panel,
  .pm-panel--wide {
    width: 100%;
  }
  .pm-header-sede {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-panel,
  .pm-menu,
  .pm-content {
    animation: none;
    transition: none;
  }
}

/* ---------- App mobile shell ---------- */

/* The top bar stays above the scrim and the panel (its actions slot holds the panel's buttons);
   the panel takes the full width below it. */
.pm-mobile-bar {
  z-index: 75;
}
.pm-mobile .pm-scrim,
.pm-mobile .pm-panel {
  top: 52px;
}
.pm-mobile .pm-panel,
.pm-mobile .pm-panel--wide {
  width: 100%;
}
