*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:          #1B2D5B;
  --blue-dark:     #0f1e3d;
  --yellow:        #F5C400;
  --white:         #ffffff;
  --header-height: 62px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #eef0f4;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  user-select: none;
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.header-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .07em;
}

.header-brand-tagline {
  font-size: .52rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: .2rem;
}

/* ── User area ── */
.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: rgba(255,255,255,.88);
  font-size: .855rem;
  font-weight: 500;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

.btn-logout {
  padding: .4rem 1.1rem;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.38);
  border-radius: 7px;
  color: rgba(255,255,255,.9);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-logout:hover:not(:disabled) {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.7);
}

.btn-logout:disabled { opacity: .6; cursor: not-allowed; }

/* ── Main ── */
.main-content {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* ── Loading state ── */
.loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: #eef0f4;
  color: #5a6078;
  font-size: .9rem;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3.5px solid #d4d8e4;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

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

/* ── Error state ── */
.error-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  text-align: center;
  color: #4a5270;
  background: #eef0f4;
}

.error-state p {
  font-size: .95rem;
  max-width: 420px;
  line-height: 1.6;
}

.error-state button {
  padding: .55rem 1.6rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.error-state button:hover { background: var(--blue-dark); }

/* ── PowerBI iframe ── */
.powerbi-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .header { padding: 0 1rem; }
  .header-brand-tagline { display: none; }
  .user-badge span:not(.user-dot) { display: none; }
}

/* ── Botão Alterar Password ── */
.btn-change-pwd {
  padding: .42rem .9rem;
  background: transparent;
  color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.btn-change-pwd:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}

/* ── Modal overlay ── */
.cpwd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,20,46,.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(3px);
}
.cpwd-overlay[hidden] { display: none; }

.cpwd-modal {
  background: #fff;
  border-radius: 12px;
  width: min(420px, calc(100vw - 2rem));
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
  animation: cpwd-in .18s ease;
}
@keyframes cpwd-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cpwd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.cpwd-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
}
.cpwd-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .15s;
}
.cpwd-close:hover { color: var(--blue); }

.cpwd-field {
  margin-bottom: 1.1rem;
}
.cpwd-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #444;
  margin-bottom: .35rem;
  letter-spacing: .02em;
}
.cpwd-field input {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #d0d5de;
  border-radius: 7px;
  font-size: .9rem;
  font-family: inherit;
  color: #222;
  transition: border-color .18s;
  outline: none;
}
.cpwd-field input:focus {
  border-color: var(--blue);
}

/* Strength bar */
.cpwd-strength {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .45rem;
}
.cpwd-strength-bar {
  flex: 1;
  height: 5px;
  background: #e4e7ef;
  border-radius: 99px;
  overflow: hidden;
}
.cpwd-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width .25s, background .25s;
}
.cpwd-strength-label {
  font-size: .72rem;
  font-weight: 600;
  min-width: 52px;
  color: #888;
}

/* Feedback */
.cpwd-feedback {
  padding: .65rem .9rem;
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 500;
  margin-bottom: .9rem;
}
.cpwd-feedback[hidden] { display: none; }
.cpwd-feedback.error {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}
.cpwd-feedback.success {
  background: #f0faf3;
  color: #1e7e43;
  border: 1px solid #b7e4c7;
}

.cpwd-actions {
  margin-top: 1.4rem;
}
.cpwd-btn-primary {
  width: 100%;
  padding: .72rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s;
}
.cpwd-btn-primary:hover:not(:disabled) {
  background: var(--blue-dark);
}
.cpwd-btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}
