/* ==========================================================================
   Robotic Partner - Modern Responsive Design System
   Universal Responsiveness Guarantee: Zero Text Cut-off, Mobile First, Flex-Wrap
   ========================================================================== */

:root,
[data-theme="light"],
[data-mr-theme="light"] {
  /* Light Mode: Luxury Soft Rose Blush / Pearl (Exact login.html Parity) */
  --bg-primary: #fff5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.96);
  --border-color: #ffd1dc;
  --border-focus: #e11d48;
  --text-primary: #191424;
  --text-secondary: #59475e;
  --text-muted: #8c778f;
  --input-bg: #fff9fa;
  --input-text: #191424;
  --input-border: #fbcfe8;
  --input-placeholder: #9d839c;
  --accent-cyan: #0284c7;
  --accent-blue: #8b5cf6;
  --accent-indigo: #e11d48;
  --accent-pink: #f43f5e;
  --shadow-sm: 0 2px 6px rgba(225, 29, 72, 0.05);
  --shadow-md: 0 10px 30px rgba(225, 29, 72, 0.08);
  --shadow-glow: 0 0 26px rgba(225, 29, 72, 0.16);

  --mr-page-bg: #fff5f7;
  --mr-page-gradient: radial-gradient(circle at 12% 15%, rgba(254, 226, 235, 0.7) 0%, #fffbfd 50%, #fdf2f5 100%);
  --mr-card-bg: #ffffff;
  --mr-card-border: #ffd1dc;
  --mr-card-text: #191424;
  --mr-card-subtext: #59475e;
  --mr-field-bg: #fff9fa;
  --mr-field-border: #fbcfe8;
  --mr-field-text: #191424;
  --mr-field-placeholder: #9d839c;
  --mr-accent-primary: #e11d48;
  --mr-accent-secondary: #8b5cf6;
  --mr-accent-gradient: linear-gradient(125deg, #e11d48 0%, #f43f5e 40%, #8b5cf6 100%);
  --mr-glow: 0 20px 50px -10px rgba(225, 29, 72, 0.08), 0 0 1px 1px rgba(244, 63, 94, 0.08);
  --mr-navbar-bg: rgba(255, 255, 255, 0.96);
  --mr-navbar-border: rgba(203, 213, 225, 0.85);

  --status-success: #10b981;
  --status-pending: #f59e0b;
  --status-failed: #ef4444;
  --status-reversed: #a855f7;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

[data-theme="dark"],
[data-mr-theme="dark"] {
  /* Dark Mode: Cosmic Titanium & Aurora Cyan/Emerald (Exact login.html Parity) */
  --bg-primary: #080b11;
  --bg-secondary: #0f141f;
  --bg-card: #0f141f;
  --bg-glass: rgba(15, 20, 31, 0.94);
  --border-color: rgba(56, 189, 248, 0.22);
  --border-focus: #00f2fe;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --input-bg: #0a0e17;
  --input-text: #f8fafc;
  --input-border: rgba(56, 189, 248, 0.28);
  --input-placeholder: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #0284c7;
  --accent-indigo: #6366f1;
  --accent-pink: #ec4899;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 28px rgba(0, 242, 254, 0.2);

  --mr-page-bg: #080b11;
  --mr-page-gradient: radial-gradient(ellipse at 15% 15%, rgba(6, 182, 212, 0.09) 0%, #080b11 50%, #04060a 100%);
  --mr-card-bg: #0f141f;
  --mr-card-border: rgba(56, 189, 248, 0.22);
  --mr-card-text: #f8fafc;
  --mr-card-subtext: #94a3b8;
  --mr-field-bg: #0a0e17;
  --mr-field-border: rgba(56, 189, 248, 0.28);
  --mr-field-text: #f8fafc;
  --mr-field-placeholder: #64748b;
  --mr-accent-primary: #00f2fe;
  --mr-accent-secondary: #10b981;
  --mr-accent-gradient: linear-gradient(125deg, #00f2fe 0%, #0284c7 45%, #6366f1 100%);
  --mr-glow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 25px rgba(6, 182, 212, 0.14);
  --mr-navbar-bg: rgba(8, 11, 17, 0.94);
  --mr-navbar-border: rgba(56, 189, 248, 0.22);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Glassmorphism Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #0284c7 45%, #6366f1 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

[data-theme="light"] .btn-primary, [data-mr-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 40%, #0ea5e9 100%);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  filter: brightness(1.08);
}

[data-theme="light"] .btn-primary:hover, [data-mr-theme="light"] .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-cyan);
}

.btn-success {
  background: var(--status-success);
  color: #ffffff;
}

.btn-danger {
  background: var(--status-failed);
  color: #ffffff;
}

/* Cards & Grid */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  word-break: break-word;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-glow);
}

/* Operator Status Badges */
.badge-operator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.op-airtel { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.op-jio { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.op-vi { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.op-bsnl { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Transaction Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-success { background: rgba(16, 185, 129, 0.2); color: var(--status-success); }
.status-pending { background: rgba(245, 158, 11, 0.2); color: var(--status-pending); }
.status-failed { background: rgba(239, 68, 68, 0.2); color: var(--status-failed); }
.status-reversed { background: rgba(139, 92, 246, 0.2); color: var(--status-reversed); }

/* Live Operator Ticker */
.operator-ticker {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  font-size: 0.88rem;
}

.ticker-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--input-text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

.form-control::placeholder {
  color: var(--input-placeholder);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* Tables (Responsive Scroll Wrapper) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table th {
  background: rgba(15, 20, 31, 0.95);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="light"] .table th, [data-mr-theme="light"] .table th {
  background: #fce7ec;
  color: #191424;
  border-bottom: 2px solid #ffd1dc;
}

.table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

[data-theme="light"] .table tbody tr:hover, [data-mr-theme="light"] .table tbody tr:hover {
  background: rgba(254, 205, 211, 0.3);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

/* Code Snippets */
pre.code-block {
  background: #050811;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.5;
}

/* Mobile Breakpoints */
@media (max-width: 768px) {
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .ticker-items {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .grid-cards {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Robotic Partner - Benchmark Aggregator UI Elements
   Inspired by benchmark layout (~50% match) with strict brand isolation
   ========================================================================== */

.mr-brand-caption {
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
}

.mr-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.mr-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mr-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mr-metric {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mr-metric:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-glow);
}

.mr-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mr-metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mr-metric-icon {
  font-size: 1.25rem;
  opacity: 0.85;
}

.mr-metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.mr-metric-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mr-workspace-strip {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.mr-workspace-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mr-workspace-icon {
  font-size: 1.5rem;
  background: rgba(56, 189, 248, 0.15);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.mr-workspace-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mr-workspace-links a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.mr-workspace-links a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.mr-subnav {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  font-size: 0.85rem;
}

.mr-subnav-items {
  display: flex;
  gap: 20px;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
}

.mr-subnav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.mr-subnav-item:hover, .mr-subnav-item.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Switch Toggle Component */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--status-success);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: 24px;
}
