/* Modern Clean Theme - Light Background with Clear Inputs */

/* Global */
html { height: 100%;
  /* Extend gradient for long pages to avoid cutoffs */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Ensure main grows to push footer down */
main { flex: 1 0 auto; }

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  position: relative;
  z-index: 1200;
}

.navbar-brand {
  color: #667eea !important;
  font-weight: 700;
}

.navbar-brand .voip-logo {
  width: 34px;
  height: 34px;
}

.navbar .nav-link {
  color: #4b5563 !important;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar .nav-link:hover {
  color: #667eea !important;
}

/* Main container */
/* User greeting in navbar */
.navbar .nav-item.d-flex {
  color: #667eea !important;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Cards / panels */
.card {
  background: rgba(255, 255, 255, 0.98);
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.card-body {
  padding: 2rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: #1f2937;
  font-weight: 600;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
  color: #111827;
}

/* Form labels & text */
label,
.form-label {
  color: #374151;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Inputs - Clear white background with visible borders */
.form-control,
.form-select {
  background: #ffffff;
  color: #1f2937;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  background: #ffffff;
  color: #1f2937;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Placeholder text */
.form-control::placeholder {
  color: #9ca3af;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
  border: 2px solid #667eea;
  color: #667eea;
  border-radius: 8px;
  font-weight: 600;
}

.btn-outline-secondary:hover {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

/* Back buttons (subtle filled variant for contrast on white cards) */
.btn-back {
  background: #eef2ff; /* indigo-50 */
  color: #4f46e5;      /* indigo-600 */
  border: 1px solid #c7d2fe; /* indigo-200 */
  border-radius: 8px;
  font-weight: 600;
}
.btn-back:hover {
  background: #e0e7ff; /* indigo-100 */
  color: #4338ca;      /* indigo-700 */
  border-color: #a5b4fc; /* indigo-300 */
}

.btn-outline-info,
.btn-outline-light {
  border-width: 2px;
  border-radius: 6px;
  font-weight: 500;
}

/* Subtle doc buttons (less prominent than View/Edit) */
.btn-doc {
  background: #ffffff;
  color: #374151;
  border: 2px solid #cbd5e1; /* slate-300 */
  border-radius: 6px;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
}
.btn-doc:hover {
  background: #f3f4f6; /* gray-100 */
  color: #111827;
  border-color: #94a3b8; /* slate-400 */
}
.btn-doc:disabled,
.btn-doc[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* Badges */
.badge {
  padding: 1rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Links */
a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: #5568d3;
  text-decoration: underline;
}

/* Tables */
.table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.table-dark {
  background: transparent;
}

.table-dark thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.table-hover tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.table-light {
  background: #f9fafb;
}

/* Alerts */
.alert-success {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
  border-radius: 8px;
}

.alert-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  border-radius: 8px;
}

.alert-info {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  border-radius: 8px;
}

/* Muted text */
.text-muted {
  color: #6b7280 !important;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  color: #e0e7ff;
  margin-top: auto;
  border-top: none;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.35);
}
.footer-brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
}
.footer-brand-copy {
  color: #c7d2fe;
}
.footer-item-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #c7d2fe;
}
.footer-item div:not(.footer-item-label) {
  color: #f4f4ff;
}
.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.footer-contact-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  text-decoration: none;
}
.footer-contact-link span {
  font-weight: 500;
}
.voip-logo {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

/* Dropdown menus */
.dropdown-menu {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  color: #374151;
  padding: 0.6rem 1.2rem;
}

.dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* Modal */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 2px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-body {
  padding: 2rem;
}

/* Form check (checkboxes) */
.form-check-input {
  border: 2px solid #d1d5db;
  border-radius: 4px;
}

.form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* HR separator */
hr {
  border-color: #e5e7eb;
  opacity: 1;
}

/* Code tags */
code {
  background: #f3f4f6;
  color: #667eea;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* DID onboarding */
.did-card {
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 20px;
}

.did-stepper-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.did-step-btn {
  border: 0;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 14px;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #4c1d95;
  font-weight: 600;
  transition: all 0.2s ease;
}

.did-step-btn .step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #4c1d95;
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.15);
}

.did-step-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.did-step-btn.active .step-index {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.did-stepper-panel {
  display: none;
  animation: didFade 0.3s ease;
}

.did-stepper-panel.active {
  display: block;
}

@keyframes didFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.did-stepper-panel .input-group-text {
  border-radius: 12px 0 0 12px;
  background: rgba(102, 126, 234, 0.1);
  color: #4c1d95;
  font-size: 1.25rem;
}

.did-stepper-panel .form-control,
.did-stepper-panel .form-select {
  border-radius: 0 12px 12px 0;
  font-size: 1rem;
  padding: 0.85rem 1rem;
}

.did-history-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.did-history-item {
  border-left: 3px solid rgba(102, 126, 234, 0.5);
  padding-left: 0.85rem;
  margin-bottom: 1rem;
}

.did-order-card {
  position: relative;
  border-radius: 18px;
  border: 1px dashed rgba(102, 126, 234, 0.4);
  padding: 1.5rem;
  overflow: visible;
}

.did-order-card.ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(59, 130, 246, 0.16));
  border-color: transparent;
}

.did-order-card.locked {
  background: #0f172a;
  border-color: rgba(15, 23, 42, 0.35);
}

.did-order-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  z-index: 2;
  gap: 0.5rem;
  backdrop-filter: blur(6px);
}

.did-order-body {
  position: relative;
}

.did-order-card.locked .did-order-body {
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.35;
}

.did-docs-card {
  position: relative;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(248, 250, 252, 0.85);
}

.did-docs-card.ready {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(236, 253, 245, 0.85);
}

.did-docs-card.locked .did-docs-body {
  pointer-events: none;
  filter: blur(1px);
  opacity: 0.4;
}

.did-docs-overlay {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  z-index: 2;
  gap: 0.5rem;
}

.did-docs-group + .did-docs-group {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 1.5rem;
}

.did-docs-group-header h3 {
  color: #0f172a;
}

.did-docs-card input[type="file"] {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  padding: 0.65rem;
  background: white;
}

.doc-upload-field {
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 16px;
  padding: 1rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  height: 100%;
}

.doc-upload-field + .doc-upload-field {
  margin-top: 1rem;
}

.doc-upload-field .form-control {
  border-style: solid;
  border-width: 2px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.doc-upload-field.doc-uploaded {
  border-color: #34d399;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.doc-upload-field.doc-uploaded .form-control {
  border-color: #86efac;
  background: #f0fdf4;
}

.doc-upload-field.doc-missing {
  border-color: #fca5a5;
  background: #fff5f5;
}

.doc-upload-field.doc-missing .form-control {
  border-color: #f87171;
  background: #fef2f2;
}

.doc-upload-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.doc-upload-status .bi {
  font-size: 1.05rem;
}

.doc-upload-field.doc-uploaded .doc-upload-status {
  color: #15803d;
}

.doc-upload-field.doc-missing .doc-upload-status {
  color: #b91c1c;
}

.did-docs-hint {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #eef2ff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: #1e1b4b;
  font-size: 0.95rem;
}

.did-docs-hint i {
  color: #4c1d95;
  font-size: 1.1rem;
}

.did-admin-docs {
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.did-admin-docs-header {
  gap: 0.75rem;
}

.did-admin-docs-header .doc-download-all-form {
  margin-left: auto;
}

.did-admin-doc-card {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 1rem;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.did-admin-doc-card.doc-present {
  border-color: rgba(34, 197, 94, 0.5);
  background: #ecfdf5;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.1);
}

.did-admin-doc-card.doc-missing {
  border-color: rgba(251, 113, 133, 0.4);
  background: #fef2f2;
}

.did-admin-doc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.did-admin-doc-card .doc-label {
  font-size: 0.95rem;
}

.did-admin-doc-card .doc-status {
  color: #4b5563;
}

.did-order-lock-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.did-order-form {
  position: relative;
}

.did-order-form-grid {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin-top: 1rem;
  padding-top: 1.5rem;
}

.did-order-block {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  height: 100%;
}

.did-searchable-select {
  position: relative;
  z-index: 1;
}

.did-searchable-select.open {
  z-index: 50;
}

.did-searchable-select.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.did-searchable-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}

.did-searchable-toggle i {
  font-size: 0.85rem;
  color: #6b7280;
}

.did-searchable-panel {
  position: fixed;
  left: 0;
  top: 0;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.15);
  z-index: 4000;
  overflow: hidden;
  display: none;
  min-width: 240px;
}

.did-searchable-panel.is-open {
  display: block;
}

.did-searchable-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.did-searchable-search i {
  color: #6b7280;
}

.did-searchable-search .form-control {
  border: none;
  padding: 0.35rem 0;
  box-shadow: none;
}

.did-searchable-options {
  max-height: 220px;
  overflow-y: auto;
}

.did-searchable-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: #111827;
}

.did-searchable-option:hover,
.did-searchable-option.active,
.did-searchable-option:focus {
  background: rgba(102, 126, 234, 0.08);
  outline: none;
}

.did-searchable-option-code {
  font-weight: 600;
  color: #4c1d95;
}

.did-searchable-option-city {
  font-size: 0.95rem;
  color: #1f2937;
  font-weight: 500;
}

.did-order-card.ready .did-order-block {
  background: rgba(255, 255, 255, 0.95);
}

.did-order-latest {
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  background: #f8fafc;
}

.did-order-requests-list .did-order-latest + .did-order-latest {
  margin-top: 1rem;
}

.did-order-note-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.02));
  padding: 0.9rem 1rem;
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.15);
}

.did-order-note-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1d4ed8;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

.did-order-note-text {
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 600;
}

.did-admin-order-update-form .form-label {
  display: block;
}

.did-admin-order-update-form .btn {
  min-height: 38px;
}

@media (max-width: 768px) {
  .did-stepper-nav {
    flex-direction: column;
  }
}

.did-guidance .alert {
  border-radius: 18px;
  border: none;
  background: rgb(255 193 7);
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.did-section-stack {
  display: flex;
  flex-direction: column;
}

.did-section-stack > .did-card {
  width: 100%;
}

.did-section-stack > * + * {
  margin-top: 1.75rem;
}

.did-step-grid .did-step-item {
  border-radius: 18px;
  padding: 1.25rem;
  border: 2px solid #e5e7eb;
  background: white;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.did-step-grid .did-step-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.did-step-status-badge {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-weight: 700;
}

.did-step-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-right: 0.75rem;
}

.did-step-item.state-not_started {
  border-color: #e5e7eb;
  background: #f9fafb;
}

.did-step-item.state-not_started .did-step-icon {
  background: #e5e7eb;
  color: #475569;
}

.did-step-item.state-pending {
  border-color: #facc15;
  background: #fffbeb;
}

.did-step-item.state-pending .did-step-icon {
  background: #facc15;
  color: #92400e;
}

.did-step-item.state-approved {
  border-color: #22c55e;
  background: #ecfdf5;
}

.did-step-item.state-approved .did-step-icon {
  background: #22c55e;
  color: #065f46;
}

.did-step-item.state-not_approved {
  border-color: #ef4444;
  background: #fef2f2;
}

.did-step-item.state-not_approved .did-step-icon {
  background: #ef4444;
  color: #7f1d1d;
}

.did-step-item.state-not_started .did-step-status-badge {
  background: #e5e7eb;
  color: #374151;
}

.did-step-item.state-pending .did-step-status-badge {
  background: #facc15;
  color: #92400e;
}

.did-step-item.state-approved .did-step-status-badge {
  background: #34d399;
  color: #065f46;
}

.did-step-item.state-not_approved .did-step-status-badge {
  background: #f87171;
  color: #7f1d1d;
}
