:root {
  --medica-primary: #0d6efd;
  --medica-dark: #0a3d62;
  --medica-bg: #f4f7fb;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--medica-bg);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Big transparent watermark behind all content */
.medica-watermark {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9vw;
  font-weight: 800;
  color: var(--medica-dark);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.app-navbar {
  background: linear-gradient(90deg, var(--medica-dark), var(--medica-primary));
  position: relative;
  z-index: 2;
}

.navbar-brand-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
}

.navbar-brand-logo img {
  height: 28px;
  width: auto;
  display: block;
}

.login-logo {
  height: 56px;
  width: auto;
}

.app-main {
  position: relative;
  z-index: 1;
  flex: 1;
}

.app-footer {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* ---------------- Auth pages ---------------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(10, 61, 98, 0.15);
}

/* ---------------- Dashboard cards ---------------- */
.dashboard-card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.12);
}

.dashboard-card-icon-wrap {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.25rem;
  color: #fff;
}

.dashboard-icon-img {
  max-height: 70px;
  max-width: 70px;
  object-fit: contain;
}

.dashboard-card-icon-wrap .dashboard-icon-img {
  max-height: 64px;
  max-width: 64px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.dashboard-card .card-body {
  display: flex;
  flex-direction: column;
}

.dashboard-card .card-text {
  flex: 1;
  color: #6c757d;
}

.empty-state {
  padding: 4rem 1rem;
  text-align: center;
  color: #6c757d;
}

.empty-state i {
  font-size: 3.5rem;
  opacity: 0.4;
  margin-bottom: 1rem;
}

/* ---------------- View Dashboard (iframe) ---------------- */
.dashboard-frame-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 480px;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  background: #fff;
}

.dashboard-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------------- Icon picker (add/edit dashboard) ---------------- */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.6rem;
  max-height: 340px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
}

.icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 2px solid #e9ecef;
  border-radius: 0.5rem;
  font-size: 1.4rem;
  color: #495057;
  cursor: pointer;
  background: #f8f9fa;
  transition: all 0.12s ease;
}

.icon-picker-item:hover {
  border-color: var(--medica-primary);
  color: var(--medica-primary);
  transform: scale(1.05);
}

.icon-picker-item.selected {
  border-color: var(--medica-primary);
  background: var(--medica-primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.icon-preview-box {
  width: 90px;
  height: 90px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: #f8f9fa;
  border: 1px dashed #ced4da;
  color: #fff;
}

/* ---------------- Wizard step headers ---------------- */
.wizard-step-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--medica-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.wizard-step-title .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--medica-primary);
  color: #fff;
  font-size: 0.95rem;
}

/* ---------------- Permission checklist ---------------- */
.dashboard-checklist {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
}

.dashboard-checklist .form-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #f1f3f5;
  margin: 0;
}

.dashboard-checklist .form-check:last-child {
  border-bottom: none;
}

.dashboard-checklist .check-icon {
  width: 30px;
  text-align: center;
  color: var(--medica-primary);
}

/* ---------------- Instructions page ---------------- */
.instructions-step {
  border-left: 4px solid var(--medica-primary);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-bottom: 1.75rem;
}

.instructions-step h4 {
  color: var(--medica-dark);
}

/* ---------------- Table icons ---------------- */
.table-icon-cell {
  width: 46px;
  height: 46px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
}
