/* CoWorQ Brand Identity */
:root {
  --navy:       #0A192F;
  --cyan-dark:  #00E5FF;
  --cyan-light: #008999;
  --cloud-white:#F6F9FC;
  --cool-grey:  #F5F7FA;
  --slate-mist: #8FA3B8;
  --soft-mint:  #7FE7D3;
  --amber:      #F4C97A;
  --white:      #FFFFFF;
  --error:      #dc2626;
  --font-heading:'Montserrat', sans-serif;
  --font-body:   'Inter', sans-serif;
  --crit-critical:(220,38,38);
  --crit-high:    (234,88,12);
  --crit-medium:  (202,138,4);
  --crit-low:     (22,163,74);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); font-size: 15px; color: var(--navy);
       background: var(--cloud-white); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, label { font-family: var(--font-heading); }
.hidden { display: none !important; }

/* ── Shared buttons ─────────────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  padding: 10px 20px; background: var(--cyan-light); color: var(--white);
  border: none; border-radius: 8px; cursor: pointer;
  transition: background .2s, transform .1s; text-align: center;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover:not(:disabled) { background: #007585; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: var(--slate-mist); cursor: not-allowed; opacity: .6; }

.btn-secondary {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  padding: 10px 20px; background: transparent; color: var(--cyan-light);
  border: 2px solid var(--cyan-light); border-radius: 8px; cursor: pointer;
  transition: background .2s, color .2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover:not(:disabled) { background: var(--cyan-light); color: var(--white); }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-small { padding: 6px 14px; font-size: 13px; }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; background: var(--navy);
}
.login-container {
  width: 100%; max-width: 420px; background: var(--white);
  border-radius: 16px; padding: 48px 40px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-header { text-align: center; margin-bottom: 8px; }
.logo { width: 160px; margin-bottom: 16px; }
.app-title { font-size: 32px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.app-subtitle { font-size: 14px; color: var(--slate-mist); margin-top: 4px; }
.divider { border: none; border-top: 1px solid var(--cool-grey); margin: 24px 0; }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 600; }
.form-group input, .form-group select {
  font-family: var(--font-body); font-size: 15px; padding: 12px 14px;
  border: 1px solid #d1d9e6; border-radius: 8px; outline: none;
  transition: border-color .2s; color: var(--navy); background: var(--cool-grey);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--cyan-light);
  box-shadow: 0 0 0 3px rgba(0,137,153,.1);
}
.password-wrapper { position: relative; }
.password-wrapper input { width: 100%; padding-right: 44px; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--slate-mist); cursor: pointer; padding: 4px;
}
.toggle-password:hover { color: var(--navy); }
.btn-sign-in { margin-top: 4px; width: 100%; justify-content: center; }
.error-msg { color: var(--error); font-size: 14px; text-align: center; }
.btn-danger {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  padding: 10px 20px; background: var(--error); color: var(--white);
  border: none; border-radius: 8px; cursor: pointer;
  transition: background .2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { background: #b91c1c; }
.conflict-box {
  margin-top: 16px; padding: 14px 16px;
  background: #fff7ed; border: 1.5px solid #f97316; border-radius: 10px;
}
.conflict-msg { font-size: 13px; color: #7c2d12; margin: 0 0 12px; line-height: 1.5; }
.conflict-actions { display: flex; gap: 10px; justify-content: flex-end; }
.footer-note { text-align: center; font-size: 13px; color: var(--slate-mist); margin-top: 24px; }

/* ══════════════════════════════════════════
   APP PAGE — full-height two-column layout
══════════════════════════════════════════ */
.app-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* ── Header ─────────────────────────────── */
.app-header {
  background: var(--navy); padding: 0 28px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 30px; filter: brightness(0) invert(1); }
.header-title { font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -.3px; }
.header-nav { display: flex; align-items: center; gap: 14px; }
.badge {
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  background: var(--soft-mint); color: var(--navy); padding: 5px 12px; border-radius: 20px;
}
.header-nav .btn-secondary { color: var(--cyan-dark); border-color: var(--cyan-dark); }
.header-nav .btn-secondary:hover { background: var(--cyan-dark); color: var(--navy); }

/* ── Workspace ───────────────────────────── */
.workspace { flex: 1; display: flex; overflow: hidden; }

/* ── Left panel ──────────────────────────── */
.left-panel {
  width: 380px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid #e2e8f0;
  display: flex; flex-direction: column; overflow: hidden; padding: 16px;
  gap: 12px;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--slate-mist);
                    text-transform: uppercase; letter-spacing: .4px; }
.form-group select {
  font-family: var(--font-body); font-size: 13px; padding: 7px 10px;
  border: 1px solid #d1d9e6; border-radius: 6px; outline: none;
  color: var(--navy); background: var(--cool-grey);
  transition: border-color .2s;
}
.form-group select:focus { border-color: var(--cyan-light); }

/* Upload zone */
.upload-zone {
  border: 2px dashed #d1d9e6; border-radius: 10px; padding: 14px;
  text-align: center; transition: border-color .2s, background .2s; flex-shrink: 0;
}
.upload-zone.dragover { border-color: var(--cyan-light); background: rgba(0,137,153,.04); }
.upload-icon { color: var(--slate-mist); margin-bottom: 6px; }
.upload-text { font-size: 12px; color: var(--slate-mist); margin-bottom: 8px; }

/* Image list */
.image-list-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--slate-mist);
  text-transform: uppercase; letter-spacing: .4px; flex-shrink: 0;
}
.list-count { font-weight: 400; text-transform: none; letter-spacing: 0; }
.image-list {
  flex: 1; overflow-y: auto; border: 1px solid #e2e8f0;
  border-radius: 8px; min-height: 80px;
}
.image-list-empty {
  padding: 24px; text-align: center; font-size: 13px; color: var(--slate-mist);
}

/* Image rows */
.image-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto 24px;
  align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid #f0f4f8;
  cursor: pointer; transition: background .15s; font-size: 13px;
}
.image-row:last-child { border-bottom: none; }
.image-row:hover { background: var(--cool-grey); }
.image-row.selected { background: rgba(0,137,153,.08); }

.row-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500; font-size: 12px;
}
.row-lang, .row-domain {
  font-size: 11px; color: var(--slate-mist); white-space: nowrap;
}
.row-delete {
  background: none; border: none; cursor: pointer; color: var(--slate-mist);
  font-size: 12px; padding: 2px 4px; border-radius: 4px; line-height: 1;
  transition: color .15s, background .15s;
}
.row-delete:hover { color: var(--error); background: #fef2f2; }

/* Status icons — pure CSS circles / checks */
.status-icon {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: inline-block;
}
.status-pending  { border: 2px solid var(--slate-mist); background: transparent; }
.status-scanning {
  background: #f97316;
  animation: pulse 1.1s ease-in-out infinite;
}
.status-scanned  { background: #16a34a; position: relative; }
.status-scanned::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700; line-height: 16px;
  text-align: center;
}
.status-error    { background: var(--error); position: relative; }
.status-error::after {
  content: '✕'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(.85); }
}

/* Action buttons */
.action-buttons {
  display: flex; gap: 8px; flex-shrink: 0;
}
.btn-action { flex: 1; justify-content: center; padding: 10px 12px; font-size: 13px; }

/* ── Right panel — scrolls as one tall column ── */
.right-panel {
  flex: 1; min-width: 0; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--cloud-white);
}

/* Viewer pane — fixed viewport height so it's always visible at top */
.viewer-pane {
  height: 52vh; flex-shrink: 0; display: flex; flex-direction: column;
  border-bottom: 1px solid #e2e8f0;
}
.viewer-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--white); border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.viewer-filename { font-size: 13px; font-weight: 600; color: var(--navy);
                   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.zoom-btn {
  width: 26px; height: 26px; border: 1px solid #d1d9e6; border-radius: 5px;
  background: var(--white); cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.zoom-btn:hover { background: var(--cool-grey); }
.zoom-level { font-size: 12px; color: var(--slate-mist); min-width: 40px; text-align: center; }

.viewer-scroll {
  flex: 1; min-height: 0; overflow: auto; background: #e5e9f0;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 12px;
}
.viewer-placeholder {
  margin: auto; text-align: center; color: var(--slate-mist); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}
.viewer-img {
  max-width: none; display: block;
  transform-origin: top left; transition: transform .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

/* Violations pane — natural height, grows with content */
.violations-pane { display: flex; flex-direction: column; }
.violations-meta {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 8px 14px; background: var(--white); border-bottom: 1px solid #e2e8f0;
  font-size: 12px; color: var(--slate-mist); min-height: 38px;
}
.meta-item { font-weight: 500; color: var(--navy); }
.meta-sep  { color: #d1d9e6; }
.meta-scanning { color: #f97316; font-weight: 600; }
.meta-error    { color: var(--error); font-weight: 600; }

.violations-scroll {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 80px;
}
.violations-placeholder {
  font-size: 13px; color: var(--slate-mist); text-align: center; margin-top: 24px;
}
.no-violations {
  font-size: 14px; color: #16a34a; font-weight: 600; text-align: center; margin-top: 20px;
}

/* Violation cards */
.violation-card {
  background: var(--white); border-radius: 8px;
  border-left: 4px solid #d1d9e6;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}
.crit-critical { border-left-color: #dc2626; }
.crit-high     { border-left-color: #ea580c; }
.crit-medium   { border-left-color: #ca8a04; }
.crit-low      { border-left-color: #16a34a; }

.vc-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.vc-header:hover { background: rgba(0,0,0,.03); }

.vc-badge {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px;
  flex-shrink: 0;
}
.crit-critical-badge { background: #fee2e2; color: #dc2626; }
.crit-high-badge     { background: #ffedd5; color: #ea580c; }
.crit-medium-badge   { background: #fefce8; color: #ca8a04; }
.crit-low-badge      { background: #dcfce7; color: #16a34a; }
.crit-unknown-badge  { background: var(--cool-grey); color: var(--slate-mist); }

.vc-title {
  font-weight: 600; font-size: 13px; color: var(--navy); flex: 1;
}
.vc-chevron {
  font-size: 11px; color: var(--slate-mist); flex-shrink: 0;
  transform: rotate(-90deg); transition: transform .2s ease;
}
.violation-card.expanded .vc-chevron { transform: rotate(0deg); }

/* Collapsible body */
.vc-body {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
  padding: 0 12px;
}
.violation-card.expanded .vc-body {
  max-height: 2000px;
  padding: 0 12px 10px;
}

.vc-row  { display: grid; grid-template-columns: 120px 1fr; gap: 4px; padding: 3px 0;
           border-top: 1px solid var(--cool-grey); }
.vc-label { font-size: 11px; font-weight: 600; color: var(--slate-mist);
            text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }
.vc-value { font-size: 12px; color: var(--navy); line-height: 1.5; }
