/* ==========================================================================
   GSM SIP Gateway Style Sheet
   Designed with Slate-Teal Premium Dark Visuals, Glassmorphism, & Animations
   ========================================================================== */

/* Theme Variables & Tokens */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  /* Slate & Teal Palette */
  --bg-app: #080c14;
  --bg-panel: #0f172a;
  --bg-panel-soft: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #14b8a6;
  
  /* Accents */
  --accent: #0d9488;
  --accent-hover: #14b8a6;
  --accent-glow: rgba(20, 184, 166, 0.15);
  --accent-weak: rgba(13, 148, 136, 0.15);

  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 20px rgba(13, 148, 136, 0.25);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

/* Reset & Base Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-panel-soft);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Buttons */
button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
}

button.primary {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
button.primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.3);
}
button.primary:active {
  transform: translateY(1px);
}

button.secondary {
  background-color: var(--bg-panel-soft);
  border-color: var(--border-color);
  color: var(--text-primary);
}
button.secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

button.success {
  background-color: var(--color-success);
  color: #ffffff;
}
button.success:hover {
  background-color: #059669;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

button.warning {
  background-color: var(--color-warning);
  color: #111827;
}
button.warning:hover {
  background-color: #d97706;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

button.danger {
  background-color: var(--color-danger);
  color: #ffffff;
}
button.danger:hover {
  background-color: #dc2626;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
  transition: all var(--transition-fast);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select option {
  background-color: var(--bg-panel);
  color: var(--text-primary);
}

textarea {
  resize: vertical;
}

.btn-block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: var(--bg-panel-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.badge-accent {
  background-color: var(--accent-weak);
  color: var(--accent-hover);
  border-color: rgba(20, 184, 166, 0.2);
}
.badge.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}
.badge.error, .badge.bad {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */

/* Topbar Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  min-height: 64px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  animation: pulse-logo 2.5s infinite;
}

@keyframes pulse-logo {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--accent)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 6px var(--accent)); }
}

.topbar-title h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subline {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

/* Login Screen */
.login-screen {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top, #1e1b4b 0%, var(--bg-app) 70%);
}

.login-panel {
  width: 100%;
  max-width: 400px;
  animation: fade-in-up 0.4s ease-out;
}

.login-actions {
  margin-top: 24px;
}

/* Admin Shell Layout */
.admin-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Cards & Panels */
.panel {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.panel-header-title svg {
  color: var(--accent-hover);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

/* Stats Container */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
}

.stat-card span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-hover);
  line-height: 1.2;
  margin: 6px 0 2px 0;
}

.stat-card em {
  font-size: 11px;
  font-style: normal;
  color: var(--text-muted);
}

/* Tab Navigation */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.tab.active {
  color: #ffffff;
  background-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.tab svg {
  opacity: 0.7;
}

.tab.active svg {
  opacity: 1;
}

.tab-panel {
  display: none;
  animation: fade-in 0.25s ease-out;
}

.tab-panel.active {
  display: block;
}

/* Split Views */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 20px;
}

/* Custom Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  text-align: left;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: auto;
}

.list-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-hover);
  transform: scale(1.01);
}

.list-item.selected {
  background: linear-gradient(135deg, var(--accent-weak) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: var(--accent-hover);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.1);
}

.list-item > span:first-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.list-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.list-item small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.list-item .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
  flex-shrink: 0;
}

.list-item .right b {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.list-item .right b.ok {
  color: var(--color-success);
}

.list-item .right b.bad {
  color: var(--color-danger);
}

.list-item .gateway-status-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.status-icon.ok {
  color: var(--color-success);
  background-color: var(--color-success-bg);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.status-icon.bad {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Empty State */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  background-color: rgba(0, 0, 0, 0.1);
}

/* Key Value Lists */
.kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kv div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
}

.kv div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kv span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  padding-top: 2px;
}

.kv strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* Selected Gateway Specs Overhaul */
.gw-details-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.gw-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
}

.gw-detail-row-vertical {
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 4px;
}

.gw-detail-row:last-child,
.gw-detail-row-vertical:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.gw-detail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.gw-detail-label svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.gw-detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-detail-value.monospace {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}

.device-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.device-action-grid button {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.vpn-code-pill {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-hover);
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
}

.status-pill.ok {
  color: var(--color-success);
  background-color: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.bad {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.calls-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.call-mini-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  gap: 3px;
  transition: all var(--transition-fast);
}

.call-mini-box:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--border-focus);
}

.call-mini-box span {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.call-mini-box strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.sim-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.sim-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.sim-pill:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--border-focus);
}

.sim-pill strong {
  color: var(--accent-hover);
  font-weight: 600;
}

.sim-pill svg {
  color: var(--text-secondary);
  opacity: 0.8;
  flex-shrink: 0;
}

/* Active Calls */
.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
}

.call-row strong {
  font-size: 13px;
  color: var(--accent-hover);
}

.call-row small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* SMS Timeline Message Feed */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.message {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color var(--transition-fast);
}

.message.inbound {
  border-left: 3px solid var(--color-success);
}

.message.outbound {
  border-left: 3px solid var(--color-warning);
}

.message-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.message-head strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-head span {
  color: var(--text-muted);
}

.message p {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
}

.message-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Checkbox Grid (Gateways Assign) */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
}

.check-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: auto;
  border-radius: 4px;
  cursor: pointer;
}

.toggles {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.toggle-checkbox input {
  width: 16px;
  height: 16px;
  min-height: auto;
  border-radius: 4px;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background-color: var(--bg-panel);
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

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

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Instruction Panels & Code Areas */
.instruction-panel {
  max-height: 800px;
  overflow-y: auto;
}

.instruction-content h3 {
  font-size: 13.5px;
  margin: 18px 0 8px 0;
  color: var(--accent-hover);
  font-weight: 600;
}
.instruction-content h3:first-of-type {
  margin-top: 0;
}

.instruction-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.code-block {
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
  margin-bottom: 16px;
}

.code-area {
  font-family: monospace;
  font-size: 12px;
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  padding: 10px;
  border-radius: 8px;
}

.vpn-generation-box {
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
}

.vpn-generation-box h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.description-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.vpn-result-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.vpn-result-panel h3 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--color-success);
}

/* ==========================================================================
   Client UI (Mobile/Mini App Phone Layout)
   ========================================================================== */

.client-body {
  background-color: #030712;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Sleek Mockup Phone frame on Desktop */
.client-phone-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 16px;
}

.client-phone {
  width: 100%;
  max-width: 410px;
  height: 840px;
  background-color: #090d16;
  border: 10px solid #1f2937;
  border-radius: 40px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Hide outer phone borders on mobile screen viewports */
@media (max-width: 480px) {
  .client-phone-container {
    padding: 0;
  }
  .client-phone {
    max-width: 100%;
    height: 100vh;
    border: none;
    border-radius: 0;
  }
}

/* Login section specifically optimized for phone UI */
.client-login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 32px 24px;
  border: none;
  box-shadow: none;
  background: transparent;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: var(--shadow-accent);
}

.client-login h2 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.wide-button {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
}

.primary-btn {
  background-color: var(--accent);
  color: #ffffff;
}
.primary-btn:hover {
  background-color: var(--accent-hover);
}
.secondary-btn {
  background-color: var(--bg-panel-soft);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Main App Wrapper within Phone container */
#client-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 74px; /* Space for the bottom navbar */
}

/* Client Header */
.client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.client-header h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.client-status-line {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.client-header .icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0;
}
.client-header .icon-button:active {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Gateway & Status strip card */
.client-gateway-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 16px;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.gateway-select-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gateway-select-box label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gateway-select-box select {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13.5px;
  border: none;
  background-color: transparent;
}
.gateway-select-box select:focus {
  box-shadow: none;
}

.line-status {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  white-space: nowrap;
}

.line-status.online {
  color: var(--color-success);
  background-color: var(--color-success-bg);
}

.line-status.offline {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
}

/* Main Panel viewport scrolls */
.client-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 16px 16px;
}

.client-tab-panel {
  display: none;
  height: 100%;
}
.client-tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Dialer screen layouts */
.call-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.call-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  min-height: 90px;
}

.phone-display {
  width: 100%;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  text-align: center;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  padding: 0;
  min-height: 45px;
}

.call-status-badge {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-hover);
  margin-top: 4px;
}

/* Dialer Keypad Grid */
.dial-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 22px;
  padding: 0 16px;
  margin: 0 auto;
  width: 100%;
  max-width: 320px;
}

.dial-button {
  width: 66px;
  height: 66px;
  min-height: 66px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), transform 0.1s ease;
  padding: 0;
  cursor: pointer;
  margin: 0 auto;
}

.dial-button:active {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(0.9);
}

.dial-button .digit {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
}

.dial-button .letters {
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: -2px;
}

/* Dialer Main Actions block */
.call-actions-main {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 0 16px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.action-button {
  width: 50px;
  height: 50px;
  min-height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0;
  margin: 0 auto;
}
.action-button:active {
  background-color: rgba(255, 255, 255, 0.08);
  transform: scale(0.92);
}

.call-button-main {
  width: 64px;
  height: 64px;
  min-height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  padding: 0;
  margin: 0 auto;
}
.call-button-main:active {
  transform: scale(0.9);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.action-button.end-call {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}
.action-button.end-call:active {
  transform: scale(0.9);
}

.action-button.end-call.disabled {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.3;
}

/* History logs list in dialing view */
.calls-history {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  overflow-y: auto;
  flex: 1;
}

.calls-history-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.call-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.call-history-item:last-child {
  border-bottom: none;
}

.call-history-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.call-history-icon.active {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  animation: pulse-ring-call 1.5s infinite;
}

@keyframes pulse-ring-call {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.call-history-info {
  flex: 1;
  min-width: 0;
}
.call-history-info strong {
  font-size: 14px;
  color: var(--text-primary);
  display: block;
}
.call-history-info span {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

/* SMS Section specifically optimized for client view */
.sms-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.sms-form-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.sms-text-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.sms-length {
  font-size: 11px;
  color: var(--text-muted);
}

.sms-send-button {
  background-color: var(--accent);
  color: #ffffff;
  border-radius: 10px;
  font-weight: 600;
}
.sms-send-button:hover {
  background-color: var(--accent-hover);
}

.sms-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sms-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sms-history-header h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

/* Modern Speech Chat Bubbles UI */
.message-item {
  display: flex;
  width: 100%;
}

.message-item.incoming {
  justify-content: flex-start;
}
.message-item.outgoing {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.message-item.incoming .message-bubble {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message-item.outgoing .message-bubble {
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  border-bottom-right-radius: 4px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 12px;
}
.message-header strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.message-item.outgoing .message-header strong {
  color: rgba(255, 255, 255, 0.9);
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
}
.message-item.outgoing .message-time {
  color: rgba(255, 255, 255, 0.6);
}

.message-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  word-wrap: break-word;
}
.message-item.outgoing .message-text {
  color: #ffffff;
}

.message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 9.5px;
  color: var(--text-muted);
}
.message-item.outgoing .message-footer {
  color: rgba(255, 255, 255, 0.7);
}

.message-gateway {
  font-weight: 600;
}
.message-status {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
}

/* Elegant Bottom Sticky Nav Bar inside the mockup viewport */
.client-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px 4px;
  z-index: 99;
}

.client-nav-button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: auto;
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: 0;
  border-radius: 8px;
}

.client-nav-button svg {
  transition: transform var(--transition-fast);
}

.client-nav-button:hover {
  color: var(--text-primary);
}

.client-nav-button.active {
  color: var(--accent-hover);
}
.client-nav-button.active svg {
  transform: translateY(-1px);
}

/* Incoming Call Card pulsing panel overlays */
.incoming-card {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 1.5px solid var(--accent);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(20, 184, 166, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slide-in-top 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-top {
  from { transform: translateY(-100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.incoming-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.incoming-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--accent-weak);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vibrate-phone 1.5s infinite;
}

@keyframes vibrate-phone {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-8deg); }
  20%, 40%, 60%, 80% { transform: rotate(8deg); }
}

.incoming-info {
  flex: 1;
  min-width: 0;
}
.incoming-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}
.incoming-info strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-top: 1px;
  word-break: break-all;
}

.incoming-card .call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.incoming-card .call-actions button {
  min-height: 38px;
  font-size: 13.5px;
  border-radius: 8px;
  font-weight: 600;
}

.incoming-card .answer-button {
  background-color: var(--color-success);
  color: #ffffff;
}
.incoming-card .decline-button {
  background-color: var(--color-danger);
  color: #ffffff;
}

/* ==========================================================================
   Toast Notification Popups
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 320px;
  padding: 12px 18px;
  color: #ffffff;
  background-color: var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-xl), 0 0 10px rgba(13, 148, 136, 0.3);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: slide-in-bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-bottom {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.error {
  background-color: var(--color-danger);
  box-shadow: var(--shadow-xl), 0 0 10px rgba(239, 68, 68, 0.3);
}

#client-toast.toast {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: auto;
  left: auto;
  max-width: 250px;
  background-color: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 10px rgba(20, 184, 166, 0.15);
  z-index: 2000;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  animation: slide-in-top-right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-top-right {
  from { transform: translate(30px, -15px); opacity: 0; }
  to { transform: translate(0, 0); opacity: 1; }
}

/* ==========================================================================
   Keyframes & General Animations
   ========================================================================== */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Media Queries (Admin Layouts)
   ========================================================================== */

@media (max-width: 1060px) {
  .admin-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
  }
  
  .sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 16px;
  }
  .topbar-right .admin-profile {
    display: none; /* Hide admin profile text to save space */
  }
  .split {
    grid-template-columns: 1fr;
  }
  .command-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .topbar-title h1 {
    font-size: 16px;
  }
  .topbar-title .subline {
    display: none;
  }
  .tabs {
    flex-wrap: nowrap;
  }
  .tab span {
    display: none; /* Icon-only tabs on tiny mobile screens for dashboard */
  }
  .tab {
    padding: 0 12px;
  }
}

/* ==========================================================================
   Phase 3 Client UI Additions (Status, Active Call Screen, Recents, Contacts)
   ========================================================================== */

#client-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.client-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger);
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: inline-block;
}

.client-status-dot.active {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* Call Views */
.dialer-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.active-call-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 40px 16px;
  flex: 1;
  animation: fade-in 0.3s ease;
}

.active-call-avatar-container {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-call-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 2;
}

.active-call-avatar-glow {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: var(--accent);
  opacity: 0.15;
  z-index: 1;
  animation: avatar-pulse-glow 2.2s infinite ease-in-out;
}

@keyframes avatar-pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.6);
    opacity: 0.3;
  }
  70% {
    transform: scale(1.25);
    box-shadow: 0 0 0 24px rgba(20, 184, 166, 0);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
    opacity: 0;
  }
}

.active-call-details {
  text-align: center;
  margin: 20px 0;
}

.active-call-number {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.active-call-phone {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: -4px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.active-call-status {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--accent-hover);
  animation: text-pulse 1.6s infinite ease-in-out;
}

.active-call-timer {
  min-height: 34px;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.active-call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  width: 100%;
  margin-top: 30px;
}

.hangup-button-large,
.mute-button-large {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  flex: 0 0 76px;
}

.hangup-button-large {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.mute-button-large {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.mute-button-large.is-muted {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.25);
}

.mute-button-large .mic-off-icon {
  display: none;
}

.mute-button-large.is-muted .mic-on-icon {
  display: none;
}

.mute-button-large.is-muted .mic-off-icon {
  display: block;
}

.mute-button-large:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.hangup-button-large:active,
.mute-button-large:active:not(:disabled) {
  transform: scale(0.9);
}

.hangup-button-large:active {
  box-shadow: 0 5px 12px rgba(239, 68, 68, 0.3);
}

/* Recents Screen */
.recents-screen, .favorites-screen, .contacts-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.recents-header-row, .favorites-header-row, .contacts-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.recents-header-row h3, .favorites-header-row h3, .contacts-header-row h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.text-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}
.text-button:hover {
  color: var(--color-danger);
}

.recents-list, .favorites-list, .contacts-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.recent-item, .favorite-item, .contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.recent-item:hover, .favorite-item:hover, .contact-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.recent-item:active, .favorite-item:active, .contact-item:active {
  transform: scale(0.995);
}

.recent-left, .favorite-left, .contact-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.recent-avatar, .favorite-avatar, .contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.recent-info, .favorite-info, .contact-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.recent-info strong, .favorite-info strong, .contact-info strong {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-info span, .favorite-info span, .contact-info span {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-info span.type-outgoing {
  color: var(--accent-hover);
}
.recent-info span.type-incoming {
  color: var(--color-success);
}
.recent-info span.type-missed {
  color: var(--color-danger);
}

.recent-right, .favorite-right, .contact-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn-circle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.action-btn-circle svg {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  flex: 0 0 15px;
  display: block;
}

.action-btn-circle:hover {
  background-color: var(--accent-weak);
  color: var(--accent-hover);
  border-color: var(--accent-weak);
}

.action-btn-circle.call-icon:hover {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success-bg);
}

.action-btn-circle.favorite-icon.is-favorite {
  color: #fbbf24;
  background-color: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.action-btn-circle.add-contact-icon:hover {
  color: #60a5fa;
  background-color: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
}

.recent-avatar.type-missed {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
}

.favorite-avatar {
  color: #fbbf24;
}

@media (max-width: 380px) {
  .client-nav-button {
    font-size: 9px;
  }

  .client-nav-button svg {
    width: 18px;
    height: 18px;
  }

  .recent-item, .favorite-item, .contact-item {
    padding-inline: 10px;
  }

  .action-btn-circle {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    flex-basis: 30px;
  }
}

.action-btn-circle.delete-icon:hover {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-bg);
}

/* Contacts Specific Actions & Search */
.contacts-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn-sm {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-btn-sm:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.contacts-search-box {
  margin-bottom: 12px;
  width: 100%;
}

.contacts-search-box input {
  width: 100%;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.contacts-search-box input:focus {
  border-color: var(--accent);
}

/* Contact Creator Card Form */
.contact-form-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-in-up 0.25s ease;
}

.contact-form-card h4 {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 2px 0;
  color: var(--text-primary);
}

.contact-form-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-form-card .form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.contact-form-card .form-group input {
  height: 34px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.contact-form-card .form-group input:focus {
  border-color: var(--accent);
}

.contact-form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-sm {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

/* ==========================================================================
   Phase 3.1 Client Additions (FullScreen Call, Grouped SMS Chat)
   ========================================================================== */

/* Full-screen Incoming Call Overlay */
.incoming-card-fullscreen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
  z-index: 3000;
  animation: fade-in 0.3s ease;
}

.incoming-call-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  padding: 60px 24px;
}

.incoming-call-avatar-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.incoming-call-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.03) 100%);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
  z-index: 2;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.2);
  animation: vibrate-phone-large 2s infinite ease-in-out;
}

.incoming-call-avatar-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background-color: var(--accent);
  opacity: 0.2;
  z-index: 1;
  animation: avatar-pulse-glow 1.8s infinite ease-in-out;
}

@keyframes vibrate-phone-large {
  0%, 100% { transform: rotate(0) scale(1); }
  5%, 15%, 25%, 35% { transform: rotate(-5deg) scale(1.02); }
  10%, 20%, 30% { transform: rotate(5deg) scale(1.02); }
  40% { transform: rotate(0) scale(1.05); }
}

.incoming-call-details {
  text-align: center;
  margin: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incoming-call-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-hover);
  letter-spacing: 0.1em;
}

.incoming-peer-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.incoming-peer-phone {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.02em;
}

.incoming-call-actions {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 240px;
  margin-top: 40px;
}

.answer-btn-circle, .decline-btn-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.answer-btn-circle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.decline-btn-circle {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.answer-btn-circle:active, .decline-btn-circle:active {
  transform: scale(0.9);
}


/* SMS Threads View */
.sms-threads-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sms-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.sms-header-row h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.threads-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.thread-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.thread-item:active {
  transform: scale(0.995);
}

.thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.thread-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.thread-header strong {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.thread-snippet {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snippet-prefix {
  color: var(--accent-hover);
  font-weight: 500;
}

/* Chat Screen */
.sms-chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.icon-button-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.icon-button-sm:active {
  background-color: rgba(255, 255, 255, 0.08);
}

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

.chat-header-info strong {
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-info span {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fade-in-up 0.2s ease;
}

.chat-message-bubble.incoming {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-message-bubble.outgoing {
  background: linear-gradient(135deg, var(--accent) 0%, #0f766e 100%);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-message-text {
  font-size: 13px;
  line-height: 1.45;
  color: #ffffff;
  margin: 0;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-message-bubble.incoming .chat-message-text {
  color: var(--text-primary);
}

.chat-message-time {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  align-self: flex-end;
}

.chat-message-bubble.incoming .chat-message-time {
  color: var(--text-muted);
}

.chat-input-area {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  background-color: #090d16;
}

.chat-options-row {
  margin-bottom: 8px;
}

.chat-sim-select {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  outline: none;
  width: auto;
  max-width: 100%;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input-row textarea {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  resize: none;
  min-height: 38px;
  max-height: 120px;
}

.chat-input-row textarea:focus {
  border-color: var(--accent);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
}

.chat-send-btn:active {
  transform: scale(0.9);
}

/* SMS Create screen */
.sms-create-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.create-recipient-form {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-sms-text-area {
  display: flex;
  flex-direction: column;
}

.create-sms-text-area textarea {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  resize: none;
}
.create-sms-text-area textarea:focus {
  border-color: var(--accent);
}
