/* ==========================================================================
   Google SMTP Mailer - Modern Design System
   ========================================================================== */

:root {
  --bg-main: #060608;
  --bg-card: rgba(14, 14, 18, 0.88);
  --bg-card-hover: rgba(20, 20, 26, 0.94);
  --bg-input: rgba(9, 9, 12, 0.95);
  
  --border-subtle: rgba(212, 175, 55, 0.14);
  --border-focus: #d4af37;
  --border-hover: rgba(212, 175, 55, 0.35);

  --primary: #d4af37;
  --primary-hover: #e5c158;
  --primary-gradient: linear-gradient(135deg, #f6e082 0%, #d4af37 40%, #b8860b 80%, #996515 100%);
  --primary-glow: rgba(212, 175, 55, 0.35);

  --accent-cyan: #e5c158;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  --accent-amber: #d4af37;

  --text-main: #fcfcfc;
  --text-muted: #a8a8b3;
  --text-dim: #71717a;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(212, 175, 55, 0.08);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Ambient glow background effects (Gold & Deep Amber) */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  animation: floatSlow 20s infinite alternate ease-in-out;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
  top: -120px;
  left: -100px;
}

.glow-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(184, 134, 11, 0.15) 0%, transparent 70%);
  bottom: 40px;
  right: -80px;
  animation-delay: -5s;
}

.glow-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(246, 224, 130, 0.1) 0%, transparent 70%);
  top: 40%;
  left: 35%;
  opacity: 0.2;
  animation-delay: -10s;
}

@keyframes floatSlow {
  0% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(30px) scale(1.08); }
  100% { transform: translateY(-20px) scale(0.95); }
}

/* Container */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  position: sticky;
  top: 16px;
  z-index: 100;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #08080a;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.badge-tech {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

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

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
}

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

.status-untested {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.2);
}
.status-untested .status-dot { background: var(--text-dim); }

.status-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.status-success .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-error {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}
.status-error .status-dot {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}

.status-loading {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}
.status-loading .status-dot {
  background: #6366f1;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.3); }
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  border-radius: var(--radius-md);
}

.banner-icon {
  font-size: 1.5rem;
}

.banner-content {
  flex: 1;
}

.banner-content strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
}

.banner-content p {
  font-size: 0.85rem;
  color: #fcd34d;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.composer-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.card-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-title h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-title svg {
  color: var(--primary);
}

.composer-tools {
  display: flex;
  gap: 8px;
}

.btn-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-hover);
}

/* Form Styling */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required {
  color: var(--accent-rose);
}

.label-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 44px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  background: rgba(14, 20, 36, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.textarea-control {
  padding: 14px;
  resize: vertical;
  min-height: 180px;
  line-height: 1.6;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-dim);
  padding: 2px 4px 0;
}

.shortcut-tip strong {
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 34px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-control input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #08080a;
  font-weight: 700;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.55);
  filter: brightness(1.06);
}

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

.btn-submit {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
  margin-top: 6px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:hover {
  color: var(--text-muted);
}

.w-full {
  width: 100%;
}

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

.info-card, .history-card {
  padding: 24px;
}

.config-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.meta-label {
  color: var(--text-dim);
}

.meta-value {
  color: #e2e8f0;
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.smtp-action-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-feedback-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
}

.test-feedback-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.test-feedback-box.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 12px;
  color: var(--text-dim);
  text-align: center;
  gap: 8px;
  font-size: 0.85rem;
}

.history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-emerald);
  transition: var(--transition);
}

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

.history-item.failed {
  border-left-color: var(--accent-rose);
}

.history-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

.history-subject {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-window {
  width: 100%;
  max-width: 520px;
  background: #0f172a;
  border: 1px solid var(--border-hover);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

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

.btn-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

.modal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 14px 0 20px;
}

.modal-desc code {
  color: #818cf8;
  font-family: var(--font-mono);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-help {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #1e293b;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.88rem;
  max-width: 400px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: var(--transition);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}
.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}
.toast.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-icon {
  font-size: 1.1rem;
}

.toast-msg {
  flex: 1;
}

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

.spin-icon.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Template System
   ========================================================================== */

/* Template Selector Dropdown */
.template-selector-wrapper {
  position: relative;
}

.template-selector-wrapper select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.template-selector-wrapper select.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Template Fields Area */
.template-fields-area {
  animation: fadeSlideIn 0.3s ease-out;
}

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

.template-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.template-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.template-info-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-chip-primary {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 88, 12, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-chip-primary:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(234, 88, 12, 0.28) 100%);
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  color: #fef3c7;
}

.btn-chip-accent {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-chip-accent:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* Template Fields Grid */
.template-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .template-fields-grid {
    grid-template-columns: 1fr;
  }
}

.template-field-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-field-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.template-field-item .form-control {
  font-size: 0.875rem;
  padding: 10px 12px;
}

/* Preview Modal */
.modal-preview {
  max-width: 780px;
  width: 95vw;
}

.modal-preview-body {
  padding: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.preview-iframe {
  width: 100%;
  height: 65vh;
  min-height: 400px;
  border: none;
  background: #ffffff;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* History Template Badge */
.history-tpl-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
  margin-right: 4px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==============================================================
   TOKEN AUTHENTICATION & LOGIN OVERLAY
   ============================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.login-overlay.hidden {
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  background: rgba(18, 24, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.15);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .brand-icon.lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 16px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
}

.btn-toggle-eye:hover {
  opacity: 1;
}

.login-error-msg {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 18px;
  animation: shake 0.3s ease;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ==============================================================
   USER BADGE & NAVBAR CONTROLS
   ============================================================== */

.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

.user-role-tag {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-role-tag.admin {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  color: #fde047;
  border-color: rgba(245, 158, 11, 0.4);
}

.user-quota-tag {
  font-weight: 600;
  color: #34d399;
}

.user-days-tag {
  color: #93c5fd;
  font-size: 0.78rem;
}

.btn-logout:hover {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ==============================================================
   ADMIN TOKEN MANAGEMENT MODAL
   ============================================================== */

.modal-wide {
  max-width: 880px;
  width: 95vw;
}

.token-manager-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.token-creator-box {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.creator-title {
  margin-bottom: 12px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.creator-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.creator-form-row input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.quota-input-wrapper, .days-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
}

.quota-input-wrapper input, .days-input-wrapper input {
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
}

.token-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 14, 23, 0.4);
}

.token-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.token-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.token-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.token-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.token-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.token-role-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.token-role-badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.token-role-badge.user {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.token-quota-badge {
  font-weight: 600;
  color: #34d399;
}

.token-quota-badge.exhausted {
  color: #f87171;
}

.token-status-active {
  color: #34d399;
}

.token-status-expired {
  color: #f87171;
}

.token-actions-cell {
  display: flex;
  gap: 6px;
}

.btn-tbl {
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tbl:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-tbl-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.btn-tbl-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-tbl-primary {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.btn-tbl-primary:hover {
  background: rgba(99, 102, 241, 0.25);
}

.btn-tbl-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-tbl-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ── File Attachment Dropzone & List ──────────────────────────────────── */
.attachment-section {
  margin-top: 6px;
}

.attachment-dropzone {
  position: relative;
  border: 1.5px dashed rgba(212, 175, 55, 0.4);
  background: rgba(18, 18, 22, 0.45);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.attachment-dropzone:hover,
.attachment-dropzone.dragover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-content {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.25);
  flex-shrink: 0;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dropzone-prompt {
  font-size: 0.88rem;
  color: var(--text-main);
}

.dropzone-prompt strong {
  color: var(--gold-light);
}

.dropzone-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(20, 20, 26, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.attachment-file-icon {
  color: var(--gold);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.attachment-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.attachment-size {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-remove-attachment {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-attachment:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* Şablon İçi Gönderim Butonları */
.template-footer-action {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
}

.btn-template-send {
  background: linear-gradient(135deg, var(--gold) 0%, #b89758 100%) !important;
  color: #121008 !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(200, 169, 110, 0.25);
  transition: all 0.2s ease;
}

.btn-template-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(200, 169, 110, 0.35);
}

.modal-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(14, 14, 18, 0.85);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

