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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Headings — Manrope display (distinct personality, body system-fast) */
h1, h2, .section-title, .tech-hi, .tech-brand, .side-brand, .login-card h1, .dash-head h1 {
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
}

/* Keyboard users — visible focus */
:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Touch press feedback */
.btn-action:active,
.btn-primary:active,
.btn-logout:active,
.tc-btn:active {
  transform: scale(0.97);
}

/* Reduced motion — quality floor */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
}

/* Global select — SAB pages me text/number inputs jaisa hi look.
   (page-specific select styles isse override kar sakte hain) */
select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background-color: #fff;
  color: var(--text);
  outline: none;
}

select:focus {
  border-color: var(--primary);
}

/* ---------- Login page ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-logo {
  font-size: 44px;
  margin-bottom: 8px;
}

.login-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: block;
  margin: 0 auto 12px;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.25);
}

.login-card h1 {
  font-size: 24px;
  color: var(--text);
}

.login-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 24px;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.field input.invalid {
  border-color: #ef4444;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.password-wrap button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 8px;
}

.error {
  display: block;
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 20px;
  font-size: 13px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
}

.forgot {
  color: var(--primary);
  text-decoration: none;
}

.forgot:hover {
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

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

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-message {
  margin-top: 12px;
  font-size: 13px;
  min-height: 16px;
}

.form-message.success {
  color: #16a34a;
}

.form-message.error {
  color: #ef4444;
}

.signup-line {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.signup-line a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Home page ---------- */
.site-body {
  background: var(--bg);
  min-height: 100vh;
}

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.btn-logout {
  padding: 8px 16px;
  background: #fff;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: #fef2f2;
}

.hero {
  text-align: center;
  padding: 72px 24px 48px;
}

.hero h1 {
  font-size: 40px;
  color: var(--text);
  margin-bottom: 12px;
}

.hero h1 span {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 24px auto 72px;
  padding: 0 24px;
}

.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  text-align: left;
}

.feature .icon {
  font-size: 28px;
}

.feature h3 {
  margin: 10px 0 6px;
  color: var(--text);
  font-size: 17px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Protected pages (Add Call / Open Calls) ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

/* Embed mode: pages jo Settings ke andar iframe me chalti hain (Users, Tech logins) */
.site-body.embed .sidebar {
  display: none;
}
.site-body.embed .page {
  max-width: 100%;
  margin: 0;
  padding: 16px 8px 24px;
}
.embed-frame {
  width: 100%;
  height: 1100px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  color: var(--text);
  font-size: 28px;
  margin-bottom: 4px;
}

.page-head p {
  color: var(--muted);
  font-size: 15px;
}

.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.account-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  align-items: end;
  max-width: 720px;
}

.account-form .field input {
  width: 100%;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin-bottom: 8px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-card select,
.form-card textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.form-card select:focus,
.form-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.form-card select.invalid,
.form-card textarea.invalid {
  border-color: #ef4444;
}

/* ---------- Calls table ---------- */
.table-scroll {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
}

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

.calls-table th {
  text-align: left;
  padding: 14px 16px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.calls-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.calls-table tbody tr:last-child td {
  border-bottom: none;
}

.calls-table tbody tr:hover {
  background: #fafbff;
}

.calls-table .addr {
  max-width: 220px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge.open {
  background: #fef3c7;
  color: #b45309;
}

.badge.closed {
  background: #dcfce7;
  color: #15803d;
}

.badge.cancel {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.pending {
  background: #dbeafe;
  color: var(--primary-dark);
}

.btn-action {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-action.ok {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.btn-action.ok:hover {
  background: #d1fae5;
}

.btn-action.bad {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-action.bad:hover {
  background: #fee2e2;
}

.btn-action:disabled {
  opacity: 0.6;
  cursor: wait;
}

.actions {
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
}

.empty-state .icon {
  font-size: 40px;
}

.empty-state h3 {
  color: var(--text);
  margin: 10px 0 4px;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 18px;
}

.inline-btn {
  display: inline-block;
  width: auto;
  padding: 10px 22px;
  text-decoration: none;
}

/* ---------- Technician column + Settings page ---------- */
.tech {
  min-width: 170px;
}

.tech .tech-badge {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  margin-bottom: 6px;
}

.tech .unassigned {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 6px;
}

.assign-note {
  color: #15803d;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

.assign-note a {
  color: var(--primary);
}

/* ---------- Work panel (Assigned Calls) ---------- */
.panel-btn {
  background: #eff6ff;
  color: var(--primary-dark);
  border-color: #bfdbfe;
}

.panel-btn:hover {
  background: #dbeafe;
}

.panel-row > td {
  background: #fafaff;
  padding: 0 16px 16px;
}

.upload-panel {
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.panel-head {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  font-size: 15px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel-grid label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.panel-grid input[type=file],
.panel-grid textarea {
  width: 100%;
  font-size: 13px;
}

.panel-grid textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  color: var(--text);
}

.panel-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.panel-actions .btn-primary,
.panel-actions .btn-action {
  width: auto;
  padding: 10px 20px;
  white-space: nowrap;
}

.close-msg {
  margin-top: 8px;
  min-height: 14px;
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.video-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.upload-msg {
  font-size: 12px;
  color: #15803d;
  margin-top: 4px;
  min-height: 13px;
}

/* ---------- Add Amount cards ---------- */
.amount-cards {
  display: grid;
  gap: 18px;
}

.amount-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.amount-row label {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.amount-row input[type=number] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  width: 180px;
  outline: none;
}

.amount-row input[type=number]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.amount-row .btn-primary {
  width: auto;
  padding: 10px 20px;
  white-space: nowrap;
}

/* SYSTEM CLOSED / SYSTEM PENDING dropdown — row me compact */
.amount-row .system-pick {
  width: 200px;
  flex: 0 0 auto;
}

/* ➕ ADD REMARKS button — textarea ke thoda gap ke baad */
.tc-savebox [data-add-remarks] {
  margin: 2px 0 4px;
}

.amount-info {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text);
}

.amount-callno {
  font-size: 16px;
  margin-bottom: 4px;
}

.card-msg {
  display: inline;
  min-height: 0;
}

.tech-select {
  display: block;
  width: 150px;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.tech-select:disabled {
  opacity: 0.6;
}

.section-title {
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 18px;
  margin-bottom: 16px;
}

.tech-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.tech-add-row input,
.tech-add-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
}

.tech-add-row input:focus,
.tech-add-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.tech-add-row input.invalid {
  border-color: var(--danger, #dc2626);
}

.tech-add-row .error {
  color: #dc2626;
  font-size: 12px;
  padding-left: 4px;
}

.tech-add-row .grow {
  flex: 1 1 190px;
  min-width: 190px;
}

/* City / Pincode and other fixed-size fields keep a usable width
   and wrap onto the next line when space runs out. */
.tech-add-row .field:not(.grow) {
  flex: 0 1 150px;
  min-width: 140px;
}

.tech-add-row .btn-primary {
  width: auto;
  padding: 11px 20px;
  white-space: nowrap;
}

.tech-list {
  margin-top: 14px;
}

/* Inline edit form for one technician (opened by ✏️ Edit) */
.tech-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin: 0 0 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* hidden attribute ko display:flex override na kare — sirf ✏️ Edit click par dikhe */
.tech-edit[hidden] {
  display: none;
}

/* 🏷 Brands chips — toggle button click par hi dikhen */
.brands-toggle {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.brand-chips-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.brand-chips-wrap[hidden] {
  display: none;
}

.tech-edit input {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.tech-edit input.short {
  flex: 0 1 140px;
  min-width: 120px;
}

.tech-edit input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.tech-edit-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
}

.tech-edit-actions .btn-primary {
  width: auto;
  padding: 7px 16px;
}

/* PART CHANGE DONE: one card per closed call */
.done-card {
  margin-bottom: 10px;
}

.done-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.tech-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
}

.tech-row:last-child {
  border-bottom: none;
}

.tech-row .tech-name {
  font-weight: 600;
  color: var(--text);
}

.tech-row .tech-addr {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.tech-row .tech-mobile {
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 6px;
  white-space: nowrap;
}

.tech-conn {
  flex-shrink: 0;
}

.conn-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
  background: #f1f5f9;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}

.user-role-select {  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fafc;
  color: var(--ink, #0f172a);
  cursor: pointer;
}

.brand-row,
.user-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.user-brand-row {
  padding: 6px 0 10px;
  border-bottom: 1px solid #eef2f7;
  margin-bottom: 6px;
}

.brand-row-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-right: 4px;
}

.brand-chip {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  padding: 4px 11px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.brand-chip.on {
  background: #dbeafe;
  border-color: #1d4ed8;
  color: var(--primary-dark);
}

.brand-remove-chip {
  background: #dbeafe;
  border-color: #1d4ed8;
  color: var(--primary-dark);
}

.brand-remove-chip .chip-x {
  font-weight: 900;
  margin-left: 2px;
  color: #b91c1c;
}

.brand-remove-chip:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #b91c1c;
}

.conn-badge.ok {
  background: #dcfce7;
  color: #15803d;
}

.conn-badge.link {
  background: #e0f2fe;
  color: #0369a1;
}

.conn-badge.link:hover {
  background: #bae6fd;
}

.bot-help {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

.bot-help code {
  background: #f1f5f9;
  border-radius: 6px;
  padding: 1px 6px;
}

.bot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.bot-status {
  font-size: 14px;
  font-weight: 600;
}

.btn-action.small {
  padding: 5px 10px;
  font-size: 11px;
}

.empty-state.small {
  padding: 20px 24px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 12px;
  }

  .tech-add-row {
    flex-direction: column;
  }

  .tech-add-row .btn-primary {
    width: 100%;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .amount-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 12px 16px;
  }

  .nav-links a:not(:last-child) {
    display: none;
  }

  .hero h1 {
    font-size: 30px;
  }
}

/* ---------- Dashboard Overview (sidebar layout) ---------- */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #111827;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 14px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  padding: 8px 10px;
  text-decoration: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

/* Sidebar group heading (CALLS, ...) */
.side-group {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 12px 12px 4px;
  border-top: 1px solid #1f2937;
  margin-top: 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 12px;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}

.side-link:hover {
  background: #1f2937;
  color: #fff;
}

.side-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.35);
}

.side-ico {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #1f2937;
  padding-top: 14px;
  color: #d1d5db;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

.side-user .btn-logout {
  background: transparent;
  color: #9ca3af;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.side-user .btn-logout:hover {
  color: #f87171;
}

.dash-main {
  flex: 1;
  padding: 30px 34px;
  min-width: 0;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.dash-head h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

.dash-head p {
  color: var(--muted);
  margin: 0;
}

/* Per-row printed A4 slip (hidden on screen, shown only when printing one row) */
#row-print-area {
  display: none;
}

/* On-screen preview of the slip (opened by a row's 🖨 Print button) */
.print-page.slip-open #row-print-area {
  display: block;
  margin: 18px 0 30px;
  padding: 18px 22px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 12px;
  max-width: 900px;
}

.slip-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #bbb;
  font-weight: 600;
  color: #444;
}

.slip-toolbar-btns {
  display: flex;
  gap: 8px;
}

.slip-toolbar-btns .btn-primary {
  width: auto;
  padding: 8px 16px;
}

@page {
  size: A4 portrait;
  margin: 12mm;
}

.slip-a4 {
  font-size: 15px;
  color: #111;
}

.slip-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  border-bottom: 3px double #111;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.slip-parties {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  /* TO / FROM takes ~40% of the A4 page */
  min-height: 100mm;
}

.slip-parties .slip-box {
  flex: 1;
}

.slip-parties .slip-box h3 {
  font-size: 17px;
  border-bottom-width: 2px;
  margin-bottom: 14px;
  padding-bottom: 8px;
}

.slip-parties .slip-box .slip-big {
  font-size: 30px;
  margin: 0 0 14px;
}

.slip-parties .slip-box p {
  font-size: 21px;
  line-height: 1.5;
  margin: 8px 0;
}

.slip-box {
  border: 2px solid #111;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.slip-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #444;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slip-big {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
}

.slip-box p {
  margin: 4px 0;
  font-size: 15px;
}

.slip-tag {
  display: inline-block;
  padding: 3px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 2px solid #111;
}

.slip-tag.fresh {
  background: #dcfce7;
}

.slip-tag.defective {
  background: #fee2e2;
}

.slip-detail {
  width: 100%;
  border-collapse: collapse;
}

.slip-detail th,
.slip-detail td {
  border: 1.5px solid #999;
  padding: 4px 10px;
  text-align: left;
  font-size: 13px;
}

.slip-detail th {
  width: 32%;
  background: #f3f4f6;
  font-weight: 600;
}

.slip-photos {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.slip-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid #999;
}

.slip-nophoto {
  font-size: 13px;
  color: #666;
}

.slip-cut {
  margin: 6px 0 14px;
  color: #555;
  font-size: 12px;
  letter-spacing: 2px;
  text-align: center;
}

.slip-foot {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

@media print {
  .print-page.print-row .sidebar,
  .print-page.print-row .dash-head,
  .print-page.print-row .dash-find,
  .print-page.print-row .assign-note,
  .print-page.print-row .empty-state,
  .print-page.print-row #send-table-wrap,
  .print-page.print-row .print-head {
    display: none !important;
  }

  .print-page.print-row #row-print-area {
    display: block !important;
    margin: 0;
    padding: 0;
    border: none;
    max-width: none;
  }

  .print-page.print-row .slip-toolbar {
    display: none !important;
  }

  .print-page.print-row .dash-main {
    padding: 0;
    margin: 0;
  }

  .print-page.print-row .slip-detail th,
  .print-page.print-row .slip-tag {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Part Send to Tech header: Print + Back buttons side by side */
.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.head-actions .dash-add-btn {
  display: inline-flex;
  align-items: center;
}

/* Only visible on the printed page */
.print-head {
  display: none;
  margin-bottom: 14px;
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
}

.print-head h2 {
  margin: 0 0 2px;
  font-size: 18px;
  color: #111;
}

.print-head p {
  margin: 0;
  font-size: 12px;
  color: #333;
}

@media print {
  /* Hide everything except the sent-parts table */
  .print-page .sidebar,
  .print-page .dash-head,
  .print-page .dash-find,
  .print-page .assign-note,
  .print-page .empty-state,
  .print-page #send-table td .send-cell,
  .print-page #send-table select {
    display: none !important;
  }

  .print-page .dash-main {
    padding: 0;
    margin: 0;
  }

  .print-page .print-head {
    display: block;
  }

  /* Drop the empty Actions column */
  .print-page #send-table th:last-child,
  .print-page #send-table td:last-child {
    display: none;
  }

  /* Keep the table readable without the screen shadows/colours */
  .print-page .calls-table {
    font-size: 11px;
    width: 100%;
  }

  .print-page .calls-table th {
    background: #f0f0f0 !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-page .table-scroll {
    overflow: visible;
  }

  .print-page .thumb {
    width: 60px;
    height: 60px;
  }
}

.dash-add-btn {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.35);
  transition: background 0.15s;
}

.dash-add-btn:hover {
  background: var(--primary-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
}

.stat-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  flex-shrink: 0;
}

.stat-ring.orange  { background: #ffedd5; }
.stat-ring.blue    { background: #dbeafe; }
.stat-ring.indigo  { background: #dbeafe; }
.stat-ring.purple  { background: #f3e8ff; }
.stat-ring.green   { background: #dcfce7; }
.stat-ring.red     { background: #fee2e2; }

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-sub {
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.dash-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.dash-total-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dash-total-card .stat-num {
  font-size: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.big-ico {
  font-size: 26px;
}

@media (max-width: 950px) {
  .sidebar {
    width: 68px;
  }
  .sidebar .side-label {
    display: none;
  }
  .side-link {
    justify-content: center;
  }
  .stat-grid,
  .dash-foot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .stat-grid,
  .dash-foot {
    grid-template-columns: 1fr;
  }
  .dash-main {
    padding: 22px 18px;
  }
}

/* Pages inside the sidebar layout stretch to fill the space */
.dash-body main.page {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* Sidebar brand name (SMART SERVICE CRM) */
.side-brand span {
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Sidebar brand logo */
.side-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: 0 0 auto;
}

/* ---------- Reminder bar on Assigned Calls ---------- */
.remind-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: -6px 0 20px;
}

.tech-remind-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-remind-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tech-remind-chip:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.18);
}

.tech-remind-chip:disabled {
  opacity: 0.6;
  cursor: wait;
}

.chip-bell {
  margin-left: 4px;
}

.remind-btn {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.remind-btn:hover:not(:disabled) {
  background: #fde68a;
}

.remind-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- Find bar (every page) ---------- */
.find-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.find-input {
  flex: 1;
  min-width: 240px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.find-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.find-btn {
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.find-btn:hover {
  background: var(--primary-dark);
}

.find-btn.clear {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}

.find-btn.clear:hover {
  background: var(--bg);
}

.find-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Dashboard global find ---------- */
.dash-find {
  margin-bottom: 20px;
}

.dash-find-results {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.06));
  overflow: hidden;
}

.dash-find-results .table-scroll {
  max-height: 420px;
  overflow: auto;
  border-radius: 0;
  box-shadow: none;
}

/* ---------- Part stock form & photo picker ---------- */
.part-stock-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.part-stock-form input[type="text"],
.part-stock-form input[type="number"],
.part-stock-form select {
  flex: 1 1 120px;
  min-width: 100px;
}

.part-stock-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* Fresh/Defective — Qty jaisa chhota fixed, poori line na le */
.part-stock-form #part-material {
  flex: 0 0 130px;
  min-width: 130px;
}

.part-stock-form #part-qty {
  flex: 0 0 72px;
  min-width: 72px;
}

.part-stock-form #part-form-photo-slot,
.part-stock-form .file-pick-btn,
.part-stock-form #part-submit-btn {
  flex: 0 0 auto;
}

.file-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px dashed var(--primary);
  border-radius: 10px;
  background: rgba(29, 78, 216, 0.06);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-pick-btn:hover {
  background: rgba(29, 78, 216, 0.12);
}

.part-stock-form .part-call-select {
  flex: 1 1 170px;
  min-width: 160px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}

.photo-preview[hidden] {
  display: none;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fafafa;
}

.photo-preview .thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.part-photo-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.send-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.send-tech-pick {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  max-width: 140px;
}

.send-qty-pick {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}

#stock-table td,
#stock-table th {
  white-space: nowrap;
  vertical-align: middle;
  padding-left: 10px;
  padding-right: 10px;
}

#stock-table td:nth-child(4) {
  white-space: normal;
  min-width: 170px;
}

#stock-table td .thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.photo-row-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Technician page (mobile-first, no sidebar) ---------- */
.tech-body {
  background: #eef2f7;
  min-height: 100vh;
  margin: 0;
  font-size: 16px;
}

.tech-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #111827;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.tech-brand {
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.75;
}

.tech-who {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.tech-logout {
  background: #374151;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
}

.tech-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ⬇ APK download — header ke andar chota button (Logout ke side me) */
.tech-apk-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tech-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}

.tech-section {
  font-size: 18px;
  margin: 18px 4px 10px;
  color: #111827;
}

.tech-empty {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  color: #6b7280;
  text-align: center;
}

.tech-note {
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

.tech-note.ok {
  background: #dcfce7;
  color: #166534;
}

.tech-note.bad {
  background: #fee2e2;
  color: #991b1b;
}

.tc-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tc-number {
  font-size: 17px;
}

.tc-status {
  font-size: 13px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.tc-status.bad {
  background: #fee2e2;
  color: #991b1b;
}

.tc-name {
  font-size: 19px;
  font-weight: 700;
  margin: 8px 0 4px;
}

.tc-line {
  display: block;
  color: #1f2937;
  margin: 6px 0;
  text-decoration: none;
  word-break: break-word;
}

a.tc-line {
  color: #1d4ed8;
}

.tc-muted {
  color: #9ca3af;
  font-size: 14px;
}

.tc-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.tc-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d1d5db;
}

.tc-video {
  display: inline-block;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 10px;
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.tc-upload {
  display: block;
  padding: 12px;
  margin: 8px 0;
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  color: #1e3a8a;
}

.tc-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 15px;
}

.tc-upload .tc-input {
  display: none;
}

.tc-msg {
  min-height: 0;
  font-size: 14px;
  color: #374151;
  margin: 4px 0;
  word-break: break-word;
}

.tc-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin: 10px 0 6px;
}

.tc-remarks {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  resize: none;
}

.tc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0 6px;
}

/* hidden ko grid override na kare — ⚙ ACTION click par hi dikhe */
.tc-actions[hidden] {
  display: none;
}

/* PENDING card me sirf 2 actions (⏳ PENDING button nahi) */
.tc-actions.two {
  grid-template-columns: 1fr 1fr;
}

/* ✅ GOOD PART confirmed note */
.good-note {
  color: #15803d;
  font-weight: 700;
}

/* part.html row me Call Number select */
.call-row-pick {
  min-width: 170px;
}

/* 📞 call-pick box (PART RECEIVE karte hi) */
.tc-callpick {
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
  display: grid;
  gap: 8px;
}

.tc-act-toggle {
  display: block;
  width: 100%;
  border: 2px solid var(--primary);
  background: #eff6ff;
  color: var(--primary);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 800;
  margin: 12px 0 0;
}

.tc-btn {
  border: 0;
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: #6b7280;
}

/* 📷 CAMERA / 🖼 GALLERY pick buttons */
.tc-attach-pick {
  display: flex;
  gap: 8px;
  margin: 0 0 6px;
}
.tc-attach-pick .tc-pick {
  flex: 1;
  padding: 12px 6px;
  font-size: 14px;
  background: var(--primary);
}
.tc-attach-pick .tc-pick[data-pick="gallery"] {
  background: #1d4ed8;
}

.tc-btn.ok {
  background: #16a34a;
}

.tc-btn.warn {
  background: #d97706;
}

.tc-btn.bad {
  background: #dc2626;
}

.tc-btn.primary {
  background: var(--primary);
}

.tc-btn:disabled {
  opacity: 0.55;
}

.tc-wide {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
}

.tc-part-box {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

/* ---------- TECH LOGIN page ---------- */
.tl-row {
  flex-wrap: wrap;
  gap: 8px;
}

.tl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tl-actions .tl-email,
.tl-actions .tl-pass {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  min-width: 170px;
}

/* ---------- Technician dashboard (hero + stats) ---------- */
.tech-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  margin: 6px 0 14px;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}

.tech-hi {
  font-size: 22px;
  font-weight: 800;
}

.tech-date {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.85;
}

.tech-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.tech-stat {
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tech-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
}

.tech-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

/* SVG icons in tech stat labels / header */
.tech-stat-label .tlabel {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-right: 3px;
}

.ti-open      { color: #16a34a; }
.ti-pending   { color: #d97706; }
.ti-verify    { color: #2563eb; }
.ti-done      { color: #16a34a; }
.ti-dispatch  { color: var(--primary); }
.ti-defective { color: #dc2626; }
.ti-fresh     { color: #059669; }

.tech-brand .tbrand {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  color: #fbbf24;
}

.tech-apk-btn .tbtn-ico,
.tech-logout .tbtn-ico {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  margin-right: 2px;
}

/* 📤 upload progress bar */
.upbar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.upbar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.2s ease;
}

.tech-stat.warn .tech-stat-num {
  color: #d97706;
}

/* Tappable stat cards (touch to show/hide the call list) */
.tech-stat.tap {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.tech-stat.tap:active {
  transform: scale(0.97);
}

.tech-stat.tap.on {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35);
}

/* Happy code remarks box */
/* Happy code — chhota input, sirf digits */
.tc-happy {
  width: 140px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
}

.tc-remarks.need {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* CLOSED panel: remarks + happy code + attachment, CLOSED dabane par khulta hai */
.tc-closebox {
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

/* TECH CLOSED page */
.stat-ring.slate  { background: #e2e8f0; }

.tc-remark-line {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px 10px;
}

/* Verification stat card */
.tech-stat.check .tech-stat-num {
  color: #2563eb;
}

.tc-line.verify-note {
  font-weight: 700;
  color: #2563eb;
  background: #f5f3ff;
  border: 1px dashed #c4b5fd;
  border-radius: 8px;
  padding: 8px 10px;
}

/* TECH CLOSED: save box (office remarks + amount) */
/* tech-closed: header click -> more options */
.done-head.tc-head {
  cursor: pointer;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 8px;
  width: 100%;
}

/* header info row — bold text */
.done-head.tc-head > div:first-child {
  font-weight: 700;
}

.done-head.tc-head .tc-more-hint {
  margin-top: 0;
  margin-left: auto;
}

.done-head.tc-head .tc-more-hint {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 999px;
  padding: 3px 10px;
  align-self: flex-start;
}

.done-head.tc-head.tc-open .tc-more-hint::before {
  content: "";
}

/* tech-closed: expand hone par har section ka light box */
.tc-section {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.tc-section .tc-plain-line {
  margin-top: 4px;
}

.tc-plain-line {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.45;
}

.tc-savebox {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tc-savebox .tc-remarks {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 6px;
  background: #fff;
}

.tc-savebox .tc-hint {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
}

.tc-photos .btn-action.small {
  margin: 6px 0 0 6px;
  vertical-align: middle;
}

/* Completed stat card + amount line */
.tech-stat.done .tech-stat-num {
  color: #15803d;
}

.tc-line.done-amount {
  font-weight: 800;
  font-size: 16px;
  color: #15803d;
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 8px;
  padding: 8px 10px;
}

/* PART PENDING IN SYSTEM cards */
.tu-media-item {
  position: relative;
  display: inline-block;
  margin: 0 6px 6px 0;
}

.tu-media-item .tu-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.tu-media-btns {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tu-remark-line {
  padding: 2px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 14px;
}

.tu-remark-line:last-child {
  border-bottom: 0;
}

.tu-newremark {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tu-remark-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

.tu-newremark .btn-primary {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 16px;
}

.tu-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.btn-primary.small,
.btn-action.small {
  font-size: 13px;
  padding: 8px 12px;
}

/* Part Dispatch stat card */
.tech-stat.dispatch .tech-stat-num {
  color: #b45309;
}

.tc-line.dispatch-note {
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 8px;
  padding: 8px 10px;
}

/* Part Receive stat card + note */
.tech-stat.receive .tech-stat-num {
  color: #047857;
}

.tc-line.receive-note {
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px dashed #6ee7b7;
  border-radius: 8px;
  padding: 8px 10px;
}

.stat-ring.emerald  { background: #d1fae5; }

.stat-ring.violet  { background: #ede9fe; }

/* CLOSED WITH PART panel bits */
.cwp-defect {
  margin-top: 8px;
}

/* Defective-in-stock stat card */
.tech-stat.defective .tech-stat-num {
  color: #b45309;
}

/* 🆕 Fresh Part stat card */
.tech-stat.fresh .tech-stat-num {
  color: var(--primary);
}

/* ALL PAGES grid on dashboard */
.allpages-head {
  margin: 18px 2px 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
}

.stat-ring.teal     { background: #ccfbf1; }
.stat-ring.sky      { background: #e0f2fe; }
.stat-ring.cyan     { background: #cffafe; }
.stat-ring.amber    { background: #fef3c7; }
.stat-ring.rose     { background: #ffe4e6; }
.stat-ring.lime     { background: #ecfccb; }
.stat-ring.brown    { background: #fde8d7; }
.stat-ring.stone    { background: #f5f5f4; }
.stat-ring.fuchsia  { background: #fae8ff; }
.stat-ring.navy     { background: #dbe4ff; }
.stat-ring.grey     { background: #f1f5f9; }

/* DUPLICATE CALLS REMOVE page */
.stat-ring.pinkish  { background: #fce7f3; }

/* SVG icons in stat rings (replaced emojis) */
.stat-ring svg {
  width: 26px;
  height: 26px;
}

.stat-ring.orange  { color: #ea580c; }
.stat-ring.blue    { color: #2563eb; }
.stat-ring.indigo  { color: var(--primary); }
.stat-ring.purple  { color: #9333ea; }
.stat-ring.green   { color: #16a34a; }
.stat-ring.red     { color: #dc2626; }
.stat-ring.slate   { color: #475569; }
.stat-ring.emerald { color: #059669; }
.stat-ring.violet  { color: #2563eb; }
.stat-ring.teal    { color: #0d9488; }
.stat-ring.sky     { color: #0284c7; }
.stat-ring.cyan    { color: #0891b2; }
.stat-ring.amber   { color: #d97706; }
.stat-ring.rose    { color: #e11d48; }
.stat-ring.lime    { color: #65a30d; }
.stat-ring.brown   { color: #c2410c; }
.stat-ring.stone   { color: #57534e; }
.stat-ring.fuchsia { color: #c026d3; }
.stat-ring.navy    { color: #1e3a8a; }
.stat-ring.grey    { color: #475569; }
.stat-ring.pinkish { color: #db2777; }

.dash-total-card .big-ico svg {
  width: 26px;
  height: 26px;
}

.dash-total-card .big-ico {
  color: var(--primary);
}

.dup-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.dup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.dup-row.dup-keep {
  border-color: #86efac;
  background: #f0fdf4;
}

.dup-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dup-clean-group {
  margin-top: 10px;
}

/* ✏️ call edit row on Open Calls */
.edit-row td {
  background: #f8fafc;
}

.call-editbox {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 4px;
}

.call-editbox label {
  font-weight: 700;
  font-size: 13px;
  color: #334155;
}

.call-editbox input,
.call-editbox textarea,
.call-editbox select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.call-editbtns {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.edit-msg {
  grid-column: 1 / -1;
  font-weight: 700;
  color: #047857;
}

/* 🚫 cancel reason panel on Open Calls */
.cancel-row td {
  background: #fef2f2;
}

.call-cancelbox {
  display: grid;
  gap: 8px;
  padding: 10px 4px;
}

.cancel-title {
  font-weight: 800;
  color: #b91c1c;
}

.call-cancelbox input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

/* 📎 live attachment strip in the tech CLOSED panel */
.tc-panel-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tc-media-item {
  position: relative;
  display: inline-flex;
}

.tc-media-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.tc-media-del:disabled {
  opacity: 0.6;
}

/* ⏳ pending (not yet uploaded) attachment chip */
.tc-media-item.pend {
  align-items: center;
  padding: 4px 26px 4px 8px;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}

.tc-pend-name {
  font-size: 11px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* pending video/unknown icon block */
.tc-pend-vid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* ➕ ADD PART box: already-added part row with its ✖ REMOVE button */
.tc-added-part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tc-remove-part {
  flex: 0 0 auto;
  width: auto;
  padding: 6px 12px;
  font-size: 0.85rem;
}
.tc-added-part span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.tc-added-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

/* 🔔 In-app alert popup: naya call / naya part assign hone par */
#tech-alerts {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.tech-alert {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.tech-alert-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #92400e;
  margin-bottom: 4px;
}
.tech-alert-body {
  color: #1f2937;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

/* DEFECTIVE PART DISPATCH page — courier input */
.dpd-courier {
  width: 140px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.dpd-courier:focus {
  border-color: var(--primary);
  outline: none;
}

/* part.html — courier details + LR photo detail row */
.courier-row > td {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.courier-box {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.courier-box-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.courier-box-row input[type="text"] {
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.courier-box .tc-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.lr-preview img {
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* 🏷 brand logo — call card meta line ke brand ke saath */
.tc-brand-logo {
  height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* card header wala brand logo — status pill ke saath top right */
.tc-head .tc-brand-logo {
  height: 18px;
  margin-right: 8px;
  margin-left: auto;
}

/* settings — brand logo upload rows */
.brand-logo-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 10px;
}

.brand-logo-thumb {
  height: 20px;
  max-width: 70px;
  object-fit: contain;
}

.brand-logo-btn {
  white-space: nowrap;
}

/* ↩ Part Return — tech stat + AT TECH badge */
.tech-stat.ret .tech-stat-num {
  color: #0891b2;
}

.ti-return {
  color: #0891b2;
}

.tc-status.ret {
  background: #cffafe;
  color: #0e7490;
}

/* APK/tech header — app logo */
.tech-brand-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  vertical-align: -5px;
  margin-right: 5px;
}

/* 📎 pick menu — ek button ke andar camera/photos/videos choice */
.tc-pick-menu {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.tc-pick-menu .tc-pick {
  width: 100%;
}

/* merged pick: ek button -> niche menu (flex-row me tut-ta tha) */
.tc-attach-merged {
  flex-direction: column;
  align-items: stretch;
}

.tc-attach-merged .tc-pick {
  flex: none;
  width: 100%;
}

/* 📎 attachments — camera/photos/videos ek line me */
.tc-attach-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-attach-row .tc-pick {
  flex: 1;
  min-width: 96px;
}

/* tech stat cards — 8 cards: phone 2 columns, desktop 4 columns; labels wrap inside the card */
.tech-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 620px) {
  .tech-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tech-stat {
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
}

.tech-stat-label {
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.tech-stat-label .tlabel {
  margin-right: 0;
}

/* PAYMENT page */
.pay-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 18px; }
.pay-form input, .pay-form select { min-width: 140px; }
.pay-h { margin: 18px 0 8px; font-size: 1.05rem; }

/* tech app: Payment card is the 9th stat card — full width so the grid stays even */
#stat-payment-card { grid-column: 1 / -1; }
#stat-payment-card .tech-stat-num { font-size: 1.5rem; }

/* sidebar + logout icons are inline SVG (one family, inherit colour) */
.side-ico { display: inline-flex; align-items: center; justify-content: center; }
.side-ico svg { width: 18px; height: 18px; display: block; }
.btn-logout { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.btn-logout svg { width: 18px; height: 18px; }

/* small buttons: bigger touch target (was ~26px tall) */
.btn-action.small { min-height: 40px; padding: 9px 12px; font-size: 12px; }

/* PAYMENT form labels */
.pay-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pay-form { align-items: flex-end; }

/* PAYMENT form: inputs match the rest of the app, buttons in one row */
.pay-form { gap: 10px 12px; }
.pay-form .pay-lbl { flex: 0 1 auto; }
.pay-form .pay-lbl:nth-of-type(3) { flex: 1 1 180px; }
.pay-form input,
.pay-form select {
  min-width: 130px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.pay-form .pay-lbl input { width: 100%; }
.pay-form .btn-action { min-height: 44px; white-space: nowrap; }
.pay-form .find-note { flex-basis: 100%; }

.pay-form { gap: 10px 8px; }
.pay-form input, .pay-form select { min-width: 110px; }
.pay-form .btn-action { padding-left: 12px; padding-right: 12px; }
.pay-compact th { font-size: 11px; letter-spacing: 0.02em; padding: 12px 10px; white-space: nowrap; }
.pay-compact td { padding: 12px 10px; white-space: nowrap; }

.pay-compact { min-width: 0; }
.pay-history td, .pay-history th { white-space: normal; }
.pay-form .pay-lbl:nth-of-type(1), .pay-form .pay-lbl:nth-of-type(2) { width: 150px; }
.pay-form .pay-lbl:nth-of-type(3) { flex: 1 1 140px; }
.pay-form .pay-lbl:nth-of-type(1) select, .pay-form .pay-lbl:nth-of-type(2) input { min-width: 0; width: 100%; }
.pay-form .pay-lbl:nth-of-type(3) { flex: 1 1 90px; }
.pay-form .pay-lbl:nth-of-type(3) input { min-width: 0; }

/* Design tokens (values unchanged — new rules use these instead of raw numbers) */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 12px; --radius-pill: 999px;
  --tap-min: 40px;
  --focus-ring: rgba(29, 78, 216, 0.45);
}

/* Skip link (keyboard / screen reader users) */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 1000;
  background: #111827; color: #fff; padding: 10px 14px; border-radius: var(--radius-md);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Table scroll regions are keyboard-focusable; keep the ring tidy */
.table-scroll:focus-visible { outline-offset: -3px; border-radius: 14px; }

/* Notched phones / APK WebView: keep content out of the unsafe areas */
.tech-body, .site-body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* tech app: phone / address links were ~21px tall — bigger tap area, same look */
a.tc-line { display: block; padding-block: 9px; }
.tc-card a.tc-line + a.tc-line { margin-top: -4px; }

/* tech stat cards: numbers on one line even when a label wraps to 2 lines */
.tech-stat { justify-content: flex-start; padding-top: 18px; }
.tech-stat-label { min-height: 2.7em; align-content: flex-start; }
#stat-payment-card { padding-bottom: 14px; }
#stat-payment-card .tech-stat-label { min-height: 0; }

/* a stat card marked hidden must really disappear (display:flex was overriding it) */
.tech-stat[hidden] { display: none !important; }

/* banner doubles as the "back to all" button while a list is open */
.tech-hero.is-back { cursor: pointer; }

/* Completed cards: header only until touched */
.tc-fold { cursor: pointer; }
.tc-fold .tc-more { display: none; }
.tc-fold.is-open .tc-more { display: block; }
.tc-fold > .tc-name::after { content: " ▾"; color: var(--muted); font-size: 0.8em; }
.tc-fold.is-open > .tc-name::after { content: " ▴"; }

/* call age chip (days) */
.days-chip {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0; vertical-align: middle;
  background: #eff6ff; color: #1e3a8a; white-space: nowrap;
}
.days-chip.warn { background: #fef3c7; color: #92400e; }
.days-chip.late { background: #fee2e2; color: #991b1b; }
.days-chip.done { background: #dcfce7; color: #166534; }
.tc-name .days-chip { font-size: 12px; margin-left: 4px; }

/* Filter button + panel (office pages) */
.flt-hide { display: none !important; }
.flt-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.flt-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.flt-btn svg { width: 16px; height: 16px; }
.flt-btn.on { border-color: var(--primary); color: var(--primary-dark); background: #eff6ff; }
.flt-count { min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary); color: #fff; font-size: 12px; text-align: center; }
.flt-count:empty { display: none; }
.flt-note { font-size: 13px; font-weight: 600; color: var(--muted); }
.flt-panel {
  flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; align-items: end; padding: 14px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px;
}
.flt-panel[hidden] { display: none; }
.flt-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.flt-panel select, .flt-panel input {
  min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: #fff; font: inherit; font-size: 14px; color: var(--text); width: 100%;
}
.flt-clear {
  min-height: 40px; padding: 0 16px; border: 1px solid #fecaca; border-radius: var(--radius-md);
  background: #fef2f2; color: #b91c1c; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* payment history: deleted rows + export */
.pay-histhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pay-histhead .pay-h { margin: 0; }
.pay-deleted td { color: #9ca3af; text-decoration: line-through; }
.pay-deleted td:last-child { text-decoration: none; }
.pay-del-note { font-size: 12px; color: #b91c1c; font-weight: 600; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* narrow window: icon-only sidebar must not leak text (brand name, group labels) */
@media (max-width: 950px) {
  .sidebar { overflow: hidden; }
  .side-brand { justify-content: center; padding: 8px 0; }
  .side-brand span { display: none; }
  .side-group {
    font-size: 0; padding: 0; margin: 10px 10px 6px;
    border-top: 1px solid #263244; height: 0;
  }
  .side-user { flex-direction: column; gap: 8px; }
  .side-user .btn-logout { min-width: 40px; padding: 0; }
}

/* pagination */
.pg-hide { display: none !important; }
.pg-bar { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 6px; flex-wrap: wrap; }
.pg-bar[hidden] { display: none; }
.pg-bar button {
  min-height: 40px; padding: 0 18px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--text);
}
.pg-bar button:disabled { opacity: 0.4; cursor: default; }
.pg-info { font-size: 13px; font-weight: 600; color: var(--muted); }

/* tech app icons (replace emoji) */
.ei { width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-right: 0.22em; flex: 0 0 auto; }
.ei-ok { color: #16a34a; } .ei-warn { color: #d97706; } .ei-bad { color: #dc2626; }
button .ei, .tc-btn .ei, .btn-action .ei, .tech-hero .ei, .tc-status .ei { color: inherit; }
.ei-num {
  display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em;
  margin-right: 0.3em; border-radius: 50%; background: #e2e8f0; color: #334155;
  font-size: 0.75em; font-weight: 800; vertical-align: 0.1em;
}

/* language switcher */
.lang-switch {
  background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 700;
  min-height: 40px; cursor: pointer;
}
.lang-switch option { color: #111827; background: #fff; }
.tech-top-actions .lang-switch { margin-right: 8px; }
.side-lang { padding: 0 2px; }
.side-lang .lang-switch { width: 100%; background: #1f2937; border-color: #374151; }


/* due-time alerts: OPEN calls older than 24 h (DUE) / 48 h (OVERDUE) turn red */
.due-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: 0; vertical-align: middle; white-space: nowrap; margin-left: 4px;
}
.due-chip.due24 { background: #fee2e2; color: #b91c1c; }
.due-chip.due48 { background: #dc2626; color: #fff; }
tr[data-due="24"] > td { background: #fef2f2; }
tr[data-due="48"] > td { background: #fee2e2; }
.tc-card[data-due="24"] { background: #fef2f2; box-shadow: 0 0 0 2px #fecaca, 0 1px 3px rgba(0, 0, 0, 0.08); }
.tc-card[data-due="48"] { background: #fee2e2; box-shadow: 0 0 0 2px #ef4444, 0 1px 3px rgba(0, 0, 0, 0.08); }
.due-alert {
  display: block; margin: 0 0 16px; padding: 14px 18px; border-radius: 12px; font-weight: 700;
  background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; text-decoration: none;
}
.due-alert.is-48 { background: #dc2626; color: #fff; border-color: #b91c1c; }
.due-alert[hidden] { display: none; }
.stat-card.due-red { background: #fef2f2; border-color: #fca5a5; }
.stat-card.due-red-48 { background: #fee2e2; border-color: #ef4444; }
.stat-card.due-red .stat-num { color: #b91c1c; }
.due-tag { display: block; margin-top: 4px; font-size: 12px; font-weight: 800; color: #b91c1c; }
