@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Color Palette - Colsubsidio Brand (Navy Blue, Yellow, White & Soft Gray) */
  --bg-app: #f2f5fa;
  --bg-rail: #001858;
  --bg-rail-dark: #001140;
  --bg-card: #ffffff;
  --bg-subtle: #f0f4fa;
  --bg-hover: #e4ecf7;
  --bg-accent-light: #ebf1ff;
  
  --brand-navy: #001b69;
  --brand-navy-dark: #001142;
  --brand-navy-light: #002c9b;
  --brand-yellow: #ffe600;
  --brand-yellow-hover: #f0d800;
  --brand-yellow-subtle: #fffde6;
  
  --text-main: #00103d;
  --text-secondary: #3b4a6b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-dark: #ffffff;
  
  --border-subtle: #f0f4fa;
  --border-light: #e1e7f0;
  --border-medium: #cbd5e1;
  --border-dark: #002b9e;
  
  --accent-black: #001b69;
  --accent-dark-hover: #001142;
  
  --status-warn-bg: #fffbe6;
  --status-warn-border: #ffe58f;
  --status-warn-text: #d48806;
  
  --status-danger-bg: #fff1f0;
  --status-danger-border: #ffa39e;
  --status-danger-text: #cf1322;
  
  --shadow-sm: 0 1px 3px rgba(0, 27, 105, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 24, 88, 0.07), 0 1px 2px rgba(0, 24, 88, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 24, 88, 0.1), 0 2px 6px rgba(0, 24, 88, 0.05);
  --shadow-dialog: 0 25px 65px -10px rgba(0, 17, 66, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Left Sidebar / Rail - Colsubsidio Deep Navy */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  background: linear-gradient(180deg, var(--bg-rail) 0%, var(--bg-rail-dark) 100%);
  color: var(--text-on-dark);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-dark);
  box-shadow: 4px 0 24px rgba(0, 17, 66, 0.2);
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.brand-logo {
  width: 100%;
  max-width: 222px;
  height: auto;
  max-height: 95px;
  object-fit: contain;
  align-self: center;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.brand div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.brand b {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-align: center;
}

.brand small {
  color: var(--brand-yellow);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Main Navigation in Blue Rail */
.main-nav {
  margin: 28px 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin: 0 0 6px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item .nav-icon {
  font-size: 16px;
  display: grid;
  place-items: center;
  margin-left: auto;
}

.nav-item:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: var(--brand-yellow);
  color: var(--brand-navy-dark);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 230, 0, 0.3);
}

/* Steps Navigation */
.steps {
  margin: 20px 0;
  display: grid;
  gap: 8px;
}

.step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #94a3b8;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.step span {
  order: 1;
  text-align: left;
}

.step i {
  order: 2;
  margin-left: auto;
  font-style: normal;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.step:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.step.active {
  background: var(--brand-yellow);
  color: var(--brand-navy-dark);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 230, 0, 0.3);
}

.step.active i {
  background: var(--brand-navy-dark);
  color: var(--brand-yellow);
  border-color: var(--brand-navy-dark);
  font-weight: 800;
}

.rail-button {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-on-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.rail-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--brand-yellow);
  color: var(--brand-yellow);
}

.rail-button.attention:after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-yellow);
  margin-left: 6px;
  box-shadow: 0 0 10px var(--brand-yellow);
}

/* Main Content Area */
main {
  margin-left: 270px;
  min-height: 100vh;
}

.view {
  padding: 48px clamp(28px, 5vw, 72px);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Typography & Eyebrow */
.eyebrow {
  margin: 0;
  color: var(--brand-navy-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Start Portal Main View */
.start-portal-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px clamp(20px, 4vw, 56px);
  min-height: 100vh;
  background: var(--bg-app);
}

.portal-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Portal Body (2 columns: Kari Card + Action Card) */
.portal-body {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 32px;
  align-items: stretch;
}

/* Kari Card - OBLIGATORIO FONDO BLANCO */
.kari-card {
  background: #ffffff !important;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.kari-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 27, 105, 0.12);
}

.kari-image-wrapper {
  background: #ffffff !important;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 20px;
}

.kari-img {
  max-width: 270px;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kari-card:hover .kari-img {
  transform: scale(1.04);
}

.kari-welcome {
  width: 100%;
}

.speech-bubble {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-navy);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
}

.bubble-tag {
  display: inline-block;
  background: var(--brand-yellow);
  color: var(--brand-navy-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.speech-bubble h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}

.speech-bubble p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Portal Start Card */
.portal-start-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 5px solid var(--brand-yellow);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.start-card-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 3.8vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin: 12px 0 16px;
}

.start-card-header h1 em {
  font-style: normal;
  color: var(--brand-navy);
  background: linear-gradient(180deg, #001b69 0%, #0036ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0 0.06em 0.1em 0;
  margin-bottom: -0.1em;
}

.start-description {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

.btn-start-portal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 700;
  background: var(--brand-navy);
  color: #ffffff;
  border-radius: var(--radius-md);
  margin-top: 22px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 27, 105, 0.22);
}

.btn-start-portal:hover {
  background: var(--brand-navy-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 27, 105, 0.32);
}

.btn-start-portal .arrow-icon {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.btn-start-portal:hover .arrow-icon {
  transform: translateX(4px);
}

@media (max-width: 920px) {
  .portal-body {
    grid-template-columns: 1fr;
  }
}

/* Legacy Hero & Start Card (fallback if needed) */
.hero {
  max-width: 640px;
}

.hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 5.5vw, 68px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin: 16px 0 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--brand-navy);
  background: linear-gradient(180deg, #001b69 0%, #0036ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0 0.06em 0.1em 0;
  margin-bottom: -0.1em;
}

.hero > p:last-child {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 550px;
  font-weight: 400;
}

.start-card {
  position: absolute;
  right: clamp(28px, 6vw, 84px);
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, 36vw);
  background: var(--bg-card);
  padding: 34px;
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--brand-yellow);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

select, input, textarea {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 13px 15px;
  font: inherit;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(0, 27, 105, 0.12);
}

button, .icon-button {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand-navy);
  color: #ffffff;
  padding: 13px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover, .icon-button:hover {
  background: var(--brand-navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 27, 105, 0.2);
}

button:active, .icon-button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.start-card > button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding: 14px 20px;
  font-size: 15px;
  background: var(--brand-navy);
}

/* Header inside Work View */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
  color: var(--brand-navy);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pill {
  padding: 8px 16px;
  background: var(--brand-yellow-subtle);
  border: 1px solid var(--brand-yellow);
  border-radius: 99px;
  color: var(--brand-navy);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Workspace Layout */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.85fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}

.capture {
  padding: 30px;
  min-height: 680px;
  display: flex;
  flex-direction: column;
}

/* Search Wrap */
.search-wrap {
  position: relative;
}

.search-wrap label {
  margin-bottom: 8px;
}

.results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 78px;
  background: #ffffff;
  border: 1px solid var(--brand-navy-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.results button {
  width: 100%;
  background: transparent;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  box-shadow: none;
  transform: none !important;
}

.results button:hover {
  background: var(--bg-subtle);
}

.results span {
  display: grid;
  gap: 3px;
}

.results small, .results em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

/* Item Empty State */
.item-empty {
  text-align: center;
  color: var(--text-muted);
  margin: auto;
  padding: 40px 0;
}

.item-empty div {
  font-size: 44px;
  color: var(--brand-navy-light);
  margin-bottom: 12px;
  opacity: 0.4;
}

.item-empty h3 {
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}

.item-empty p {
  margin: 0;
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
}

/* Item Panel Product Info */
.product {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin: 28px 0 20px;
}

.product h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 8px 0 0;
  color: var(--brand-navy);
}

.count-history {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.count-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.count-history-heading h4 {
  margin: 4px 0 0;
  color: var(--brand-navy);
  font-size: 15px;
}

.count-history-heading small {
  color: var(--text-muted);
  white-space: nowrap;
}

.count-history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.count-history-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border-light);
}

.count-history-metrics span {
  color: var(--text-muted);
  font-size: 12px;
}

.count-history-metrics strong {
  color: var(--brand-navy);
  font-size: 20px;
}

.tag, .unit {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--bg-accent-light);
  border: 1px solid var(--border-light);
  color: var(--brand-navy);
  font-weight: 700;
  display: inline-block;
}

.system-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 0;
  margin-bottom: 24px;
}

.system-row div {
  display: grid;
  gap: 4px;
}

.system-row div + div {
  border-left: 1px solid var(--border-light);
  padding-left: 24px;
}

.system-row small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.system-row strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-navy);
}

/* Assistant Section */
.assistant {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.assistant-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.assistant-head div {
  display: grid;
}

.assistant-head b {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--brand-navy);
}

.assistant-head small {
  color: var(--text-muted);
  font-size: 12px;
}

.spark {
  background: var(--brand-yellow);
  color: var(--brand-navy-dark);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(255, 230, 0, 0.4);
}

.capture-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.capture-actions label {
  display: flex;
  width: auto;
}

.capture-actions input[type="file"] {
  display: none;
}

.icon-button {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  background: #ffffff;
  border-color: var(--brand-navy);
}

.icon-button.recording {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger-text);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(207, 19, 34, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(207, 19, 34, 0); }
  100% { box-shadow: 0 0 0 0 rgba(207, 19, 34, 0); }
}

/* Voice Console Live Feedback Bar */
.voice-console {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1.5px solid var(--brand-navy-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.wave-bar {
  width: 4px;
  height: 100%;
  background: var(--brand-navy);
  border-radius: 99px;
  animation: wave 1s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 70%; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 100%; }

@keyframes wave {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

.voice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-text span {
  font-size: 11px;
  font-weight: 700;
  color: var(--status-danger-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--brand-navy);
  font-style: italic;
  font-weight: 600;
}

/* Auto Execution Banner */
.auto-execute-banner {
  background: var(--brand-yellow-subtle);
  border: 1px solid var(--brand-yellow);
  color: var(--brand-navy-dark);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  margin-top: 14px;
}

.auto-execute-banner strong {
  font-size: 15px;
  color: var(--brand-navy);
}

#interpretButton {
  margin-left: auto;
  background: var(--brand-navy);
  color: #ffffff;
}

#interpretButton:hover {
  background: var(--brand-navy-dark);
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.image-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.interpretation {
  margin-top: 16px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}

/* Count List Side Card */
.list {
  padding: 26px;
  min-height: 680px;
  display: flex;
  flex-direction: column;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.list-head h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin: 4px 0 18px;
  color: var(--brand-navy);
}

.ghost {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  box-shadow: none;
  font-size: 13px;
}

.ghost:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy);
  border-color: var(--border-light);
  transform: none;
}

.count-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.count-row {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.count-row:hover {
  border-color: var(--brand-navy-light);
  box-shadow: var(--shadow-sm);
}

.count-row span {
  display: grid;
  gap: 4px;
  max-width: 68%;
}

.count-row small {
  color: var(--text-muted);
  font-weight: 500;
}

.count-row strong {
  text-align: right;
  color: var(--brand-navy);
  font-size: 15px;
  font-weight: 800;
}

.count-row em {
  font-style: normal;
  color: var(--status-warn-text);
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.empty-list {
  color: var(--text-muted);
  text-align: center;
  padding: 80px 15px;
  font-size: 14px;
}

/* Dialog Modal */
dialog {
  border: 1px solid var(--border-light);
  border-top: 5px solid var(--brand-yellow);
  border-radius: var(--radius-xl);
  padding: 0;
  width: min(560px, 92vw);
  box-shadow: var(--shadow-dialog);
  background: #ffffff;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(0, 17, 66, 0.7);
  backdrop-filter: blur(6px);
}

.dialog-content {
  padding: 34px;
}

.dialog-content h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
  color: var(--brand-navy);
}

.dialog-content > p:not(.eyebrow) {
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 14px;
}

.large {
  width: 48px;
  height: 48px;
  font-size: 20px;
  margin-bottom: 20px;
}

.conversion {
  background: var(--bg-accent-light);
  border: 1px solid var(--border-light);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--brand-navy);
  font-weight: 700;
  font-size: 14px;
  margin: 16px 0;
}

.dialog-content label {
  margin-top: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.secondary {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
}

.secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-navy);
}

/* Notification Toast */
#toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  background: var(--brand-navy-dark);
  border: 1px solid var(--border-dark);
  border-left: 4px solid var(--brand-yellow);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 400;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Rules */
@media (max-width: 1050px) {
  .start-card {
    position: static;
    transform: none;
    width: 100%;
    max-width: 580px;
    margin-top: 48px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .list {
    min-height: auto;
  }
  .count-list {
    max-height: 320px;
  }
}

@media (max-width: 700px) {
  .rail {
    position: static;
    width: 100%;
    height: auto;
    padding: 18px 20px;
  }
  .steps {
    display: none;
  }
  .rail-button {
    position: absolute;
    right: 16px;
    top: 18px;
    margin: 0;
  }
  .brand small {
    display: none;
  }
  main {
    margin: 0;
  }
  .view {
    padding: 28px 20px;
  }
  header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .workspace {
    display: block;
  }
  .list {
    margin-top: 20px;
  }
  .capture-actions {
    flex-wrap: wrap;
  }
  #interpretButton {
    margin-left: 0;
    flex: 1;
  }
  .system-row {
    grid-template-columns: 1fr;
  }
  .system-row div + div {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    margin-top: 12px;
  }
  .hero h1 {
    font-size: 42px;
  }
}

/* Top Tab Bar Navigation */
.top-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #e4ecf7;
  border-bottom: 2px solid #cbd5e1;
  padding: 10px clamp(20px, 4vw, 56px) 0;
  position: sticky;
  top: 0;
  z-index: 90;
  overflow-x: auto;
  overflow-y: hidden;
}

.tab-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #d4e0f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  position: relative;
}

.tab-item:hover:not(.active) {
  background: #e9eff8;
  color: var(--text-main);
}

.tab-item.active {
  background: var(--bg-app);
  color: var(--brand-navy);
  border-color: #cbd5e1;
  border-bottom: 2px solid var(--bg-app);
  border-top: 3px solid var(--brand-navy);
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 -3px 10px rgba(0, 24, 88, 0.05);
}

.tab-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 1px 5px;
  margin-left: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-weight: 700;
}

.tab-close-btn:hover {
  background: rgba(207, 19, 34, 0.15);
  color: var(--status-danger-text);
}

.tab-item.active .tab-close-btn {
  color: var(--text-secondary);
}

.tab-item.active .tab-close-btn:hover {
  background: rgba(207, 19, 34, 0.15);
  color: var(--status-danger-text);
}

/* Counts Module Header & Filter Grid */
.counts-header {
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.counts-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: var(--text-main);
  margin: 4px 0 0 0;
}

.filters-card {
  margin-bottom: 24px;
  padding: 22px 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
  gap: 16px;
  align-items: end;
}

.filter-actions {
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}

.history-filters-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
}

.history-filters-grid label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.counts-grid-card {
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

/* Recent Sessions List in Conteos Component */

.sessions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sessions-head h3 {
  margin: 4px 0 0 0;
  font-size: 22px;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}

.recent-sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.session-item-card {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  min-height: 160px;
}

.session-item-card:hover {
  background: #ffffff;
  border-color: var(--brand-navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.session-item-card.active-session {
  border-left: 5px solid var(--brand-yellow);
  border-color: var(--border-medium);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.session-card-info h4 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}

.session-card-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.session-card-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.session-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-medium);
}

.session-status-tag {
  font-size: 11px;
  font-weight: 800;
  background: var(--brand-navy-light);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.session-open-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-navy);
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.history-pagination span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.workspace.history-readonly {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.history-readonly .list {
  min-height: 520px;
}

@media (max-width: 1100px) {
  .history-filters-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 700px) {
  .history-filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .filter-actions button {
    width: 100%;
  }
}

/* Reports Component Styling */
.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.reports-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: var(--text-main);
  margin: 4px 0 0 0;
}

.btn-export-excel {
  background: #0b7a3e;
  color: #ffffff;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(11, 122, 62, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-export-excel:hover {
  background: #086131;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 122, 62, 0.35);
}

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card small {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-card strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.reports-table-card {
  padding: 24px;
}

.reports-card-head {
  margin-bottom: 20px;
}

.reports-card-head h3 {
  margin: 4px 0 0 0;
  font-size: 20px;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.reports-table-wrap {
  overflow-x: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.reports-table th, .reports-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.reports-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reports-table tr:hover {
  background: var(--bg-subtle);
}
