/* ============================================================
   Digitol Minder 3.0 — Design System CSS
   Tokens mirrored from DM2.0 skin.css
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --dm-primary:        #5222D0;
  --dm-primary-hover:  #4318B8;
  --dm-primary-ring:   rgba(82,34,208,0.12);
  --dm-primary-bg:     #F0EBFA;

  --dm-bg:             #F7F7F7;
  --dm-surface:        #FFFFFF;
  --dm-border:         #DBDBDB;

  --dm-text:           #373D3F;
  --dm-text-secondary: #7F7F84;
  --dm-text-dim:       #9CA3AF;

  --dm-green:          #10B981;
  --dm-red:            #EB4D3D;
  --dm-yellow:         #F59E0B;
  --dm-gray:           #7F7F84;

  --dm-shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --dm-shadow-md:      0 2px 8px rgba(0,0,0,0.12);
  --dm-font:           'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --dm-radius:         8px;
  --dm-radius-lg:      14px;
  --dm-radius-sm:      4px;

  --dm-topbar-h:       52px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  background: var(--dm-bg);
  color: var(--dm-text);
  font-family: var(--dm-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
a { color: var(--dm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   TOPBAR
   ============================================================ */
.dm-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--dm-topbar-h);
  background: var(--dm-surface);
  border-bottom: 1px solid var(--dm-border);
  box-shadow: var(--dm-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}
.dm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
}
.dm-logo-icon {
  width: 32px; height: 32px;
  background: var(--dm-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
}
.dm-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--dm-text);
  letter-spacing: -0.01em;
}
.dm-logo-text span {
  color: var(--dm-primary);
}
.dm-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dm-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--dm-radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--dm-text-secondary);
  text-decoration: none !important;
  transition: background .15s, color .15s;
}
.dm-nav-link:hover,
.dm-nav-link.active {
  background: var(--dm-primary-bg);
  color: var(--dm-primary);
}
.dm-nav-link .material-icons { font-size: 17px; }

.dm-topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--dm-text-secondary);
}
.dm-topbar-user .material-icons { font-size: 20px; }
.dm-logout-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--dm-radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-text-secondary);
  background: none;
  border: 1px solid var(--dm-border);
  cursor: pointer;
  text-decoration: none !important;
  transition: border-color .15s, color .15s;
}
.dm-logout-btn:hover { border-color: var(--dm-primary); color: var(--dm-primary); }
.dm-logout-btn .material-icons { font-size: 15px; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.dm-main {
  margin-top: var(--dm-topbar-h);
  padding: 24px 24px 40px;
  min-height: calc(100vh - var(--dm-topbar-h));
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.dm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.dm-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dm-text);
  margin: 0;
}
.dm-status-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #f0f0f0;
  color: var(--dm-text-secondary);
  border: 1px solid var(--dm-border);
}
.dm-pill.online  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.dm-pill.offline { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.dm-pill.warn    { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.dm-pill .material-icons { font-size: 13px; }

/* ============================================================
   CAMERA GRID (Console page)
   ============================================================ */
.dm-camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.dm-camera-card {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius-lg);
  overflow: hidden;
  box-shadow: var(--dm-shadow-sm);
  transition: box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.dm-camera-card:hover {
  box-shadow: var(--dm-shadow-md);
  border-color: #c5b8f0;
}
.dm-camera-thumb {
  position: relative;
  background: #1a1a2e;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-camera-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dm-camera-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #555;
}
.dm-camera-thumb-placeholder .material-icons { font-size: 40px; opacity: .4; }
.dm-camera-thumb-placeholder span { font-size: 11px; opacity: .5; }
.dm-camera-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}
.dm-camera-badge.live { background: rgba(16,185,129,.85); }
.dm-camera-info {
  padding: 12px 14px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dm-camera-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-camera-meta {
  font-size: 11px;
  color: var(--dm-text-secondary);
}
.dm-camera-pipelines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}
.dm-pipeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--dm-primary-bg);
  color: var(--dm-primary);
  border: 1px solid #d0c0f5;
}
.dm-pipeline-chip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dm-primary);
  flex-shrink: 0;
}
.dm-camera-footer {
  padding: 8px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--dm-border);
  margin-top: 4px;
}
.dm-camera-id {
  font-size: 11px;
  color: var(--dm-text-dim);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--dm-radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--dm-font);
  cursor: pointer;
  border: none;
  transition: opacity .15s, background .15s;
  text-decoration: none !important;
  white-space: nowrap;
}
.dm-btn .material-icons { font-size: 16px; }
.dm-btn-primary {
  background: var(--dm-primary);
  color: #fff;
}
.dm-btn-primary:hover { background: var(--dm-primary-hover); color: #fff; }
.dm-btn-outline {
  background: none;
  border: 1.5px solid var(--dm-border);
  color: var(--dm-text-secondary);
}
.dm-btn-outline:hover { border-color: var(--dm-primary); color: var(--dm-primary); }
.dm-btn-sm { padding: 4px 10px; font-size: 12px; }
.dm-btn-full { width: 100%; justify-content: center; }

/* ============================================================
   WATCH PAGE
   ============================================================ */
.dm-watch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dm-watch-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dm-text-secondary);
  text-decoration: none !important;
  padding: 5px 8px;
  border-radius: var(--dm-radius);
  transition: background .15s, color .15s;
}
.dm-watch-back:hover { background: var(--dm-primary-bg); color: var(--dm-primary); }
.dm-watch-back .material-icons { font-size: 18px; }
.dm-watch-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dm-text);
  margin: 0;
  flex: 1;
}

/* Mode bar */
.dm-modebar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  padding: 4px;
  width: fit-content;
}
.dm-mode-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--dm-font);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dm-mode-btn .material-icons { font-size: 15px; }
.dm-mode-btn:hover { background: var(--dm-primary-bg); color: var(--dm-primary); }
.dm-mode-btn.active { background: var(--dm-primary); color: #fff; }

/* Watch layout */
.dm-watch-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.dm-watch-player-wrap {
  flex: 1 1 0;
  min-width: 0;
  background: #111;
  border-radius: var(--dm-radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-watch-video,
.dm-watch-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dm-watch-nosignal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #555;
}
.dm-watch-nosignal .material-icons { font-size: 48px; opacity: .4; }
.dm-watch-nosignal span { font-size: 13px; opacity: .5; }

/* Routine panel */
.dm-routine-panel {
  flex: 0 0 400px;
  width: 400px;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  min-height: 400px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}
.dm-routine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--dm-border);
  background: var(--dm-primary-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.dm-routine-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--dm-primary);
}
.dm-routine-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: #e0e0e0;
  color: #666;
}
.dm-routine-badge.active  { background: #d4edda; color: #1a7f3c; }
.dm-routine-badge.waiting { background: #fff3cd; color: #856404; }

/* Pipelines section */
.dm-pipelines-section {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--dm-border);
  background: #fafafa;
}
.dm-pipelines-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.dm-pipelines-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #999;
}
.dm-pipeline-add-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--dm-primary-bg);
  border: 1.5px solid var(--dm-primary);
  color: var(--dm-primary);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background .15s;
}
.dm-pipeline-add-btn:hover { background: var(--dm-primary); color: #fff; }
.dm-pipelines-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dm-pipelines-table tr { border-bottom: 1px solid #f0f0f0; }
.dm-pipelines-table tr:last-child { border-bottom: none; }
.dm-pipelines-table td { padding: 4px 2px; vertical-align: middle; }
.dm-pipelines-table td:first-child { width: 8px; }
.dm-pl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dm-primary); display: inline-block; }
.dm-pl-name { font-weight: 600; color: #333; }
.dm-pl-tag  { font-size: 10px; color: #999; }
.dm-pl-del  { background: none; border: none; cursor: pointer; color: #ccc; padding: 0 2px; font-size: 14px; line-height: 1; display: flex; align-items: center; }
.dm-pl-del:hover { color: #dc2626; }
.dm-pipelines-empty { font-size: 11px; color: #bbb; padding: 2px 0; }
.dm-pipeline-add-row { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.dm-pipeline-select { flex: 1; font-size: 11px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 5px; background: #fff; }
.dm-pipeline-save-btn { font-size: 11px; font-weight: 600; padding: 3px 9px; background: var(--dm-primary); color: #fff; border: none; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.dm-pipeline-save-btn:hover { opacity: .85; }
.dm-pipeline-cancel-btn { font-size: 12px; padding: 3px 7px; background: none; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; color: #666; }

/* Stats row */
.dm-routine-stats {
  display: flex;
  border-bottom: 1px solid var(--dm-border);
  background: #fafafa;
}
.dm-routine-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-right: 1px solid var(--dm-border);
}
.dm-routine-stat:last-child { border-right: none; }
.dm-routine-stat-val { font-size: 18px; font-weight: 700; color: var(--dm-primary); line-height: 1.2; }
.dm-routine-stat-lbl { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* Step checklist */
.dm-routine-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px;
}
.dm-routine-steps-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; }
.dm-routine-model-badge { font-size: 10px; padding: 1px 7px; border-radius: 10px; background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.dm-routine-steps { list-style: none; margin: 0; padding: 0 0 4px; border-bottom: 1px solid var(--dm-border); }
.dm-step { display: flex; align-items: center; gap: 10px; padding: 5px 16px; }
.dm-step-num { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #ddd; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #bbb; background: #f8f8f8; }
.dm-step-label { color: #bbb; font-size: 12px; line-height: 1.3; flex: 1; }
.dm-step-label em { font-style: normal; color: #ccc; font-size: 11px; }
.dm-step-tag { font-size: 10px; color: #ccc; background: #f5f5f5; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.dm-step.done .dm-step-num   { border-color: #1a7f3c; background: #1a7f3c; color: #fff; }
.dm-step.done .dm-step-label { color: #1a7f3c; }
.dm-step.active .dm-step-num { border-color: var(--dm-primary); background: var(--dm-primary-bg); color: var(--dm-primary); animation: dm-pulse 1.2s infinite; }
.dm-step.active .dm-step-label { color: var(--dm-primary); font-weight: 600; }
@keyframes dm-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(82,34,208,.35); }
  50%      { box-shadow: 0 0 0 4px rgba(82,34,208,0); }
}

/* Event log */
.dm-routine-log-header { padding: 8px 16px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; }
.dm-routine-log { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; min-height: 120px; max-height: 260px; }
.dm-routine-log li { display: grid; grid-template-columns: 6px 52px 1fr; align-items: baseline; gap: 6px; padding: 5px 16px; font-size: 12px; color: #444; border-bottom: 1px solid #f4f4f4; }
.dm-routine-log li:last-child { border-bottom: none; }
.dm-log-time { color: #bbb; font-size: 10px; font-variant-numeric: tabular-nums; }
.dm-log-dot  { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; }
.dm-log-dot.green  { background: #1a7f3c; }
.dm-log-dot.blue   { background: #2563eb; }
.dm-log-dot.orange { background: #d97706; }
.dm-log-dot.red    { background: #dc2626; }
.dm-log-dot.gray   { background: #bbb; }

/* ============================================================
   ZONE EDITOR MODAL
   ============================================================ */
#dm-zone-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.dm-zone-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.dm-zone-dialog { position: relative; z-index: 1; background: #fff; border-radius: 12px; width: min(96vw, 1100px); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; }
.dm-zone-dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #e0e0e0; font-weight: 700; font-size: 15px; color: #222; background: var(--dm-primary-bg); }
.dm-zone-close-btn { background: none; border: none; cursor: pointer; padding: 2px; color: #666; display: flex; align-items: center; }
.dm-zone-close-btn:hover { color: #222; }
.dm-zone-dialog-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.dm-zone-canvas-wrap { flex: 1; position: relative; background: #111; display: flex; align-items: center; justify-content: center; overflow: hidden; min-width: 0; }
.dm-zone-snap { display: block; max-width: 100%; max-height: 100%; user-select: none; pointer-events: none; }
#dm-zone-canvas { position: absolute; top: 0; left: 0; cursor: crosshair; touch-action: none; }
.dm-zone-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 20px; pointer-events: none; white-space: nowrap; }
.dm-zone-sidebar { width: 240px; flex-shrink: 0; border-left: 1px solid #e0e0e0; display: flex; flex-direction: column; padding: 12px; gap: 8px; overflow: hidden; }
.dm-zone-sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; flex-shrink: 0; }
.dm-zone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1 1 0; min-height: 0; scrollbar-width: thin; scrollbar-color: #d0c8f0 transparent; }
.dm-zone-list::-webkit-scrollbar { width: 4px; }
.dm-zone-list::-webkit-scrollbar-thumb { background: #d0c8f0; border-radius: 4px; }
.dm-zone-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; background: #f8f8f8; transition: border-color .15s, background .15s; }
.dm-zone-item:hover { background: #f0eeff; }
.dm-zone-item.selected { border-color: var(--dm-primary); background: #f0eeff; }
.dm-zone-item.has-polygon { background: #f0fff4; }
.dm-zone-item.has-polygon.selected { border-color: #1a7f3c; background: #e6f4ea; }
.dm-zone-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.dm-zone-name-input { flex: 1; border: none; background: transparent; font-size: 13px; font-weight: 600; color: #333; outline: none; min-width: 0; }
.dm-zone-delete-btn { background: none; border: none; cursor: pointer; color: #ccc; padding: 0; display: flex; align-items: center; font-size: 16px; }
.dm-zone-delete-btn:hover { color: #dc2626; }
.dm-zone-add-btn { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 7px; border: 1.5px dashed #ccc; background: none; cursor: pointer; font-size: 12px; color: #888; transition: border-color .15s, color .15s; flex-shrink: 0; font-family: var(--dm-font); }
.dm-zone-add-btn:hover { border-color: var(--dm-primary); color: var(--dm-primary); }
.dm-zone-add-btn .material-icons { font-size: 16px; }
.dm-zone-actions { display: flex; gap: 8px; margin-top: 4px; flex-shrink: 0; }
.dm-zone-actions .dm-btn { flex: 1; justify-content: center; }
.dm-zone-tip { font-size: 11px; color: #999; line-height: 1.5; background: #f8f8f8; border-radius: 6px; padding: 8px 10px; flex-shrink: 0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.dm-login-body {
  background: linear-gradient(135deg, #1a0a3d 0%, #2d1b69 50%, #1a0a3d 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}
.dm-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.dm-login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.dm-login-logo-icon {
  width: 48px; height: 48px;
  background: var(--dm-primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 28px;
}
.dm-login-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--dm-text);
}
.dm-login-version {
  font-size: 12px;
  color: var(--dm-text-secondary);
  margin-top: 2px;
}
.dm-login-form { display: flex; flex-direction: column; gap: 16px; }
.dm-field { display: flex; flex-direction: column; gap: 5px; }
.dm-field-label { font-size: 12px; font-weight: 600; color: var(--dm-text-secondary); }
.dm-field-input {
  padding: 10px 12px;
  border: 1.5px solid var(--dm-border);
  border-radius: var(--dm-radius);
  font-size: 14px;
  font-family: var(--dm-font);
  color: var(--dm-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.dm-field-input:focus { border-color: var(--dm-primary); box-shadow: 0 0 0 3px var(--dm-primary-ring); }
.dm-field-error { font-size: 11px; color: var(--dm-red); }
.dm-login-actions { margin-top: 4px; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.dm-alert {
  padding: 10px 14px;
  border-radius: var(--dm-radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.dm-alert-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.dm-alert-success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
