:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --console-bg: #000000;
  --console-text: #10b981;
  
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
  z-index: -1;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.sidebar {
  width: 260px;
  padding: 24px;
  margin: 16px 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.icon-wrapper {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.main-content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header p {
  color: var(--text-muted);
  font-size: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: flex-start;
}

.card {
  padding: 24px;
}

.card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

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

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

input[type="text"], textarea, select {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s ease;
}

input[type="text"], select {
  padding: 14px 14px 14px 40px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' 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 14px center;
  background-size: 16px;
  cursor: pointer;
}

select option {
  background: var(--bg-dark);
  color: var(--text-main);
}

textarea {
  padding: 14px;
  resize: vertical;
  min-height: 100px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.textarea-wrapper {
  position: relative;
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 4px;
}

.file-drop-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.file-drop-area input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.upload-content i {
  font-size: 32px;
  color: var(--primary);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  color: #93c5fd;
}

.alert-info i {
  font-size: 20px;
  margin-top: 2px;
}

.alert-info strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.alert-info p {
  font-size: 13px;
  line-height: 1.5;
}

.alert-info code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--danger);
}

.console-section {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.console-header h2 {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.console-body {
  flex: 1;
  background-color: var(--console-bg);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 16px;
  border: 1px solid #1f2937;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.console-body::-webkit-scrollbar {
  width: 8px;
}
.console-body::-webkit-scrollbar-track {
  background: var(--console-bg);
}
.console-body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.log-line {
  margin-bottom: 4px;
  word-break: break-all;
}

.log-line .time {
  color: #64748b;
  margin-right: 8px;
}

.log-line .tag {
  font-weight: 600;
  margin-right: 8px;
}

.log-line.system { color: var(--text-muted); }
.log-line.system .tag { color: var(--primary); }

.log-line.info { color: #fff; }
.log-line.info .tag { color: #3b82f6; }

.log-line.success { color: var(--success); }
.log-line.success .tag { color: var(--success); }

.log-line.error { color: var(--danger); }
.log-line.error .tag { color: var(--danger); }

.log-line.warning { color: var(--warning); }
.log-line.warning .tag { color: var(--warning); }

@media (max-width: 968px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .console-section {
    height: 400px;
  }
}

/* Connection Manager styles */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(139, 92, 246, 0.3);
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
}

.account-sip {
  font-size: 13px;
  color: var(--text-muted);
}

.account-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

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

.status-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.status-text {
  font-size: 12px;
  font-weight: 500;
}

.status-text.online {
  color: var(--success);
}

.status-text.offline {
  color: var(--text-muted);
}

.time-left-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.account-btn-group {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  width: auto;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-sm {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* Offline warnings */
.account-warning {
  margin-top: 8px;
  font-size: 12px;
  color: var(--warning);
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
}

