/* ==========================================================================
   KarkhanaOS — Zero-App Voice & Photo to Challan SaaS Prototype
   Tailored for Howrah & Greater Kolkata MSME Clusters
   ========================================================================== */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --wa-teal-dark: #075e54;
  --wa-teal: #128c7e;
  --wa-green: #25d366;
  --wa-light-green: #d9fdd3;
  --wa-bg: #eae6df;
  --wa-outgoing: #d9fdd3;
  --wa-incoming: #ffffff;
  
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-bengali: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif;
  --font-hindi: 'Noto Sans Devanagari', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #0b1120;
  color: var(--slate-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Top Navigation
   -------------------------------------------------------------------------- */
.top-nav {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #25d366);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.3);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(37, 211, 102, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--slate-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.nav-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 320px;
}

.soundbox-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 100%;
}

.soundbox-badge:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(37, 211, 102, 0.4);
}

.soundbox-icon {
  font-size: 1.05rem;
  animation: pulse-mic 2s infinite ease-in-out;
  flex-shrink: 0;
}

.soundbox-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.soundbox-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--slate-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soundbox-status {
  font-size: 0.65rem;
  color: #4ade80;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-badge {
  font-size: 0.72rem;
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   App Layout: Dual Pane
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Panel: WhatsApp Simulator */
.left-panel {
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.panel-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-indicator {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
}

.step-desc {
  font-size: 0.78rem;
  color: var(--slate-400);
  line-height: 1.35;
}

/* Preset Buttons Bar */
.preset-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.preset-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--slate-200);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.preset-btn:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

.preset-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(37, 211, 102, 0.3));
  border-color: #4ade80;
  color: #fff;
}

/* --------------------------------------------------------------------------
   WhatsApp Mobile Device Frame
   -------------------------------------------------------------------------- */
.phone-frame {
  background: #111b21;
  border: 3px solid #334155;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  height: 610px;
  position: relative;
}

.phone-speaker {
  width: 50px;
  height: 4px;
  background: #475569;
  border-radius: 2px;
  margin: 8px auto 4px auto;
}

.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wa-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.03) 0%, transparent 10%),
    radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 10%);
}

/* WhatsApp Header */
.wa-header {
  background: var(--wa-teal-dark);
  color: #fff;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-back-btn {
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  position: relative;
}

.online-dot {
  width: 10px;
  height: 10px;
  background: #4ade80;
  border: 2px solid var(--wa-teal-dark);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.wa-contact-info {
  display: flex;
  flex-direction: column;
}

.wa-name {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.wa-status {
  font-size: 0.68rem;
  color: #a7f3d0;
}

.wa-header-icons {
  display: flex;
  gap: 14px;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.9;
}

/* WhatsApp Chat Body */
.wa-chat-body {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-date-chip {
  align-self: center;
  background: rgba(255, 255, 255, 0.85);
  color: #54656f;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  margin-bottom: 4px;
}

.wa-message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.wa-message.received {
  align-self: flex-start;
}

.wa-message.sent {
  align-self: flex-end;
}

.msg-bubble {
  padding: 8px 10px 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #111b21;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
  position: relative;
  word-break: break-word;
}

.wa-message.received .msg-bubble {
  background: var(--wa-incoming);
  border-top-left-radius: 0;
}

.wa-message.sent .msg-bubble {
  background: var(--wa-outgoing);
  border-top-right-radius: 0;
}

.msg-time {
  font-size: 0.62rem;
  color: #667781;
  float: right;
  margin-left: 10px;
  margin-top: 4px;
}

.greeting-head {
  color: var(--wa-teal-dark);
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.msg-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.lang-alt {
  font-size: 0.75rem;
  color: #475569;
}

/* Voice Message Bubble in WhatsApp */
.voice-note-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.vn-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  position: relative;
}

.vn-mic-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.65rem;
  background: var(--wa-green);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.vn-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vn-waveform-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vn-play-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #54656f;
}

.vn-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 18px;
}

.vn-bar {
  width: 3px;
  background: #8696a0;
  border-radius: 2px;
  transition: height 0.2s ease;
}

.vn-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #667781;
}

/* Extracted Order Card inside WhatsApp */
.order-extracted-card {
  border-left: 4px solid var(--wa-teal);
  background: rgba(18, 140, 126, 0.05);
  padding: 8px 10px;
  border-radius: 6px;
  margin: 6px 0;
  font-size: 0.8rem;
}

.card-title {
  font-weight: 700;
  color: var(--wa-teal-dark);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.order-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.detail-k {
  color: #54656f;
}

.detail-v {
  font-weight: 600;
  color: #111b21;
}

/* 1-Tap Quick Reply Buttons in WhatsApp */
.wa-interactive-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.wa-action-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--wa-teal);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
  font-family: inherit;
}

.wa-action-btn:hover {
  background: #f0fdf4;
  border-color: var(--wa-teal);
  color: var(--wa-teal-dark);
}

.wa-action-btn.btn-primary-wa {
  background: var(--wa-teal);
  color: white;
  border: none;
}

.wa-action-btn.btn-primary-wa:hover {
  background: var(--wa-teal-dark);
}

/* AI Processing State */
.wa-processing {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--slate-700);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.processing-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--wa-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Audio Playback Floating Bar */
.audio-playback-bar {
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.waveform-animation {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 16px;
}

.wave-bar {
  width: 3px;
  height: 4px;
  background: #4ade80;
  border-radius: 2px;
  animation: wave 1s infinite ease-in-out;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-delay: 0.3s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.5s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.2s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }
.wave-bar:nth-child(8) { animation-delay: 0.3s; }

/* Bottom Input Bar */
.wa-input-bar {
  background: #f0f2f5;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-actions-left {
  flex: 1;
  background: #ffffff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.wa-input-field {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.8rem;
  padding: 4px 6px;
  font-family: inherit;
  color: #111b21;
}

.wa-icon-btn {
  background: none;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  color: #54656f;
  padding: 2px 4px;
  transition: transform 0.1s ease;
}

.wa-icon-btn:hover {
  transform: scale(1.1);
}

.wa-mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-teal);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.wa-mic-btn:hover {
  background: var(--wa-teal-dark);
  transform: scale(1.05);
}

.wa-mic-btn.recording {
  background: #ef4444;
  animation: pulse-mic 1s infinite alternate;
}

/* --------------------------------------------------------------------------
   Right Panel: Invisible ERP & GST Challan Viewer
   -------------------------------------------------------------------------- */
.right-panel {
  background: #0b1120;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 24px;
  gap: 16px;
}

/* Panel Tabs */
.panel-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.panel-tab {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.panel-tab:hover {
  color: var(--slate-200);
  background: rgba(255, 255, 255, 0.05);
}

.panel-tab.active {
  color: #fff;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.count-pill {
  background: #0284c7;
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 9999px;
}

.status-indicator {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
}

.status-indicator.live {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-content.active {
  display: flex;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(8px);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  font-size: 1rem;
}

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.kpi-footer {
  font-size: 0.7rem;
  color: var(--slate-400);
}

.text-success { color: #4ade80 !important; }
.text-warning { color: #fbbf24 !important; }
.text-primary { color: #38bdf8 !important; }

/* Ledger Table */
.ledger-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ledger-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.ledger-subtitle {
  font-size: 0.75rem;
  color: var(--slate-400);
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--slate-200);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.table-responsive {
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.ledger-table th {
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.8);
  color: var(--slate-300);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.ledger-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--slate-200);
  vertical-align: middle;
}

.ledger-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-status {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-status.production {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-status.ready {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-status.dispatched {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-view-doc {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-view-doc:hover {
  background: #0284c7;
  color: white;
}

/* Solution Highlight Card */
.solution-highlight-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(37, 211, 102, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sol-icon {
  font-size: 1.5rem;
}

.sol-body h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.sol-body p {
  font-size: 0.78rem;
  color: var(--slate-300);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   TAB 2: GST Job-Work Delivery Challan (Printable Document View)
   -------------------------------------------------------------------------- */
.challan-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.challan-badge {
  background: rgba(37, 211, 102, 0.2);
  color: #4ade80;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.challan-id-tag {
  font-size: 0.8rem;
  color: var(--slate-300);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--slate-100);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-action.btn-primary {
  background: var(--wa-teal);
  border-color: var(--wa-green);
  color: white;
}

.btn-action.btn-primary:hover {
  background: var(--wa-teal-dark);
}

/* Printable Industrial White Sheet */
.challan-sheet {
  background: #ffffff;
  color: #111827;
  padding: 28px 32px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.4;
  border: 1px solid #cbd5e1;
}

.ch-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 10px;
}

.ch-company-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.ch-company-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
}

.ch-address, .ch-contact {
  font-size: 0.7rem;
  color: #64748b;
}

.ch-tax-box {
  text-align: right;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tax-row span {
  color: #64748b;
  margin-right: 4px;
}

.ch-title-bar {
  background: #0f172a;
  color: white;
  text-align: center;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ch-rule {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.85;
}

.ch-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  border: 1px solid #0f172a;
  border-top: none;
  margin-bottom: 14px;
}

.ch-meta-box {
  padding: 8px 12px;
}

.ch-meta-box:first-child {
  border-right: 1px solid #0f172a;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.meta-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.meta-val.highlight {
  font-family: var(--font-mono);
  color: #0284c7;
  font-weight: 700;
}

.meta-val.bold {
  font-size: 0.88rem;
  font-weight: 800;
}

.meta-text {
  font-size: 0.72rem;
  color: #334155;
}

/* Challan Items Table */
.ch-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  border: 1px solid #0f172a;
}

.ch-items-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 6px 8px;
  border: 1px solid #0f172a;
  text-align: left;
}

.ch-items-table td {
  padding: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  color: #1e293b;
  vertical-align: top;
}

.sub-spec {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge-scrap {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.ch-declaration {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  padding: 8px 12px;
  font-size: 0.68rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 14px;
}

.ch-footer-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 16px;
  align-items: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.ch-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-placeholder {
  width: 76px;
  height: 76px;
  border: 1px solid #94a3b8;
  padding: 4px;
}

.qr-svg {
  width: 100%;
  height: 100%;
}

.qr-caption {
  font-size: 0.6rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.2;
}

.ch-sign-box {
  display: flex;
  flex-direction: column;
}

.ch-sign-box.text-right {
  text-align: right;
  align-items: flex-end;
}

.sign-space {
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.digital-stamp {
  border: 2px solid #dc2626;
  color: #dc2626;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  transform: rotate(-4deg);
  opacity: 0.85;
}

.sign-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
}

.sign-sub {
  font-size: 0.65rem;
  color: #64748b;
}

/* --------------------------------------------------------------------------
   Modal for Handwritten Slip Photo Simulation
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--slate-400);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-desc {
  font-size: 0.78rem;
  color: var(--slate-300);
}

.handwritten-slip-preview {
  background: #fef08a;
  border: 2px dashed #ca8a04;
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.slip-paper {
  font-family: 'Courier New', Courier, monospace;
  color: #1e1b4b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.6;
}

.slip-date {
  text-align: right;
  font-size: 0.75rem;
  border-bottom: 1px solid #ca8a04;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.slip-client {
  font-size: 1rem;
  text-decoration: underline;
  margin-bottom: 4px;
}

.ocr-extracting-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-size: 0.75rem;
}

.spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid #38bdf8;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-footer {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--slate-200);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: #0284c7;
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover {
  background: #0369a1;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid #4ade80;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xl);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

@keyframes pulse-mic {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6)); }
  100% { transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* API Config Header Button */
.api-config-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.api-config-btn:hover {
  background: #0284c7;
  color: white;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
}

/* Config Modal Card */
.config-modal-card {
  max-width: 560px;
}

.webhook-meta-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-k {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--slate-300);
}

.copy-input-group {
  display: flex;
  gap: 6px;
}

.code-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #4ade80;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  outline: none;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--slate-100);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-copy:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.tip-subtext {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.3;
}

.tip-subtext code {
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

/* API Form Grid */
.api-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-200);
}

.form-control {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.field-hint {
  font-size: 0.65rem;
  color: var(--slate-400);
}

/* Howrah Rules Summary Box */
.howrah-rules-summary {
  background: rgba(30, 41, 59, 0.7);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.72rem;
}

.howrah-rules-summary h4 {
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.howrah-rules-summary ul {
  padding-left: 18px;
  color: var(--slate-300);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   WhatsApp QR Code Linker (Linked Devices / Multi-Device Protocol)
   -------------------------------------------------------------------------- */
.qr-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #128c7e, #25d366);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

.qr-link-btn:hover {
  background: linear-gradient(135deg, #075e54, #128c7e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
}

.qr-pill-free {
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-modal-card {
  max-width: 680px;
  width: 95%;
}

.qr-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-icon-green {
  font-size: 1.25rem;
}

.qr-modal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
}

.qr-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #128c7e;
}

.qr-svg-large {
  width: 170px;
  height: 170px;
  display: block;
}

/* Laser Scan Line Animation */
.qr-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e, 0 0 24px #22c55e;
  animation: laserScan 1.8s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes laserScan {
  0% { top: 6%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 92%; opacity: 0.4; }
}

.qr-timer-text {
  font-size: 0.72rem;
  color: var(--slate-300);
}

.qr-timer-text strong {
  color: #38bdf8;
  font-family: var(--font-mono);
}

.btn-refresh-qr {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--slate-200);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-refresh-qr:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Instructions on Right */
.qr-instructions-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-instruct-head {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.qr-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text {
  font-size: 0.8rem;
  color: var(--slate-200);
  line-height: 1.35;
}

.vernacular-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  font-style: italic;
}

.simulation-scan-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.btn-primary-scan {
  background: linear-gradient(135deg, #0284c7, #25d366);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-primary-scan:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.scan-hint {
  font-size: 0.68rem;
  color: var(--slate-400);
  text-align: center;
}

.qr-connection-status {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--slate-300);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbbf24;
}

.status-dot.pulsing {
  animation: pulse-dot 1.5s infinite;
}

.status-dot.connected {
  background: #4ade80 !important;
  box-shadow: 0 0 10px #4ade80;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.qr-advantage-callout {
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #a7f3d0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  line-height: 1.4;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .qr-modal-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive Header & Shell
   ========================================================================== */
.qr-link-btn span:not(.qr-pill-free) {
  white-space: nowrap;
}

.morning-briefing-btn span:not(:first-child),
.api-config-btn span:not(:first-child) {
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .top-nav {
    padding: 10px 12px;
  }

  .brand-subtitle {
    display: none;
  }

  .soundbox-label {
    display: none;
  }

  .location-badge {
    max-width: 160px;
    font-size: 0.68rem;
  }

  .company-dropdown {
    max-width: 160px;
  }

  .nav-controls {
    gap: 6px;
  }
}

@media (max-width: 900px) {
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-brand {
    width: 100%;
  }

  .brand-subtitle {
    display: block;
    max-width: 100%;
  }

  .nav-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .company-switch-widget {
    flex: 1 1 100%;
  }

  .company-dropdown {
    max-width: none;
    flex: 1;
  }

  .soundbox-label {
    display: block;
  }

  .location-badge {
    flex: 1 1 100%;
    max-width: none;
    text-align: center;
    white-space: normal;
  }

  .app-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 120px);
    overflow: visible;
  }

  .left-panel,
  .right-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .brand-title {
    font-size: 1.05rem;
  }

  .badge-tag {
    font-size: 0.58rem;
  }

  .qr-link-btn,
  .morning-briefing-btn,
  .api-config-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.72rem;
  }

  .qr-pill-free {
    display: none;
  }

  .soundbox-badge {
    flex: 1 1 100%;
    justify-content: center;
  }

  .soundbox-label {
    display: block;
  }

  .nav-controls {
    gap: 8px;
  }

  .company-switch-widget {
    padding: 6px 8px;
  }
}

/* ==========================================================================
   UI Polish: uniform controls, alignment, type scale
   ========================================================================== */
.top-nav {
  gap: 10px;
  padding: 8px 14px;
  min-height: 56px;
}

.nav-controls {
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.morning-briefing-btn,
.qr-link-btn,
.api-config-btn,
.soundbox-badge,
.company-switch-widget,
.location-badge {
  min-height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.1;
  gap: 6px;
}

.morning-briefing-btn,
.qr-link-btn,
.api-config-btn {
  cursor: pointer;
  border: 1px solid transparent;
  height: 38px;
}

.qr-link-btn { max-width: 200px; overflow: hidden; }
.morning-briefing-btn { max-width: 120px; }
.api-config-btn { max-width: 110px; }

.soundbox-badge {
  justify-content: flex-start;
  min-width: 130px;
  max-width: 160px;
  padding: 0 10px;
  height: 38px;
}

.soundbox-text { gap: 0; min-width: 0; }
.soundbox-label, .soundbox-status { line-height: 1.15; }

.location-badge {
  max-width: 170px;
  overflow: hidden;
  justify-content: flex-start;
  font-size: 0.72rem;
  height: 38px;
}

.company-switch-widget {
  height: 38px;
  padding: 2px 8px 2px 6px;
  gap: 6px;
  flex: 0 1 230px;
  max-width: 250px;
}

.company-switch-widget .switch-lbl {
  font-size: 0.58rem;
  line-height: 1;
  margin-bottom: 1px;
}

.company-dropdown {
  font-size: 0.74rem;
  max-width: 175px;
  line-height: 1.2;
}

.btn-add-comp { width: 22px; height: 22px; flex-shrink: 0; }

.brand-title { font-size: 1.1rem; gap: 6px; }
.brand-logo { width: 36px; height: 36px; }
.brand-logo svg { width: 20px; height: 20px; }

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
}

.panel-tab {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.panel-tab .tab-icon { font-size: 0.9rem; line-height: 1; }
.count-pill, .status-indicator { font-size: 0.64rem; line-height: 1.2; padding: 2px 6px; }

.right-panel { padding: 12px 16px; gap: 12px; }

.kpi-grid { gap: 10px; align-items: stretch; }

.kpi-card {
  min-height: 118px;
  padding: 12px 14px;
  gap: 6px;
  justify-content: space-between;
}

.kpi-title { font-size: 0.68rem; letter-spacing: 0.03em; }
.kpi-val { font-size: 1.35rem; line-height: 1.15; margin: 2px 0; }
.kpi-footer { font-size: 0.68rem; line-height: 1.3; }

.left-panel { padding: 12px 14px; gap: 10px; }
.step-indicator { font-size: 0.68rem; }
.step-desc { font-size: 0.74rem; }
.preset-btn {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.72rem;
  justify-content: center;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { min-height: 100px; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .morning-briefing-btn,
  .qr-link-btn,
  .api-config-btn {
    flex: 1 1 auto;
    max-width: none;
  }
  .soundbox-badge,
  .location-badge,
  .company-switch-widget {
    max-width: none;
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   Multi-Tenant & Multi-User Enhancements
   ========================================================================== */
.company-switch-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tenant-icon {
  font-size: 1.15rem;
}

.switch-col {
  display: flex;
  flex-direction: column;
}

.switch-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.company-dropdown {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  max-width: 200px;
  min-width: 0;
  width: 100%;
}

.company-dropdown option {
  background: #0f172a;
  color: #e2e8f0;
  padding: 6px;
}

.btn-add-comp {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-add-comp:hover {
  transform: scale(1.15);
}

/* Team & Whitelist Tab Styles */
.team-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.team-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.team-subtitle {
  font-size: 0.76rem;
  color: var(--slate-400);
  line-height: 1.4;
}

.team-table th {
  background: rgba(30, 41, 59, 0.9);
  padding: 10px 14px;
  color: var(--slate-300);
  font-size: 0.75rem;
}

.team-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-badge.owner {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-badge.worker {
  background: rgba(37, 211, 102, 0.15);
  color: #4ade80;
  border: 1px solid rgba(37, 211, 102, 0.4);
}

.role-badge.accountant {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.tenant-isolation-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  line-height: 1.45;
  margin-top: 18px;
}

.tenant-isolation-callout .callout-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* ==========================================================================
   Automated Workflow Enhancements: Badges & Morning Briefing
   ========================================================================== */
.morning-briefing-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.morning-briefing-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.badge-alert-scrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 700;
  margin-top: 3px;
  animation: pulseAlert 2.5s infinite;
}

.badge-alert-eway {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 700;
  margin-top: 3px;
}

@keyframes pulseAlert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ch-eway-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf4ff;
  border: 1px solid #d946ef;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 0.74rem;
  color: #701a75;
  line-height: 1.35;
}

.ch-eway-box .eway-icon {
  font-size: 1.2rem;
}




/* Real QR pairing box */
.qr-real-box {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.qr-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}
.qr-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cbd5e1;
  border-top-color: #128c7e;
  border-radius: 50%;
  animation: qrspin 0.8s linear infinite;
}
@keyframes qrspin { to { transform: rotate(360deg); } }

/* Login credentials */
.login-overlay {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
}
.login-card {
  width: min(400px, 92vw);
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
.login-brand { display:flex; gap:12px; align-items:center; margin-bottom: 18px; }
.login-brand h2 { margin:0; font-size:1.25rem; color:#fff; }
.login-brand p { margin:2px 0 0; font-size:0.8rem; color:#94a3b8; }
.login-form .form-group { margin-bottom: 12px; }
.login-form .form-control {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
  background: #1e293b; color: #fff; font-family: inherit; font-size: 0.9rem;
}
.login-submit { width: 100%; height: 42px; margin-top: 6px; }
.login-error { color: #f87171; font-size: 0.8rem; margin: 0 0 8px; }
.login-hint { color: #64748b; font-size: 0.72rem; line-height: 1.4; margin-top: 12px; }
.login-hint code { color: #94a3b8; }

/* header-nowrap-force */
.morning-briefing-btn,
.qr-link-btn,
.api-config-btn,
.soundbox-badge,
.location-badge,
.company-switch-widget {
  white-space: nowrap !important;
  overflow: hidden;
  height: 38px !important;
  min-height: 38px !important;
}
.morning-briefing-btn span,
.qr-link-btn span,
.api-config-btn span,
.soundbox-text span {
  white-space: nowrap !important;
}
.soundbox-text { overflow: hidden; }
.api-config-btn { max-width: none; }
.morning-briefing-btn { max-width: none; }
.qr-link-btn { max-width: none; }

.login-fill { width:100%; height:36px; margin-bottom:8px; opacity:0.95; }

.auth-config-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: #1e293b;
}
.auth-config-box label {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 8px 0 4px;
}
.auth-config-box .form-control {
  width: 100%;
  height: 38px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0f172a;
  color: #fff;
  padding: 0 10px;
}

/* Workshop dropdown + list */
.company-switch-widget { flex: 1 1 280px !important; max-width: 340px !important; min-width: 220px; }
.company-dropdown {
  max-width: 240px !important;
  width: 100%;
  min-width: 140px;
  text-overflow: ellipsis;
  overflow: hidden;
}
.company-dropdown option {
  white-space: normal;
  max-width: 420px;
}
.workshop-list { display:flex; flex-direction:column; gap:8px; margin-bottom: 8px; }
.workshop-row {
  display:flex; align-items:center; gap:10px; justify-content:space-between;
  padding:10px 12px; border:1px solid rgba(255,255,255,0.08); border-radius:10px;
  background: rgba(30,41,59,0.55); flex-wrap: wrap;
}
.workshop-row .w-name { font-weight:700; color:#fff; min-width:160px; flex:1; }
.workshop-row .w-meta { font-size:0.72rem; color:#94a3b8; flex:1; min-width:180px; }
.workshop-row .w-actions { display:flex; gap:6px; }
.workshop-row button { height:30px; padding:0 10px; font-size:0.72rem; }
.briefing-preview, .owner-alerts { margin-top: 14px; }
.briefing-preview pre {
  white-space: pre-wrap; background:#0f172a; padding:12px; border-radius:8px;
  color:#e2e8f0; font-size:0.8rem; border:1px solid rgba(255,255,255,0.08);
}
