/* RRB-EXCEPTION: dashboard.rrbsecurity.nl is a standalone colleague start screen.
   The user explicitly requested Apple/iCloud-inspired styling instead of the RRB Framework. */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.12);
  --shadow: 0 18px 60px rgba(29, 29, 31, 0.12);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --radius-panel: 24px;
  --radius-control: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background:
    linear-gradient(145deg, rgba(225, 239, 255, 0.95), rgba(249, 251, 246, 0.96) 46%, rgba(255, 244, 238, 0.98)),
    var(--bg);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
}

.skip-link:focus {
  transform: translateY(0);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.login-panel {
  width: min(100%, 380px);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 34px 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.2);
}

.login-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #007aff, #34c759);
  color: #fff;
  font-weight: 800;
}

.login-panel h1,
.app-topbar h1,
.start-hero h2,
.widget h3 {
  margin: 0;
}

.login-panel h1 {
  font-size: 32px;
  line-height: 1.05;
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.microsoft-button,
.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.microsoft-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 14px;
  background: #1d1d1f;
  color: #fff;
  font-weight: 700;
}

.microsoft-grid {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.microsoft-grid i:nth-child(1) { background: #f25022; }
.microsoft-grid i:nth-child(2) { background: #7fba00; }
.microsoft-grid i:nth-child(3) { background: #00a4ef; }
.microsoft-grid i:nth-child(4) { background: #ffb900; }

.app-shell {
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 14px max(26px, env(safe-area-inset-bottom));
}

.app-topbar {
  width: min(100%, 1120px);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.app-topbar h1 {
  font-size: 28px;
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-badge {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(29, 29, 31, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.icon-button {
  min-height: 38px;
  min-width: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  box-shadow: 0 6px 20px rgba(29, 29, 31, 0.08);
}

.text-button {
  width: auto;
  padding: 0 14px;
  font-weight: 700;
}

.page-root {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
  outline: none;
}

.start-hero,
.widget,
.loading-panel {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.25);
}

.start-hero {
  min-height: 136px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 20px;
}

.start-hero h2 {
  font-size: 30px;
  line-height: 1.05;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: var(--radius-control);
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  justify-self: start;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.core-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(29, 29, 31, 0.09);
}

.app-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--tile-color, #007aff);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 20px rgba(0, 0, 0, 0.12);
}

.core-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.core-card strong,
.portal-tile span:last-child,
.row-main strong {
  overflow-wrap: anywhere;
}

.core-card small,
.row-main small,
.widget-header span {
  color: var(--muted);
  font-size: 13px;
}

.status-ok {
  color: var(--green) !important;
}

.status-error {
  color: var(--red) !important;
}

.widget {
  min-width: 0;
  padding: 16px;
}

.widget-header {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.widget h3 {
  font-size: 17px;
  line-height: 1.2;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 10px;
}

.portal-tile {
  min-width: 0;
  position: relative;
}

.portal-tile > a {
  min-height: 92px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  text-align: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.portal-icon {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border-radius: 17px;
}

.link-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.link-action {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.link-action.danger {
  color: var(--red);
}

.content-grid {
  display: grid;
  gap: 14px;
}

.list-stack {
  display: grid;
  gap: 8px;
}

.list-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.list-row:first-child {
  border-top: 0;
}

.row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-main strong {
  font-size: 14px;
  line-height: 1.25;
}

.row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.empty-state,
.loading-panel {
  min-height: 86px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.loading-panel {
  grid-auto-flow: column;
  justify-content: center;
  gap: 10px;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 1; }
}

.link-dialog {
  width: min(92vw, 430px);
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: transparent;
}

.link-dialog::backdrop {
  background: rgba(29, 29, 31, 0.34);
  backdrop-filter: blur(10px);
}

.link-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.dialog-header,
.dialog-actions,
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialog-header {
  justify-content: space-between;
}

.dialog-header h3 {
  margin: 0;
}

.link-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.link-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.link-form input[type="color"] {
  padding: 4px;
}

.form-row > label {
  flex: 1 1 0;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.dialog-actions {
  justify-content: flex-end;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 24px;
  }

  .app-topbar {
    margin-bottom: 18px;
  }

  .app-topbar h1 {
    font-size: 34px;
  }

  .page-root {
    gap: 18px;
  }

  .start-hero {
    min-height: 176px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 28px;
  }

  .start-hero h2 {
    font-size: 44px;
  }

  .core-grid {
    gap: 16px;
  }

  .core-card {
    min-height: 118px;
    padding: 18px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
  }

  .widget {
    padding: 20px;
  }

  .portal-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .app-topbar h1 {
    font-size: 24px;
  }

  .text-button {
    padding: 0 10px;
  }

  .start-hero h2 {
    font-size: 26px;
  }

  .core-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
