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

:root {
  --bg:           #eef4f8; /* Soft blue-grey light background */
  --panel:        #ffffff; /* Clean white card surface */
  --panel2:       #f1f5f9; /* Lighter grey-blue for inputs/tabs */
  --border:       rgba(0, 0, 0, 0.06); /* Soft dark border */
  --text:         #0f172a; /* Dark text */
  --muted:        #475569; /* Medium-dark text */
  --accent:       #4f46e5; /* Indigo primary */
  --good:         #10b981;
  --bad:          #ef4444;
  --shadow:       0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --radius:       16px;
  --sans:         'Inter', sans-serif;
  --mono:         ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:var(--bg);
}

.shell{
  min-height:100vh;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:rgba(240, 245, 250, 0.85);
  backdrop-filter: blur(12px);
  position:sticky;
  top:0;
  z-index:5;
  margin-left: 80px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand{ display:flex; align-items:center; gap:10px; }
.logo{
  width:36px;height:36px;border-radius:10px;
  background:rgba(255, 255, 255, 0.25);
  border:1px solid rgba(255, 255, 255, 0.35);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  color: white;
}
.title .h1{ font-weight:800; letter-spacing:.2px; }
.title .sub{ color:var(--muted); font-size:12px; margin-top:1px; }

.controls{
  display:flex;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.field label{
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-bottom:4px;
}
.field input{
  width:160px;
  background:var(--panel2);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
}

.btn{
  padding:9px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--panel2);
  color:var(--text);
  cursor:pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.btn:hover{ background:rgba(0,0,0,.05); }
.btn.primary{
  background:var(--accent);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.btn.primary:hover{ background:var(--accent); filter: brightness(1.15); }

.status, .state{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel);
}
.dot{
  width:10px;height:10px;border-radius:50%;
  display:inline-block;
}
.dot.ok{ background:var(--good); }
.dot.bad{ background:var(--bad); }

.pill{
  font-size:12px;
  color:var(--muted);
}
.pill.strong{
  color:var(--text);
  font-weight:700;
}

.main{
  margin-left: 80px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: calc(100vh - 70px);
}

.sidebar{
  width: 80px; /* Collapsed width by default */
  background: linear-gradient(180deg, #4fa2d2 0%, #2f7ea8 100%); /* Steel blue from image */
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 5px 0 25px rgba(27, 78, 109, 0.15);
  border-right: 1.5px solid #174561;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.sidebar:hover {
  width: 260px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
  white-space: nowrap;
  transition: gap 0.3s;
}
.sidebar:hover .brand {
  gap: 12px;
}
.sidebar .brand-name {
  font-weight: 700;
  font-size: 18px;
  color: white;
  letter-spacing: -0.5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.sidebar:hover .brand-name {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease 0.1s, visibility 0.25s ease 0.1s;
}

.sidebar:hover ~ .topbar,
.sidebar:hover ~ .main {
  margin-left: 260px;
}

.nav {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 12px 16px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  width: 100%;
  white-space: nowrap;
  margin-bottom: 8px;
}
.nav .nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
}
.nav .nav-text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.sidebar:hover .nav .nav-text {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease 0.1s, visibility 0.25s ease 0.1s;
}

.nav:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}
.nav.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content{
  padding:16px;
}

.view{ max-width: 1100px; }

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-title{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:800;
}
.card-body{ padding:14px; }
.actions{ display:flex; gap:8px; }

.meta{
  color:var(--muted);
  font-size:13px;
  margin-bottom:10px;
}

.pre{
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  overflow:auto;
  max-height: 520px;
  font-family:var(--mono);
  font-size:12px;
}

.row{ display:flex; gap:12px; }
.grow{ flex:1; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .main{ margin-left: 0; }
  .topbar { margin-left: 0; }
  .sidebar{ display:flex; gap:8px; overflow:auto; position: relative; width: 100%; height: auto; padding: 10px; box-shadow: none; border-right: none; border-bottom: 1.5px solid #174561; }
  .sidebar:hover { width: 100%; }
  .sidebar .brand { display: none; }
  .sidebar:hover ~ .topbar, .sidebar:hover ~ .main { margin-left: 0; }
  .nav{ width:auto; white-space:nowrap; }
  .nav .nav-text { opacity: 1; visibility: visible; }
  .grid2{ grid-template-columns: 1fr; }
}

.upload-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin:10px 0 12px;
}
.upload-row input{
  flex:1;
  background:var(--panel2);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px;
}

.log{
  height:180px;
  overflow:auto;
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  font-family:var(--sans);
  font-size:13px;
  color:var(--text);
  line-height: 1.4;
}

.tablewrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width: 900px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  font-size:13px;
  vertical-align:top;
  color: var(--text);
}
.table th{
  position:sticky;
  top:0;
  background:var(--panel2);
  text-align:left;
  color:var(--text);
  font-weight:800;
}
.small{ font-size:12px; color:var(--muted); }
.muted{ color:var(--muted); }

.help{ margin:0; padding-left:18px; color:var(--text); }
.hint{ margin-top:10px; color:var(--muted); }

/* -------- Floating Assistant -------- */
.assistant{
  position:fixed;
  right:18px;
  bottom:18px;
  width: 380px;
  max-width: calc(100vw - 36px);
  border-radius:16px;
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow);
  overflow:hidden;
  z-index:10;
}

.assistant-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--panel2);
}
.assistant-title{
  font-weight:900;
  display:flex;
  align-items:center;
  gap:8px;
}
.spark{ filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
.assistant-hint{
  margin-left:6px;
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}

.iconbtn{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
  border-radius:10px;
  padding:4px 8px;
  cursor:pointer;
}
.iconbtn:hover{ background:rgba(0,0,0,.05); }

.assistant-body{
  display:flex;
  flex-direction:column;
  height: 380px;
}
.chat{
  flex:1;
  overflow:auto;
  padding:12px;
}
.msg{
  max-width: 90%;
  padding:10px 12px;
  border-radius:14px;
  margin:8px 0;
  border:1px solid var(--border);
  font-size:13px;
  line-height:1.35;
}
.msg.user{
  margin-left:auto;
  background:var(--primary-dim);
  color:var(--accent);
  border-color:rgba(79, 70, 229, 0.2);
}
.msg.bot{
  margin-right:auto;
  background:var(--panel2);
}

.composer{
  display:flex;
  gap:10px;
  padding:10px;
  border-top:1px solid var(--border);
  background:var(--panel2);
}
.composer input{
  flex:1;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
}


/* ---- JD form ---- */
.jd-form { margin-top: 10px; }
.lbl{
  display:block;
  font-size:11px;
  color:var(--muted);
  margin: 2px 0 6px;
  font-weight:700;
}
.req{ color: var(--bad); font-weight:900; }
.input{
  width:100%;
  background:var(--panel2);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
}
.input:focus{
  border-color: rgba(79,70,229,.45);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.jd-actions{
  margin-top: 12px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.sep{
  border:none;
  border-top:1px solid var(--border);
  margin: 14px 0;
  opacity:.9;
}

/* Push-to-Talk Button */
.ptt-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  font-size: 32px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  border: 4px solid #6366f1;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.ptt-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.ptt-btn:active,
.ptt-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #f87171;
  transform: scale(1.1);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
}

.ptt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  100% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.ptt-btn.recording {
  animation: pulse-ring 1s infinite;
}
