/*
 * Medilabor Brand System v4 — Premium Corporate Design
 * Colors extracted from the official logo: blue #2b3a8c + red #e31e24
 * Modern, comfortable, executive aesthetic with smooth micro-interactions.
 */

/* ─── COLOR PALETTE (from logo + refined neutrals) ─── */
:root {
  --ml-blue-950: #141d42;
  --ml-blue-900: #1a2350;
  --ml-blue-800: #232d6b;
  --ml-blue-700: #2b3a8c;      /* Logo blue "MEDI" */
  --ml-blue-600: #3d4fa3;
  --ml-blue-500: #4f62b8;
  --ml-blue-400: #5a6dbd;
  --ml-blue-300: #8a9ad4;
  --ml-blue-200: #c5cceb;
  --ml-blue-100: #e8eaf6;
  --ml-blue-50:  #f0f2fa;
  --ml-blue-25:  #f7f8fd;

  --ml-red-700: #b91a1f;
  --ml-red-600: #e31e24;       /* Logo red "LABOR" */
  --ml-red-500: #ef4444;
  --ml-red-400: #f87171;
  --ml-red-100: #fee2e2;
  --ml-red-50:  #fef2f2;

  --ml-slate-950: #0b1120;
  --ml-slate-900: #111827;
  --ml-slate-800: #1f2937;
  --ml-slate-700: #374151;
  --ml-slate-600: #4b5563;
  --ml-slate-500: #6b7280;
  --ml-slate-400: #9ca3af;
  --ml-slate-300: #d1d5db;
  --ml-slate-200: #e5e7eb;
  --ml-slate-150: #eef0f2;
  --ml-slate-100: #f3f4f6;
  --ml-slate-50:  #f9fafb;

  --ml-green-700: #047857;
  --ml-green-600: #059669;
  --ml-green-500: #10b981;
  --ml-green-100: #d1fae5;
  --ml-green-50:  #ecfdf5;

  --ml-white: #ffffff;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ml-slate-800);
  line-height: 1.6;
  background: var(--ml-slate-50);
}

/* ─── PAGE SHELL (proposal & shared) ─── */
.ml-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(43,58,140,.035) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(227,30,36,.015) 0%, transparent 50%),
    linear-gradient(180deg, var(--ml-slate-50) 0%, var(--ml-white) 40%, var(--ml-slate-50) 100%);
}

/* ─── DECORATIVE WAVE ─── */
.ml-wave {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  opacity: .08;
  line-height: 0;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Split-screen layout
   ═══════════════════════════════════════════════════════════════ */
.ml-login-page {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Left branding column */
.ml-login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
  background:
    radial-gradient(circle at 30% 70%, rgba(61,79,163,.12) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(227,30,36,.06) 0%, transparent 40%),
    linear-gradient(160deg, var(--ml-blue-900) 0%, var(--ml-blue-700) 50%, var(--ml-blue-600) 100%);
  color: var(--ml-white);
  overflow: hidden;
}

.ml-login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
  pointer-events: none;
}

.ml-login-left .ml-login-brand {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 420px;
}

.ml-login-left .ml-login-logo {
  max-width: 380px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.25));
}

.ml-login-left .ml-login-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .75rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.ml-login-left .ml-login-desc {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255,255,255,.75);
  line-height: 1.6;
}

.ml-login-left .ml-login-accent-line {
  width: 48px;
  height: 3px;
  background: var(--ml-red-600);
  border-radius: 2px;
  margin: 1.5rem auto;
}

.ml-login-left .ml-login-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
}

.ml-login-left .ml-login-features span {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Right form column */
.ml-login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--ml-slate-50);
  position: relative;
}

/* ─── CARD (universal) ─── */
.ml-card {
  background: var(--ml-white);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 0 0 1px rgba(43,58,140,.04),
    0 1px 1px rgba(43,58,140,.02),
    0 4px 8px rgba(43,58,140,.03),
    0 8px 16px rgba(43,58,140,.04),
    0 24px 48px rgba(43,58,140,.06);
  transition: transform .3s ease, box-shadow .3s ease;
}

.ml-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(43,58,140,.04),
    0 2px 4px rgba(43,58,140,.03),
    0 8px 16px rgba(43,58,140,.04),
    0 16px 32px rgba(43,58,140,.06),
    0 32px 64px rgba(43,58,140,.08);
}

.ml-card .ml-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.ml-card .ml-card-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ml-slate-900);
  letter-spacing: -.02em;
  margin-bottom: .375rem;
}

.ml-card .ml-card-header p {
  font-size: .875rem;
  color: var(--ml-slate-500);
  line-height: 1.5;
}

/* ─── FORM FIELDS ─── */
.ml-field {
  margin-bottom: 1.125rem;
}

.ml-field label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .8125rem;
  color: var(--ml-slate-700);
  letter-spacing: .01em;
}

.ml-field input,
.ml-field select {
  width: 100%;
  padding: .8rem 1rem;
  border: 1.5px solid var(--ml-slate-200);
  border-radius: 12px;
  background: var(--ml-white);
  color: var(--ml-slate-800);
  font-size: .9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.ml-field input::placeholder {
  color: var(--ml-slate-400);
  font-weight: 400;
}

.ml-field input:hover,
.ml-field select:hover {
  border-color: var(--ml-slate-300);
}

.ml-field input:focus,
.ml-field select:focus {
  border-color: var(--ml-blue-500);
  box-shadow: 0 0 0 3px rgba(43,58,140,.08), 0 0 0 1px rgba(43,58,140,.04);
  background: var(--ml-white);
}

.ml-field.has-error label { color: var(--ml-red-600); }

.ml-field.has-error input,
.ml-field.has-error select {
  border-color: var(--ml-red-400);
  box-shadow: 0 0 0 3px rgba(239,68,68,.06), 0 0 0 1px rgba(239,68,68,.04);
}

.ml-field.has-error input:focus,
.ml-field.has-error select:focus {
  border-color: var(--ml-red-500);
  box-shadow: 0 0 0 3px rgba(239,68,68,.10);
}

.ml-field-error-msg {
  display: block;
  margin-top: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--ml-red-600);
  animation: ml-fade-in-up .2s ease forwards;
  letter-spacing: .005em;
}

.ml-error-hint {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .25rem;
  font-size: .72rem;
  font-weight: 500;
  color: var(--ml-red-600);
}

.ml-error-hint svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

/* ─── PROPOSAL FORM: client-data section ─── */
.ml-form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ml-slate-150);
}

.ml-form-section-title {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ml-blue-700);
  margin-bottom: 1rem;
}

.ml-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 1.25rem;
}

@media (max-width: 640px) {
  .ml-field-grid {
    grid-template-columns: 1fr;
  }
}

.ml-drop.is-locked {
  opacity: .5;
  pointer-events: none;
  filter: grayscale(.4);
}

.ml-client-confirmed {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .75rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ml-green-600);
}

/* ─── PROPOSAL FORM: toggle row + employees section ─── */
.ml-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
}

.ml-optional-tag {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--ml-slate-100);
  color: var(--ml-slate-500);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ml-form-section-hint {
  font-size: .82rem;
  color: var(--ml-slate-500);
  line-height: 1.55;
  margin: -.5rem 0 1.125rem;
}

.ml-emp-form {
  background: var(--ml-slate-50);
  border: 1px solid var(--ml-slate-150);
  border-radius: 14px;
  padding: 1.125rem 1.25rem 1.25rem;
  margin-bottom: 1.125rem;
}

.ml-emp-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.ml-emp-empty {
  text-align: center;
  padding: 1.25rem;
  color: var(--ml-slate-400);
  font-size: .85rem;
  background: var(--ml-slate-50);
  border-radius: 12px;
  border: 1px dashed var(--ml-slate-200);
}

.ml-emp-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  background: var(--ml-white);
  border: 1px solid var(--ml-slate-150);
  border-radius: 12px;
}

.ml-emp-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--ml-slate-200);
}

.ml-emp-thumb--placeholder {
  background: var(--ml-slate-150);
}

.ml-emp-item-body {
  flex: 1;
  min-width: 0;
}

.ml-emp-item-name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ml-slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-emp-item-cargo {
  font-size: .78rem;
  color: var(--ml-slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-emp-item-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

.ml-emp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--ml-slate-200);
  background: var(--ml-white);
  color: var(--ml-slate-500);
  cursor: pointer;
  transition: all .2s ease;
}

.ml-emp-action:hover {
  border-color: var(--ml-blue-300);
  color: var(--ml-blue-700);
  background: var(--ml-blue-50);
}

.ml-emp-remove:hover {
  border-color: var(--ml-red-400);
  color: var(--ml-red-600);
  background: var(--ml-red-50);
}

.ml-emp-photo-preview {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-top: .625rem;
}

/* See the [hidden] note above .ml-crop-overlay[hidden]: same fix needed
   here, since this rule also sets `display`. */
.ml-emp-photo-preview[hidden] {
  display: none;
}

.ml-emp-photo-preview-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.ml-emp-photo-preview-avatar img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--ml-slate-200);
}

.ml-emp-recrop-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ml-blue-600);
  color: var(--ml-white);
  border: 2px solid var(--ml-white);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(11, 17, 32, .3);
  transition: background .2s ease;
}

.ml-emp-recrop-btn:hover {
  background: var(--ml-blue-800);
}

.ml-emp-photo-preview-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ml-green-600);
}

/* ─── PHOTO CROPPER (Discord-style avatar picker) ─── */
.ml-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(11, 17, 32, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* An author-stylesheet `display` value beats the UA stylesheet's
   `[hidden]{display:none}`, so the [hidden] attribute alone won't hide an
   element once its own class sets `display: flex` — this rule (attribute +
   class, so it wins on specificity) restores that. Same fix applies to
   .ml-emp-photo-preview below, for the same reason. */
.ml-crop-overlay[hidden] {
  display: none;
}

.ml-crop-modal {
  background: var(--ml-white);
  border-radius: 20px;
  padding: 1.75rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(11, 17, 32, .35);
}

.ml-crop-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ml-slate-900);
  margin-bottom: .35rem;
}

.ml-crop-hint {
  font-size: .8rem;
  color: var(--ml-slate-500);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.ml-crop-stage {
  width: 260px;
  height: 260px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--ml-slate-100);
  cursor: grab;
  box-shadow: 0 0 0 3px var(--ml-white), 0 0 0 4px var(--ml-slate-200);
  touch-action: none;
}

.ml-crop-stage.is-dragging {
  cursor: grabbing;
}

.ml-crop-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ml-crop-zoom {
  width: 100%;
  margin: 0 0 1.5rem;
  accent-color: var(--ml-blue-600);
}

.ml-crop-actions {
  display: flex;
  gap: .75rem;
}

.ml-crop-actions .ml-btn-ghost,
.ml-crop-actions .ml-btn {
  flex: 1;
}

/* ─── BUTTONS ─── */
.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .875rem 1.5rem;
  background: linear-gradient(135deg, var(--ml-blue-700) 0%, var(--ml-blue-600) 100%);
  color: var(--ml-white);
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: .9375rem;
  font-family: inherit;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 2px 8px rgba(43,58,140,.18), 0 4px 16px rgba(43,58,140,.10);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.ml-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
  opacity: 0;
  transition: opacity .25s ease;
}

.ml-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 16px rgba(43,58,140,.24), 0 8px 24px rgba(43,58,140,.12);
  transform: translateY(-1px);
}

.ml-btn:hover::after {
  opacity: 1;
}

.ml-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(43,58,140,.16);
  filter: brightness(.98);
}

.ml-btn:disabled {
  background: var(--ml-slate-200);
  color: var(--ml-slate-400);
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
  transform: none;
}

.ml-btn:disabled::after {
  display: none;
}

/* Secondary / ghost button */
.ml-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.25rem;
  background: transparent;
  color: var(--ml-blue-700);
  border: 1.5px solid var(--ml-blue-200);
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
}

.ml-btn-ghost:hover {
  background: var(--ml-blue-50);
  border-color: var(--ml-blue-300);
  color: var(--ml-blue-800);
  box-shadow: 0 2px 8px rgba(43,58,140,.06);
  transform: translateY(-1px);
}

.ml-btn-ghost:active {
  transform: translateY(0);
}

.ml-btn-ghost.is-open {
  background: var(--ml-blue-700);
  border-color: var(--ml-blue-700);
  color: var(--ml-white);
}

.ml-btn-ghost.is-open:hover {
  background: var(--ml-blue-800);
  color: var(--ml-white);
}

.ml-btn-ghost.is-open svg {
  transform: rotate(45deg);
  transition: transform .2s ease;
}

/* ─── ALERTS ─── */
.ml-alert {
  padding: .875rem 1rem;
  border-radius: 12px;
  font-size: .85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
}

.ml-alert--error {
  background: var(--ml-red-50);
  color: var(--ml-red-700);
  border: 1px solid var(--ml-red-100);
}

.ml-alert--success {
  background: var(--ml-green-50);
  color: var(--ml-green-700);
  border: 1px solid var(--ml-green-100);
}

/* ═══════════════════════════════════════════════════════════════
   TOPBAR (post-login)
   ═══════════════════════════════════════════════════════════════ */
.ml-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 2rem;
  background: linear-gradient(135deg, var(--ml-blue-950) 0%, var(--ml-blue-900) 60%, var(--ml-blue-800) 100%);
  box-shadow: 0 2px 16px rgba(11,17,32,.18);
  flex-shrink: 0;
}

.ml-topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ml-red-600) 0%, var(--ml-red-500) 50%, var(--ml-red-600) 100%);
  box-shadow: 0 1px 4px rgba(227,30,36,.3);
}

.ml-topbar .ml-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ml-topbar .ml-topbar-logo {
  display: flex;
  align-items: center;
}

.ml-topbar .ml-topbar-logo img {
  max-height: 28px;
  width: auto;
  filter: brightness(1.15) saturate(.9);
}

.ml-topbar .ml-topbar-title {
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,.12);
  line-height: 1.4;
}

.ml-topbar .ml-logout {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.18);
  padding: .4rem 1rem;
  border-radius: 999px;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  white-space: nowrap;
}

.ml-topbar .ml-logout:hover {
  color: var(--ml-white);
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.ml-topbar .ml-logout svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT & PANELS
   ═══════════════════════════════════════════════════════════════ */
.ml-content {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

/* Panel */
.ml-panel {
  background: var(--ml-white);
  border-radius: 20px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow:
    0 0 0 1px rgba(43,58,140,.03),
    0 2px 4px rgba(43,58,140,.02),
    0 8px 16px rgba(43,58,140,.03),
    0 16px 32px rgba(43,58,140,.04);
  transition: box-shadow .3s ease;
}

.ml-panel:hover {
  box-shadow:
    0 0 0 1px rgba(43,58,140,.04),
    0 4px 8px rgba(43,58,140,.03),
    0 12px 24px rgba(43,58,140,.04),
    0 24px 48px rgba(43,58,140,.06);
}

.ml-panel h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ml-slate-900);
  margin-bottom: .5rem;
  letter-spacing: -.015em;
  line-height: 1.3;
}

.ml-panel > p {
  color: var(--ml-slate-500);
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* Panel header row with actions */
.ml-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ml-panel-header .ml-panel-title h2 {
  margin-bottom: .25rem;
}

.ml-panel-header .ml-panel-title p {
  color: var(--ml-slate-500);
  font-size: .85rem;
  line-height: 1.5;
}

/* ─── DROP ZONE ─── */
.ml-drop {
  border: 2px dashed var(--ml-slate-300);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  background: var(--ml-slate-50);
  position: relative;
}

.ml-drop::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  border: 2px solid transparent;
  transition: border-color .25s ease;
  pointer-events: none;
}

.ml-drop:hover,
.ml-drop.drag {
  border-color: var(--ml-blue-400);
  background: var(--ml-blue-25);
}

.ml-drop:hover::before,
.ml-drop.drag::before {
  border-color: rgba(43,58,140,.08);
}

.ml-drop svg {
  color: var(--ml-blue-400);
  margin-bottom: .75rem;
  transition: transform .3s ease, color .3s ease;
}

.ml-drop:hover svg,
.ml-drop.drag svg {
  transform: translateY(-3px);
  color: var(--ml-blue-600);
}

.ml-drop label {
  cursor: pointer;
  font-weight: 600;
  color: var(--ml-blue-700);
  font-size: 1rem;
  display: block;
  margin-bottom: .25rem;
}

.ml-drop .ml-hint {
  display: block;
  color: var(--ml-slate-400);
  font-size: .8125rem;
  margin-top: .25rem;
}

.ml-drop input[type="file"] {
  display: none;
}

.ml-file-name {
  margin-top: .875rem;
  text-align: center;
  color: var(--ml-green-600);
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem;
  background: var(--ml-green-50);
  border-radius: 8px;
  border: 1px solid var(--ml-green-100);
}

/* ─── MUTED PANEL ─── */
.ml-panel--muted {
  background: var(--ml-slate-50);
  box-shadow: 0 0 0 1px rgba(43,58,140,.03);
}

.ml-panel--muted:hover {
  box-shadow: 0 0 0 1px rgba(43,58,140,.05), 0 4px 12px rgba(43,58,140,.03);
}

.ml-panel--muted h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ml-slate-800);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ml-panel--muted ul {
  padding-left: 1.25rem;
  color: var(--ml-slate-500);
  font-size: .85rem;
  line-height: 1.8;
}

.ml-panel--muted code {
  background: var(--ml-white);
  border: 1px solid var(--ml-slate-200);
  padding: .1rem .45rem;
  border-radius: 5px;
  color: var(--ml-blue-700);
  font-weight: 600;
  font-size: .8rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.ml-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ml-slate-950) 0%, var(--ml-blue-950) 100%);
  padding: 2rem;
  text-align: center;
  color: rgba(255,255,255,.7);
}

.ml-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--ml-red-600);
  border-radius: 2px;
}

.ml-footer-brand {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ml-white);
  letter-spacing: .01em;
  margin-bottom: .25rem;
}

.ml-footer-tag {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .5rem;
}

.ml-footer-copy {
  font-size: .72rem;
  color: rgba(255,255,255,.35);
}

.ml-footer-logo {
  max-height: 24px;
  width: auto;
  opacity: .7;
  margin-bottom: .75rem;
  filter: brightness(2);
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN FOOTER (light variant)
   ═══════════════════════════════════════════════════════════════ */
.ml-login-footer {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  text-align: center;
  font-size: .75rem;
  color: var(--ml-slate-400);
  background: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY LOG — audit trail panel
   ═══════════════════════════════════════════════════════════════ */
.ml-log-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ml-log-stat {
  flex: 1;
  background: var(--ml-white);
  border-radius: 12px;
  padding: .875rem 1rem;
  box-shadow: 0 0 0 1px rgba(43,58,140,.04), 0 2px 6px rgba(43,58,140,.03);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ml-log-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ml-log-stat-icon.success { background: var(--ml-green-50); color: var(--ml-green-600); }
.ml-log-stat-icon.error   { background: var(--ml-red-50); color: var(--ml-red-600); }
.ml-log-stat-icon.total   { background: var(--ml-blue-50); color: var(--ml-blue-600); }

.ml-log-stat-label {
  font-size: .75rem;
  color: var(--ml-slate-400);
  font-weight: 500;
}

.ml-log-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ml-slate-800);
  line-height: 1.2;
}

.ml-log-list {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.ml-log-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .5rem .625rem;
  border-radius: 8px;
  background: var(--ml-white);
  border: 1px solid var(--ml-slate-150);
  transition: all .2s ease;
}

.ml-log-item:hover {
  background: var(--ml-slate-50);
  border-color: var(--ml-slate-200);
}

.ml-log-item:first-child {
  border-color: var(--ml-blue-200);
  box-shadow: 0 0 0 1px var(--ml-blue-50), 0 2px 8px rgba(43,58,140,.06);
}

.ml-log-item:first-child .ml-log-item-title {
  color: var(--ml-blue-800);
}

/* ─── Pagination ─── */
.ml-log-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}

.ml-log-pagination .ml-log-page-info {
  font-size: .72rem;
  color: var(--ml-slate-400);
  white-space: nowrap;
}

.ml-log-pagination .ml-log-page-btns {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.ml-log-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 .5rem;
  border: 1px solid var(--ml-slate-200);
  border-radius: 6px;
  background: var(--ml-white);
  color: var(--ml-slate-600);
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}

.ml-log-pagination button:hover:not(:disabled) {
  background: var(--ml-slate-50);
  border-color: var(--ml-slate-300);
}

.ml-log-pagination button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.ml-log-pagination button.active {
  background: var(--ml-blue-700);
  border-color: var(--ml-blue-700);
  color: var(--ml-white);
}

.ml-log-pagination select {
  height: 28px;
  padding: 0 .375rem;
  border: 1px solid var(--ml-slate-200);
  border-radius: 6px;
  background: var(--ml-white);
  color: var(--ml-slate-600);
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.ml-log-pagination select:focus {
  border-color: var(--ml-blue-500);
  box-shadow: 0 0 0 2px rgba(43,58,140,.08);
}

.ml-log-item-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ml-log-item-icon.success { background: var(--ml-green-100); color: var(--ml-green-600); }
.ml-log-item-icon.error   { background: var(--ml-red-100); color: var(--ml-red-600); }

.ml-log-item-body {
  flex: 1;
  min-width: 0;
}

.ml-log-item-title {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ml-slate-700);
  line-height: 1.4;
  word-break: break-word;
}

.ml-log-item-meta {
  font-size: .72rem;
  color: var(--ml-slate-400);
  margin-top: .15rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.ml-log-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--ml-slate-400);
  font-size: .85rem;
}

.ml-log-error-detail {
  font-size: .72rem;
  color: var(--ml-red-600);
  margin-top: .25rem;
  padding: .35rem .5rem;
  background: var(--ml-red-50);
  border-radius: 6px;
  border-left: 2px solid var(--ml-red-400);
  line-height: 1.5;
  max-height: 60px;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes ml-fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ml-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

.ml-animate-in {
  animation: ml-fade-in-up .5s cubic-bezier(.4, 0, .2, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ml-login-page {
    flex-direction: column;
  }

  .ml-login-left {
    padding: 2rem 1.5rem 1.5rem;
    min-height: auto;
  }

  .ml-login-left .ml-login-logo {
    max-width: 240px;
    margin-bottom: 1.25rem;
  }

  .ml-login-left .ml-login-title {
    font-size: 1.3rem;
  }

  .ml-login-left .ml-login-features {
    display: none;
  }

  .ml-login-right {
    padding: 1.5rem 1rem 2rem;
    justify-content: flex-start;
  }

  .ml-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .ml-topbar {
    padding: .75rem 1rem;
  }

  .ml-topbar .ml-topbar-title {
    display: none;
  }

  .ml-content {
    padding: 1.5rem 1rem 1rem;
  }

  .ml-panel {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .ml-panel h2 {
    font-size: 1.1rem;
  }

  .ml-panel-header {
    flex-direction: column;
    gap: .75rem;
  }

  .ml-drop {
    padding: 1.75rem 1rem;
  }

  .ml-content > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  .ml-log-stats {
    flex-direction: column;
    gap: .5rem;
  }
}

@media (max-width: 480px) {
  .ml-login-left .ml-login-logo {
    max-width: 200px;
  }

  .ml-card {
    padding: 1.75rem 1.25rem;
    border-radius: 18px;
  }

  .ml-field input {
    padding: .7rem .875rem;
  }

  .ml-btn {
    padding: .75rem 1.25rem;
  }
}
