/* 
 * Modern Dark Admin Theme
 * Clean, utilitarian design for internal tools
 */

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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-hover: #30363d;
  --border-color: #30363d;
  --border-muted: #21262d;
  
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-orange: #d29922;
  --accent-purple: #a371f7;
  --accent-cyan: #39c5cf;
  
  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  --gradient-green: linear-gradient(135deg, #3fb950 0%, #39c5cf 100%);
  --gradient-purple: linear-gradient(135deg, #a371f7 0%, #f778ba 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  
  /* Glows */
  --glow-blue: 0 0 20px rgba(88, 166, 255, 0.3);
  --glow-purple: 0 0 20px rgba(163, 113, 247, 0.3);
  --glow-green: 0 0 20px rgba(63, 185, 80, 0.3);
  
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 4px 24px rgba(88, 166, 255, 0.15);
  
  /* Animation timing */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

* {
  box-sizing: border-box;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) var(--bg-primary);
}

/* Text selection */
::selection {
  background: rgba(88, 166, 255, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(88, 166, 255, 0.3);
  color: var(--text-primary);
}

/* Focus outline for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

html {
  background: #0d1117 !important;
}

body {
  font-family: var(--font-sans) !important;
  font-size: 14px;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Animated background gradient orbs - site wide */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0d1117;
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(88, 166, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(163, 113, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 40%, rgba(57, 197, 207, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: -2;
}

/* Grid pattern overlay - site wide */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

/* Ensure Inter font overrides Bootstrap */
body, button, input, select, textarea, table, th, td, label, p, span, div, h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans) !important;
}

/* Exclude Font Awesome icons from font override */
a:not(.fas):not(.far):not(.fab):not(.fa) {
  font-family: var(--font-sans) !important;
}

/* Ensure Font Awesome icons use their font */
.fas, .far, .fab, .fa {
  font-family: "Font Awesome 5 Free" !important;
}
.fas {
  font-weight: 900 !important;
}

/* Main content wrapper for overflow control */
body > table,
body > form,
body > div:not(.login-container):not(#action_btn) {
  max-width: 100vw;
}

/* ========== LOGIN PAGE ========== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Animated background gradient orbs */
.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(88, 166, 255, 0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 20%, rgba(163, 113, 247, 0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 40% 40%, rgba(57, 197, 207, 0.08) 0%, transparent 30%);
  animation: gradientMove 15s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes gradientMove {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(2%, 2%) rotate(3deg); }
}

/* Grid pattern overlay */
.login-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.login-box {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.95) 0%, rgba(22, 27, 34, 0.98) 100%);
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 80px rgba(88, 166, 255, 0.08);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

/* Subtle top gradient border */
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gradient-blue);
  border-radius: 2px;
  opacity: 0.6;
}

.login-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15) 0%, rgba(163, 113, 247, 0.15) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(88, 166, 255, 0.2);
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.15);
}

.login-icon svg {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.4));
}

.login-box h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-align: center;
}

.login-box .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 36px;
  text-align: center;
}

.login-box .form-group {
  margin-bottom: 24px;
}

.login-box label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

.login-box input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 
    0 0 0 3px rgba(88, 166, 255, 0.15),
    0 0 20px rgba(88, 166, 255, 0.1);
  background: rgba(13, 17, 23, 1);
}

.login-box input::placeholder {
  color: var(--text-muted);
}

.login-box button,
.login-box input[type="submit"] {
  width: 100%;
  padding: 14px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  background: var(--gradient-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 12px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.login-box button::before,
.login-box input[type="submit"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.login-box button:hover,
.login-box input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-blue), var(--shadow);
}

.login-box button:hover::before,
.login-box input[type="submit"]:hover::before {
  opacity: 1;
}

.login-box button:active,
.login-box input[type="submit"]:active {
  transform: translateY(0);
}

.login-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--accent-red);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 24px;
  text-align: center;
}

/* ========== NAVIGATION ========== */
#action_btn {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 24px auto;
  width: 90%;
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Subtle top accent line */
#action_btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.3), transparent);
}

#action_btn .btn,
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(88, 166, 255, 0.25);
  background: rgba(88, 166, 255, 0.08);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(88, 166, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2);
}

#action_btn .btn::before,
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

#action_btn .btn:hover,
.btn:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15), inset 0 1px 0 rgba(88, 166, 255, 0.2);
}

#action_btn .btn:hover::before,
.btn:hover::before {
  opacity: 1;
}

#action_btn .btn:active,
.btn:active {
  transform: translateY(0);
}

#action_btn .btn-info,
.btn-info {
  background: rgba(88, 166, 255, 0.08);
  border-color: rgba(88, 166, 255, 0.25);
  color: var(--text-primary);
}

/* Logout button - red theme */
#action_btn .btn-logout,
.btn-logout {
  background: rgba(248, 81, 73, 0.1) !important;
  border-color: rgba(248, 81, 73, 0.3) !important;
  color: #f85149 !important;
}

#action_btn .btn-logout:hover,
.btn-logout:hover {
  background: rgba(248, 81, 73, 0.25) !important;
  border-color: rgba(248, 81, 73, 0.5) !important;
  box-shadow: 0 4px 12px rgba(248, 81, 73, 0.2), inset 0 1px 0 rgba(248, 81, 73, 0.2) !important;
}

/* Active page button highlight */
body.page-sms #action_btn a[href='/'],
body.page-2fa #action_btn a[href='?x=2fa'],
body.page-dial #action_btn a[href='?x=dial'],
body.page-sms_numbers #action_btn a[href='?x=sms_numbers'],
body.page-cdr_report #action_btn a[href='?x=cdr_report'],
body.page-users #action_btn a[href='?x=users'] {
  background: rgba(88, 166, 255, 0.3);
  border-color: rgba(88, 166, 255, 0.6);
  color: #fff;
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: var(--gradient-blue) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: var(--glow-blue), 0 4px 16px rgba(88, 166, 255, 0.3) !important;
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
}

.btn-danger:hover {
  background: var(--accent-red) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(248, 81, 73, 0.3);
}

.btn-warning {
  background: rgba(56, 139, 253, 0.15) !important;
  border-color: var(--accent-blue) !important;
  color: var(--accent-blue) !important;
}

.btn-warning:hover {
  background: var(--accent-blue) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(56, 139, 253, 0.3);
}

.btn-success {
  background: rgba(63, 185, 80, 0.15) !important;
  border-color: var(--accent-green) !important;
  color: var(--accent-green) !important;
}

.btn-success:hover {
  background: var(--accent-green) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(63, 185, 80, 0.3);
}

.btn-compose {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.15) 0%, rgba(136, 87, 229, 0.1) 100%) !important;
  border: 1px solid rgba(56, 139, 253, 0.3) !important;
  color: var(--accent-blue) !important;
}

.btn-compose:hover {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.25) 0%, rgba(136, 87, 229, 0.15) 100%) !important;
  box-shadow: 0 0 20px rgba(56, 139, 253, 0.3);
}

/* ========== FILTERS & FORMS ========== */
#filters {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 24px auto;
  width: 90%;
  padding: 24px;
  display: block;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Subtle top accent */
#filters::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.2), transparent);
}

#filters > label:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
  width: 100%;
  margin-bottom: 16px;
  text-align: center;
}

#filters .form-group {
  flex: 0 1 auto;
  min-width: 200px;
  max-width: 300px;
  margin-bottom: 0;
}

/* Also handle Bootstrap .col class in filters */
#filters > .col {
  flex: 0 0 auto !important;
  max-width: none !important;
  width: auto !important;
}

/* New filter inputs container */
.filter-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.filter-field {
  flex: 0 0 auto;
}

.filter-field .input-group {
  width: 220px;
}

/* Filter fields with labels (CDR report style) */
.filter-field > label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-field > .form-control {
  width: 180px;
}

.filter-field-button {
  display: flex;
  flex-direction: column;
}

/* Match button height to input fields */
.filter-inputs .filter-field button.btn {
  padding: 12px 18px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.filter-field:last-child {
  /* Button field */
}

/* Fixed width for input groups in filter */
#filters > .col > .input-group {
  width: 220px;
}

/* Button column input-group should be auto width */
#filters > .col:last-of-type > .input-group {
  width: auto;
}

#filters .form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 12px 14px;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none !important;
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1), 0 0 20px rgba(88, 166, 255, 0.05) !important;
  background: rgba(13, 17, 23, 1) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

/* Ensure ALL inputs have dark background - ultra comprehensive */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="search"],
input[type="url"],
input:not([type]),
input,
textarea,
select {
  background: var(--bg-primary) !important;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* Target inputs by common Bootstrap/form classes */
.form-control,
.form-control[type="text"],
.form-control[type="password"],
input.form-control,
textarea.form-control,
select.form-control,
#filters input,
#filters select,
#filters textarea,
form input,
form textarea,
form select {
  background: var(--bg-primary) !important;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* Specific fix for white inputs - highest specificity */
html body input,
html body textarea,
html body select,
html body .form-control {
  background: var(--bg-primary) !important;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* Daterangepicker overrides */
.daterangepicker {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.daterangepicker .calendar-table {
  background-color: var(--bg-secondary) !important;
  border: none !important;
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
  background-color: var(--bg-hover) !important;
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
  background-color: var(--accent-blue) !important;
  color: #fff !important;
}

.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td {
  color: var(--text-primary) !important;
}

.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
  color: var(--text-muted) !important;
  background-color: transparent !important;
}

.daterangepicker select.monthselect,
.daterangepicker select.yearselect {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.daterangepicker .drp-buttons {
  background-color: var(--bg-tertiary) !important;
  border-top: 1px solid var(--border-color) !important;
}

.daterangepicker .drp-buttons .btn {
  background-color: var(--accent-blue) !important;
  border: none !important;
  color: #fff !important;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  min-height: 44px;
  line-height: 1.4;
  padding-top: 10px;
  padding-bottom: 10px;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.input-group-prepend,
.input-group-append {
  display: flex;
}

.input-group-text {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  align-self: stretch;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group > .form-control:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left: none !important;
}

.input-group-prepend + .form-control {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Override for SMS message row - restore full radius */
#reply_content form > .input-group > textarea.form-control {
  border-radius: var(--radius-md) !important;
  border-left: 1px solid var(--border-color) !important;
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* ========== BUTTON OVERRIDES ========== */
/* Must come after .form-control to override it */
/* Ultra-high specificity for Run Report button */
html body #filters .form-group button#run_report.btn.btn-primary.form-control,
html body button#run_report.btn.btn-primary.form-control,
html body #filters button#run_report,
html body button#run_report,
html body #run_report,
#filters button#run_report,
#run_report,
button.btn.form-control,
button[type="submit"].form-control,
#filters button[type="submit"] {
  background: #58a6ff !important;
  background-color: #58a6ff !important;
  border: 1px solid #58a6ff !important;
  border-color: #58a6ff !important;
  color: #ffffff !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  padding: 10px 20px !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.15s ease !important;
  /* Remove any outline button styling */
  outline: none !important;
  box-shadow: none !important;
  /* Center the text */
  text-align: center !important;
  /* Fix height overflow - let button size to content */
  height: auto !important;
  min-height: unset !important;
}

html body #filters .form-group button#run_report.btn.btn-primary.form-control:hover,
html body button#run_report.btn.btn-primary.form-control:hover,
#filters button#run_report:hover,
#run_report:hover,
button.btn.form-control:hover,
button[type="submit"].form-control:hover,
#filters button[type="submit"]:hover {
  background: #4c9aed !important;
  border-color: #4c9aed !important;
}

/* ========== TABLES ========== */
#customers {
  font-family: var(--font-sans);
  background: transparent;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  width: 100%;
}

/* Wrapper provides the card styling and scroll */
.table-wrapper {
  overflow-x: auto;
  width: 90%;
  margin: 24px auto;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table-wrapper #customers {
  width: 100%;
}

#customers thead {
  position: relative;
}

#customers th {
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, rgba(33, 38, 45, 0.95) 100%) !important;
  color: var(--text-secondary) !important;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 12px;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: relative;
}

/* Subtle separator between header cells */
#customers th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--border-color);
}

#customers td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  vertical-align: middle;
  transition: background var(--transition-fast);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Actions column - header centered, content right-aligned */
#customers th:last-child {
  text-align: center !important;
}

#customers td:last-child {
  text-align: right !important;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
}

/* SID column - truncate long UUIDs more aggressively */
.page-sms #customers td:nth-child(3) {
  max-width: 80px;
}

/* Message column - allow wrapping with more space */
.page-sms #customers td:nth-child(11) {
  max-width: 200px;
  min-width: 150px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  overflow: visible;
  text-align: left;
}

.page-sms #customers th:nth-child(11) {
  text-align: left;
}

/* CDR page - SIP Call ID column truncate */
.page-cdr_report #customers td:nth-child(5) {
  max-width: 80px;
}

#customers tr:last-child td {
  border-bottom: none;
}

/* Zebra striping */
#customers tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* Row hover effect */
#customers tbody tr:hover {
  background: rgba(88, 166, 255, 0.05) !important;
}

#customers tbody tr:hover td {
  color: var(--text-primary);
}

/* Table links */
#customers a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

#customers a:hover {
  color: #79b8ff;
  text-decoration: underline;
}

#customers a.red,
#customers a.delete,
#customers .delete_user {
  color: var(--accent-red);
}

#customers a.red:hover,
#customers a.delete:hover,
#customers .delete_user:hover {
  color: #ff6b6b;
}

/* ========== 2FA SECTION ========== */
.2fa_tokens,
div.2fa_tokens {
  margin: 24px auto;
  width: 90%;
}

/* OTP verification cell styling */
td.otp_verification {
  text-align: center !important;
  overflow: visible !important;
  max-width: none !important;
  font-family: var(--font-mono) !important;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--accent-blue);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.15) 0%, rgba(136, 87, 229, 0.1) 100%);
  transition: all var(--transition-normal);
  text-shadow: 0 0 20px rgba(56, 139, 253, 0.3);
  border-bottom: 1px solid var(--border-color) !important;
}

td.otp_verification:hover {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.25) 0%, rgba(136, 87, 229, 0.15) 100%);
}

/* Seconds remaining cell - center content */
td.seconds_remaining {
  text-align: center !important;
  overflow: visible !important;
  max-width: none !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.remaining_wrapper {
  font-family: var(--font-mono) !important;
  font-size: 14px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.remaining_wrapper.add_red {
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
}

progress.progress_bar {
  appearance: none;
  height: 6px;
  width: 60px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

progress.progress_bar::-webkit-progress-bar {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

progress.progress_bar::-webkit-progress-value {
  background: var(--gradient-green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

progress.progress_bar::-moz-progress-bar {
  background: var(--gradient-green);
  border-radius: 3px;
}

progress.progress_bar.red::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-red) 0%, var(--accent-orange) 100%);
}

progress.progress_bar.red::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent-red) 0%, var(--accent-orange) 100%);
}

/* ========== LABELS & BADGES ========== */
.label,
span.label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  display: inline-block;
  background: transparent;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-success {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.2) 0%, rgba(57, 197, 207, 0.15) 100%) !important;
  color: var(--accent-green) !important;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.label-danger {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.2) 0%, rgba(210, 153, 34, 0.1) 100%) !important;
  color: var(--accent-red) !important;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.label-info {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.2) 0%, rgba(163, 113, 247, 0.1) 100%) !important;
  color: var(--accent-blue) !important;
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.label-warning {
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.2) 0%, rgba(248, 81, 73, 0.1) 100%) !important;
  color: var(--accent-orange) !important;
  border: 1px solid rgba(210, 153, 34, 0.3);
}

/* Bootstrap label defaults override */
.label-default,
.label-primary {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

/* SMS Status text */
#customers td strong {
  background: transparent !important;
  border: none !important;
}

/* Ensure table cells don't get form-control styling */
#customers td,
#customers td * {
  box-shadow: none !important;
}

/* ========== REPLY CONTENT / SMS FORM ========== */
/* Hide by default - jQuery slideToggle will show when needed */
#reply_content {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.98) 100%) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  margin: 24px auto;
  width: 90%;
  padding: 28px;
  display: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Top accent line */
#reply_content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.3), transparent);
}

#reply_content .form-row,
#reply_content .col {
  background: transparent !important;
}

#reply_content form {
  overflow: visible;
}

#reply_content .input-group {
  margin-bottom: 16px;
  overflow: visible;
}

.send_sms_msg {
  color: var(--accent-green);
  font-weight: 500;
  padding: 12px 16px;
  background: rgba(63, 185, 80, 0.1);
  border-radius: var(--radius-md);
  margin-top: 12px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
}

.send_sms_msg:empty {
  display: none;
}

/* SMS compose form - textarea and button spacing */

/* The + prepend boxes for From/To Number - these ARE connected */
#reply_content .form-row .input-group .input-group-prepend .input-group-text {
  border-top-left-radius: var(--radius-md) !important;
  border-bottom-left-radius: var(--radius-md) !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

#reply_content .form-row .input-group .form-control {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: var(--radius-md) !important;
  border-bottom-right-radius: var(--radius-md) !important;
}

/* Message row - make elements SEPARATE with gaps */
#reply_content form > .input-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
  overflow: visible;
}

#reply_content form > .input-group > .input-group-prepend {
  margin: 0;
  position: relative;
  z-index: 1;
}

#reply_content form > .input-group > .input-group-prepend > .input-group-text {
  border-radius: var(--radius-md) !important;
  height: 100%;
}

#reply_content form > .input-group > textarea.form-control {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color) !important;
  flex: 1;
  position: relative;
  z-index: 1;
}

#reply_content form > .input-group > textarea.form-control:focus {
  z-index: 10;
}

#reply_content form > .input-group > .btn {
  border-radius: var(--radius-md) !important;
  flex-shrink: 0;
  align-self: stretch;
}

.msg_count {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 0;
  margin-top: 4px;
}

.msg_count:empty {
  display: none;
}

.msg_count.red {
  color: var(--accent-red);
}

/* ========== AUTOCOMPLETE ========== */
.ui-autocomplete {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow) !important;
  max-height: 200px;
  overflow-y: auto;
}

.ui-autocomplete > li {
  padding: 10px 16px !important;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.ui-autocomplete > li.ui-state-focus {
  background: var(--bg-hover) !important;
}

/* ========== GLYPHICONS ========== */
.glyphicon {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.glyphicon:hover {
  color: var(--accent-blue);
}

.glyphicon-play-circle {
  color: var(--accent-green);
}

.glyphicon-file {
  color: var(--accent-purple);
}

/* ========== UTILITIES ========== */
.hidden {
  display: none !important;
}

.red {
  color: var(--accent-red) !important;
}

.text-muted,
.light_text {
  color: var(--text-secondary);
  font-size: 11px;
}

.toggle_container td {
  padding: 30px !important;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.ui-tooltip {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  max-width: 500px;
}

#transcription-container {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  min-height: 100px;
  padding: 16px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* ========== RESPONSIVE / MOBILE ========== */
@media (max-width: 768px) {
  /* Container widths */
  #filters,
  #customers,
  #reply_content,
  .2fa_tokens,
  #action_btn {
    width: 95% !important;
    margin-left: auto;
    margin-right: auto;
  }
  
  #action_btn {
    padding: 12px 16px;
  }
  
  /* Navigation - wrap buttons nicely */
  #action_btn:first-of-type {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  
  #action_btn .btn {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  /* Stack form rows vertically */
  .form-row,
  .form-row.align-items-center,
  #filters.form-row,
  #reply_content .form-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  
  /* Make columns full width */
  .col,
  .form-row .col,
  #filters .col,
  #reply_content .col,
  [class^="col-"],
  [class*=" col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Input groups - MUST stay horizontal (prepend + input side by side) */
  .input-group,
  .input-group.mb-2,
  #filters .input-group,
  #reply_content .form-row .input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  
  .input-group .input-group-prepend,
  .input-group .input-group-append {
    display: flex !important;
    flex-shrink: 0 !important;
  }
  
  .input-group .form-control {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
  }
  
  /* Larger touch targets for inputs */
  .form-control,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 12px !important;
    height: auto !important;
  }
  
  /* Textareas need more height on mobile */
  textarea,
  textarea.form-control,
  #filters textarea,
  #filters .form-group textarea,
  textarea[name="sms_numbers"] {
    min-height: 200px !important;
    height: 200px !important;
  }
  
  /* Buttons - full width on mobile */
  #filters .btn,
  #filters button,
  #reply_content .btn,
  #reply_content button[type="submit"],
  button.btn-primary {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
    margin-top: 8px !important;
  }
  
  /* Search/Submit buttons in filters */
  #filters .input-group .btn,
  #filters .col .btn {
    width: 100% !important;
  }
  
  /* Tables - horizontal scroll handled by .table-wrapper */
  #customers th,
  #customers td {
    padding: 10px 8px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  
  /* Hide less important columns on mobile */
  #customers th:nth-child(n+6),
  #customers td:nth-child(n+6) {
    /* Optional: hide columns after 5th */
    /* display: none; */
  }
  
  /* Message column can wrap */
  #customers td:nth-last-child(2) {
    max-width: 150px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  
  /* Filter labels */
  #filters > label:first-child {
    width: 100%;
    margin-bottom: 12px;
  }
  
  /* Send SMS form adjustments */
  #reply_content {
    padding: 16px !important;
  }
  
  /* Stack the form rows vertically */
  #reply_content .form-row {
    display: block !important;
  }
  
  #reply_content .form-row .col {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 12px;
  }
  
  /* But keep input-groups HORIZONTAL (prepend + input side by side) */
  #reply_content .input-group,
  #reply_content .input-group.mb-2,
  #reply_content .form-row .col .input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  
  #reply_content .input-group .input-group-prepend {
    display: flex !important;
    flex-shrink: 0 !important;
  }
  
  #reply_content .input-group .input-group-prepend .input-group-text {
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
  }
  
  #reply_content .input-group .form-control,
  #reply_content .input-group input,
  #reply_content .input-group select,
  #reply_content .input-group textarea {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
  }
  
  /* Message textarea section - this one CAN stack vertically */
  #reply_content form > .input-group {
    display: flex !important;
    flex-direction: column !important;
    margin-top: 12px;
  }
  
  #reply_content form > .input-group > .input-group-prepend {
    width: 100%;
  }
  
  #reply_content form > .input-group > .input-group-prepend .input-group-text {
    border-radius: 8px 8px 0 0 !important;
    width: 100%;
    justify-content: center;
    display: flex;
  }
  
  #reply_content form > .input-group > textarea {
    border-radius: 0 !important;
    min-height: 100px !important;
    width: 100% !important;
  }
  
  #reply_content form > .input-group > button {
    border-radius: 0 0 8px 8px !important;
    width: 100%;
    margin-top: 0 !important;
  }
  
  /* Send button styling */
  #reply_content button[type="submit"],
  #reply_content .btn-primary {
    padding: 14px !important;
  }
  
  /* Login page */
  .login-container {
    padding: 16px;
  }
  
  .login-box {
    margin: 16px;
    padding: 24px 20px;
    width: calc(100% - 32px);
    max-width: 100%;
  }
  
  .login-box h2 {
    font-size: 20px;
  }
  
  .login-box input {
    font-size: 16px !important;
    padding: 12px !important;
  }
  
  /* 2FA tokens */
  .2fa_tokens {
    padding: 16px;
  }
  
  td.otp_verification {
    font-size: 14px;
    letter-spacing: 2px;
  }
  
  /* Compose button card */
  #action_btn:not(:first-of-type) {
    padding: 12px 16px;
  }
  
  /* Adjust margins for mobile */
  #filters,
  #customers,
  #reply_content,
  #action_btn {
    margin-top: 16px !important;
    margin-bottom: 16px !important;
  }
  
  /* Users page form */
  form .form-row {
    gap: 12px;
  }
  
  /* ===== FILTER-INPUTS MOBILE FIX ===== */
  /* Stack filter fields vertically on mobile */
  .filter-inputs {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  
  .filter-field {
    width: 100% !important;
  }
  
  .filter-field .input-group {
    width: 100% !important;
  }
  
  .filter-field > .form-control {
    width: 100% !important;
  }
  
  .filter-field > label {
    text-align: left !important;
  }
  
  /* 2FA form fields - stack vertically */
  #filters .filter-inputs .filter-field select.form-control,
  #filters .filter-inputs .filter-field input.form-control {
    width: 100% !important;
  }
  
  /* ===== TABLE WRAPPER MOBILE FIX ===== */
  .table-wrapper {
    width: 95% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Keep table as table for proper horizontal scroll */
  .table-wrapper #customers {
    display: table !important;
    width: max-content !important;
    min-width: 100% !important;
  }
  
  /* Override the display:block that breaks table scroll */
  #customers {
    display: table !important;
  }
  
  #customers thead {
    display: table-header-group !important;
  }
  
  #customers tbody {
    display: table-row-group !important;
  }
  
  #customers tr {
    display: table-row !important;
  }
  
  #customers th,
  #customers td {
    display: table-cell !important;
  }
  
  /* ===== FORCE HORIZONTAL INPUT-GROUPS IN REPLY_CONTENT ===== */
  /* Ultra-specific selectors to ensure prepend + input stay side-by-side */
  #reply_content form .form-row .col .input-group,
  #reply_content form .form-row .col .input-group.mb-2,
  #reply_content .form-row .col .input-group,
  #reply_content .col .input-group.mb-2,
  #reply_content .col .input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  
  #reply_content form .form-row .col .input-group .input-group-prepend,
  #reply_content .form-row .col .input-group .input-group-prepend,
  #reply_content .col .input-group .input-group-prepend {
    display: flex !important;
    flex-shrink: 0 !important;
    width: auto !important;
    flex-direction: row !important;
  }
  
  #reply_content form .form-row .col .input-group .input-group-text,
  #reply_content .form-row .col .input-group .input-group-text,
  #reply_content .col .input-group .input-group-text {
    display: flex !important;
    align-items: center !important;
    padding: 12px 14px !important;
    width: auto !important;
    height: auto !important;
  }
  
  #reply_content form .form-row .col .input-group .form-control,
  #reply_content form .form-row .col .input-group input,
  #reply_content form .form-row .col .input-group select,
  #reply_content .form-row .col .input-group .form-control,
  #reply_content .col .input-group .form-control {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  #action_btn .btn {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  #customers th,
  #customers td {
    padding: 8px 6px !important;
    font-size: 11px !important;
  }
  
  .login-box {
    padding: 20px 16px;
  }
}

/* ========== ACTION BUTTONS & ALIGNMENT ========== */

.actions-cell {
  white-space: nowrap;
  text-align: center !important;
}

.actions-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.recording-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recording-icon {
  color: var(--accent-blue);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
}

.recording-icon:hover {
  color: var(--accent-purple);
  transform: scale(1.15);
  text-decoration: none;
}

.btn-action,
a.btn-action {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.12) 0%, rgba(88, 166, 255, 0.06) 100%);
  border: 1px solid rgba(88, 166, 255, 0.25);
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
}

.btn-action:hover,
a.btn-action:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.22) 0%, rgba(88, 166, 255, 0.12) 100%);
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.15);
  transform: scale(1.03);
  text-decoration: none;
}

.btn-reply {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.12) 0%, rgba(63, 185, 80, 0.06) 100%);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--accent-green);
}

.btn-reply:hover {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.22) 0%, rgba(63, 185, 80, 0.12) 100%);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.2);
}

.btn-delete,
a.btn-delete {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.12) 0%, rgba(248, 81, 73, 0.06) 100%);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--accent-red);
}

.btn-delete:hover,
a.btn-delete:hover {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.22) 0%, rgba(248, 81, 73, 0.12) 100%);
  box-shadow: 0 0 10px rgba(248, 81, 73, 0.2);
  color: var(--accent-red);
}

.btn-edit {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.12) 0%, rgba(56, 139, 253, 0.06) 100%);
  border-color: rgba(56, 139, 253, 0.3);
  color: var(--accent-blue);
  text-decoration: none;
}

.btn-edit:hover {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.22) 0%, rgba(56, 139, 253, 0.12) 100%);
  box-shadow: 0 0 10px rgba(56, 139, 253, 0.2);
  color: var(--accent-blue);
}

/* ========== EXPANDABLE TABLE ROWS (ALL SCREEN SIZES) ========== */

/* Toggle button styling */
.toggle-details {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15) 0%, rgba(163, 113, 247, 0.1) 100%);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.toggle-details:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.25) 0%, rgba(163, 113, 247, 0.15) 100%);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.2);
  transform: scale(1.05);
}

.toggle-details:active {
  transform: scale(0.98);
}

/* ========== DESKTOP: Hide some columns, keep "more" button ========== */
@media (min-width: 769px) {
  /* SMS Page - Hide: sid(3), info(7), geo from(9), geo to(10) */
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(3),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(3),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(7),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(7),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(9),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(9),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(10),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(10) {
    display: none !important;
  }
  
  /* CDR Page - Hide: sip call id(5), cost(6), rate(7) */
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(5),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(5),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(6),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(6),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(7),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(7) {
    display: none !important;
  }
  
  /* CDR Page - Hide redundant items in "more" section on desktop */
  /* Show: SIP Call ID(3), Cost(4), Rate(5) - Hide: Orgn City(1), Orgn LATA(2), Started(6), Answered(7), Ended(8) */
  .page-cdr_report #customers .mobile-details-content .mobile-details-item:nth-child(1),
  .page-cdr_report #customers .mobile-details-content .mobile-details-item:nth-child(2),
  .page-cdr_report #customers .mobile-details-content .mobile-details-item:nth-child(n+6) {
    display: none !important;
  }
  
  /* SMS Page - Hide redundant items in "more" section on desktop */
  /* Only show: SID, Info, Geo From, Geo To (hide: ID, Provider, Date) */
  .page-sms #customers .mobile-details-content .mobile-details-item:nth-child(1),
  .page-sms #customers .mobile-details-content .mobile-details-item:nth-child(2),
  .page-sms #customers .mobile-details-content .mobile-details-item:nth-child(4) {
    display: none !important;
  }
  
  /* Hide expandable row on desktop (shown via "more" button) */
  .mobile-details {
    display: none !important;
  }
}

/* ========== MOBILE ONLY: Hide columns, show "more" button ========== */
@media (max-width: 768px) {
  /* CDR Page - Hide: orgn city(2), orgn lata(3), sip call id(5), rate(7), started(9), answered(10), ended(11) */
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(2),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(2),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(3),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(3),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(5),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(5),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(7),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(7),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(9),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(9),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(10),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(10),
  .page-cdr_report #customers tr:not(.mobile-details) > th:nth-child(11),
  .page-cdr_report #customers tr:not(.mobile-details) > td:nth-child(11) {
    display: none !important;
  }

  /* SMS Page - Hide: id(1), provider(2), sid(3), date(4), info(7), geo from(9), geo to(10) */
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(1),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(1),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(2),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(2),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(3),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(3),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(4),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(4),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(7),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(7),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(9),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(9),
  .page-sms #customers tr:not(.mobile-details) > th:nth-child(10),
  .page-sms #customers tr:not(.mobile-details) > td:nth-child(10) {
    display: none !important;
  }

  /* 2FA Page - Hide: id(1), otp type(3), created at(6) */
  .page-2fa #customers tr:not(.mobile-details) > th:nth-child(1),
  .page-2fa #customers tr:not(.mobile-details) > td:nth-child(1),
  .page-2fa #customers tr:not(.mobile-details) > th:nth-child(3),
  .page-2fa #customers tr:not(.mobile-details) > td:nth-child(3),
  .page-2fa #customers tr:not(.mobile-details) > th:nth-child(6),
  .page-2fa #customers tr:not(.mobile-details) > td:nth-child(6) {
    display: none !important;
  }
}

/* ========== PAGE-SPECIFIC COLUMN ALIGNMENT ========== */

/* 2FA Page - Label column (col 2) left-aligned */
.page-2fa #customers th:nth-child(2),
.page-2fa #customers td:nth-child(2) {
  text-align: left !important;
}

/* SMS Page - From column (col 5) left-aligned */
.page-sms #customers th:nth-child(5),
.page-sms #customers td:nth-child(5) {
  text-align: left !important;
}

/* CDR Page - Orgn Number column (col 1) left-aligned */
.page-cdr_report #customers th:nth-child(1),
.page-cdr_report #customers td:nth-child(1) {
  text-align: left !important;
}

/* Users Page - first column left-aligned */
.page-users #customers th:nth-child(1),
.page-users #customers td:nth-child(1) {
  text-align: left !important;
}

/* Expandable details row - hidden by default */
.mobile-details {
  display: none;
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%) !important;
}

/* Show when toggled */
.mobile-details.show {
  display: table-row !important;
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-details td {
  padding: 16px 24px !important;
  border-top: 1px solid rgba(88, 166, 255, 0.1) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.mobile-details-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.mobile-details-item {
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(88, 166, 255, 0.3);
  min-width: 0 !important;
  word-wrap: break-word;
}

.mobile-details-label,
div.mobile-details-label {
  display: block !important;
  font-size: 10px !important;
  color: var(--accent-blue) !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px !important;
  font-weight: 600;
  width: 100% !important;
}

.mobile-details-value,
div.mobile-details-value {
  display: block !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  word-break: break-all;
  font-family: var(--font-mono);
  width: 100% !important;
}

/* Extra specificity for table context */
#customers .mobile-details-item {
  display: flex !important;
  flex-direction: column !important;
}

#customers .mobile-details-label,
table .mobile-details-label,
tr .mobile-details-label,
td .mobile-details-label {
  display: block !important;
  width: 100% !important;
}

#customers .mobile-details-value,
table .mobile-details-value,
tr .mobile-details-value,
td .mobile-details-value {
  display: block !important;
  width: 100% !important;
}

/* ========== TEXT UTILITY CLASSES ========== */

.text-error {
  color: var(--accent-red) !important;
}

.text-success {
  color: var(--accent-green) !important;
}

.text-warning {
  color: var(--accent-orange) !important;
}

.text-info {
  color: var(--accent-blue) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ========== STATUS BADGES ========== */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.status-inactive {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

/* SMS Status Badges */
.sms-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  min-width: 90px;
  text-align: center;
  box-sizing: border-box;
}

.sms-status-received {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.15) 0%, rgba(136, 87, 229, 0.1) 100%);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.sms-status-delivered {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.15) 0%, rgba(57, 197, 207, 0.1) 100%);
  color: var(--accent-green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.sms-status-sent {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.15) 0%, rgba(136, 87, 229, 0.1) 100%);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.sms-status-undelivered {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.15) 0%, rgba(248, 81, 73, 0.1) 100%);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.sms-status-failed {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.15) 0%, rgba(248, 81, 73, 0.1) 100%);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

/* Empty status - hide or show minimal */
.sms-status:empty {
  display: none;
}

/* Legacy label classes */
.label-success {
  background: rgba(63, 185, 80, 0.15) !important;
  color: var(--accent-green) !important;
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
}

.label-danger {
  background: rgba(248, 81, 73, 0.15) !important;
  color: var(--accent-red) !important;
  border: 1px solid rgba(248, 81, 73, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
}

/* ========== EDIT NUMBERS TEXTAREA ========== */

textarea.ntxt {
  width: 100% !important;
  min-height: 400px !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  resize: vertical;
  padding: 16px !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
}

/* ========== MANUAL DIAL PAGE ========== */

.manual-dial-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 500px;
}

.manual-dial-wrapper .form-control {
  flex: 1;
}

.manual-dial-wrapper .dial-btn {
  flex-shrink: 0;
  padding: 12px 24px;
}

#transcription-container {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  min-height: 0;
  display: none;
}

#transcription-container:not(:empty) {
  display: block;
}

/* ========== GLOBAL BOOTSTRAP OVERRIDES ========== */
/* Catch any remaining light backgrounds from Bootstrap */
.card,
.card-body,
.card-header,
.card-footer,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.alert,
.well,
.panel,
.panel-body,
.panel-heading,
.jumbotron,
.popover,
.tooltip-inner {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Force dark backgrounds on all form elements */
.form-control,
.custom-select,
.custom-file-input,
.custom-file-label {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Ensure row and column backgrounds are transparent */
.row,
.col,
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm, .col-md, .col-lg, .col-xl,
[class*="col-"] {
  background-color: transparent !important;
}

/* Dropdown menus */
.dropdown-menu,
.dropdown-item {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--bg-hover) !important;
}

/* List groups */
.list-group-item {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Breadcrumbs and navs */
.breadcrumb,
.nav-tabs,
.nav-pills {
  background-color: transparent !important;
}

.breadcrumb-item,
.nav-link {
  color: var(--text-primary) !important;
}

/* ========== FINAL OVERRIDES (HIGHEST PRIORITY) ========== */
/* These rules MUST be at the end to override Bootstrap */

/* Run Report Button - Ultimate Override */
html body #filters .form-group button#run_report,
html body button#run_report,
body button#run_report,
button#run_report,
#run_report {
  background-color: #58a6ff !important;
  background: #58a6ff !important;
  border-color: #58a6ff !important;
  border: 1px solid #58a6ff !important;
  color: #ffffff !important;
  text-align: center !important;
  height: auto !important;
}

html body #filters .form-group button#run_report:hover,
html body button#run_report:hover,
body button#run_report:hover,
button#run_report:hover,
#run_report:hover {
  background-color: #4c9aed !important;
  background: #4c9aed !important;
  border-color: #4c9aed !important;
}

/* All primary buttons */
html body .btn.btn-primary,
body .btn.btn-primary,
.btn.btn-primary {
  background-color: #58a6ff !important;
  background: #58a6ff !important;
  border-color: #58a6ff !important;
  color: #ffffff !important;
  text-align: center !important;
}

html body .btn.btn-primary:hover,
body .btn.btn-primary:hover,
.btn.btn-primary:hover {
  background-color: #4c9aed !important;
  background: #4c9aed !important;
  border-color: #4c9aed !important;
}

/* ========== FINAL INPUT OVERRIDES ========== */
/* Force dark backgrounds on ALL inputs - highest specificity */
html body input,
html body textarea,
html body select,
html body input.form-control,
html body textarea.form-control,
html body select.form-control,
html body #filters input,
html body #filters select,
html body form input,
html body form textarea,
html body form select,
html body input[type="text"],
html body input[type="password"],
html body input[type="email"],
html body input[type="number"],
html body input[type="tel"],
html body input[type="search"],
html body input[type="url"],
input[type="text"],
input[type="password"],
input[type="email"] {
  background: #0d1117 !important;
  background-color: #0d1117 !important;
  color: #e6edf3 !important;
  border-color: #30363d !important;
}

/* Buttons should NOT have input styling */
html body button,
html body input[type="submit"],
html body input[type="button"],
html body .btn {
  background: inherit;
  color: inherit;
}

/* ========== PAGE BACKGROUND - TRANSPARENT FOR GRADIENT ========== */
/* Background handled by body::before pseudo-element */

/* ========== REPLY CONTENT FINAL FIX ========== */
html body #reply_content,
body #reply_content,
#reply_content,
div#reply_content {
  background: #161b22 !important;
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  -webkit-border-radius: 12px !important;
  -moz-border-radius: 12px !important;
  margin: 24px auto !important;
  width: 90% !important;
  padding: 24px !important;
  overflow: hidden !important;
}

/* ========== ABSOLUTE FINAL INPUT FIX ========== */
input, textarea, select {
  background: #0d1117 !important;
  background-color: #0d1117 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
}

button, input[type="submit"], input[type="button"], .btn {
  background: #21262d !important;
  color: #e6edf3 !important;
}

.btn-primary, button.btn-primary, input[type="submit"].btn-primary {
  background: #58a6ff !important;
  background-color: #58a6ff !important;
  color: #ffffff !important;
}

/* ========== MOBILE NUCLEAR OVERRIDE ========== */
@media (max-width: 768px) {
  /* Force input-groups in reply_content to stay horizontal */
  #reply_content .form-row .col .input-group,
  #reply_content .form-row .col .input-group.mb-2 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
  }
  
  #reply_content .form-row .col .input-group > .input-group-prepend {
    width: auto !important;
    max-width: 50px !important;
    display: flex !important;
    flex-shrink: 0 !important;
  }
  
  #reply_content .form-row .col .input-group > .form-control,
  #reply_content .form-row .col .input-group > input,
  #reply_content .form-row .col .input-group > select {
    flex: 1 1 0% !important;
    width: 0 !important;
    min-width: 0 !important;
  }
  
  /* ===== FILTER-INPUTS NUCLEAR FIX ===== */
  .filter-inputs,
  #filters .filter-inputs,
  form .filter-inputs {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
  }
  
  .filter-field,
  #filters .filter-field,
  .filter-inputs .filter-field {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  .filter-field .input-group,
  .filter-field > .form-control,
  .filter-field > select,
  .filter-field > input {
    width: 100% !important;
  }
  
  /* ===== TABLE WRAPPER NUCLEAR FIX ===== */
  .table-wrapper {
    width: 95% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .table-wrapper #customers,
  #customers {
    display: table !important;
    width: max-content !important;
    min-width: 600px !important;
  }
  
  #customers thead {
    display: table-header-group !important;
  }
  
  #customers tbody {
    display: table-row-group !important;
  }
  
  #customers tr:not(.mobile-details) {
    display: table-row !important;
  }
  
  /* Keep mobile-details hidden unless .show is added */
  #customers tr.mobile-details {
    display: none !important;
  }
  
  #customers tr.mobile-details.show {
    display: table-row !important;
  }
  
  #customers th,
  #customers td {
    display: table-cell !important;
  }
}

/* ========== EXPANDABLE ROWS OVERRIDE (ALL SCREEN SIZES) ========== */
tr.mobile-details.show,
.mobile-details.show,
table tr.mobile-details.show {
  display: table-row !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ========== NUCLEAR FIX: LABEL AND VALUE MUST BE ON SEPARATE LINES ========== */
span.mobile-details-label,
.mobile-details-label {
  display: block !important;
  width: 100% !important;
  margin-bottom: 6px !important;
}

span.mobile-details-value,
.mobile-details-value {
  display: block !important;
  width: 100% !important;
}

/* ========== TOAST NOTIFICATION ========== */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(88, 166, 255, 0.2);
  border: 1px solid var(--accent-blue);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification i {
  color: var(--accent-blue);
  font-size: 16px;
}

/* ========== LOAD MORE BUTTON ========== */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px 0;
  margin-top: 16px;
}

.btn-load-more {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.15) 0%, rgba(136, 87, 229, 0.1) 100%);
  border: 1px solid rgba(56, 139, 253, 0.3);
  color: var(--accent-blue);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-sans);
}

.btn-load-more:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.25) 0%, rgba(136, 87, 229, 0.15) 100%);
  box-shadow: 0 0 20px rgba(56, 139, 253, 0.2);
  transform: translateY(-2px);
}

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

.btn-load-more i {
  margin-right: 8px;
}

.load-more-count {
  opacity: 0.7;
  font-weight: 400;
  margin-left: 4px;
}

.all-loaded {
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

/* ========== EDIT NUMBERS PAGE ========== */
.edit-numbers-wrapper {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 24px auto;
  width: 90%;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.edit-numbers-wrapper form {
  display: block;
  width: 100%;
}

.edit-numbers-wrapper textarea.ntxt {
  width: 100% !important;
  min-height: 500px !important;
}

/* ========== TEXTAREA FORM LAYOUT (SMS Numbers, Edit Numbers) ========== */
#filters:has(textarea) {
  display: block;
}

#filters:has(textarea) .form-group {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin-bottom: 16px;
}

#filters .form-group textarea.form-control {
  width: 100% !important;
  min-height: 400px;
  resize: vertical;
}

/* Save button below textarea, centered and wider */
#filters:has(textarea) > button.btn-primary,
#filters:has(textarea) .form-group + button.btn-primary {
  display: block;
  margin: 20px auto 0 auto;
  padding: 14px 80px;
  font-size: 15px;
  min-width: 200px;
}

/* Ensure form-group label for textarea sections matches the style */
#filters .form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

/* Center label on textarea pages */
#filters:has(textarea) .form-group label {
  text-align: center;
  display: block;
}

/* Remove margin causing layout issues in filters */
#filters .input-group.mb-2 {
  margin-bottom: 0 !important;
}
