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

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --danger: #d93025;
  --danger-dark: #a50e0e;
  --success: #188038;
  --success-bg: #e6f4ea;
  --warning: #f9ab00;
  --warning-bg: #fef7e0;
  --gray: #5f6368;
  --gray-light: #f1f3f4;
  --gray-border: #dadce0;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: #202124;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.animate-in { animation: fadeInUp 0.3s ease both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* LOGIN */
.login-body {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  min-height: 100vh;
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 40px 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
  width: 64px; height: 64px; background: var(--primary);
  color: white; border-radius: 16px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; margin-bottom: 12px;
}
.login-logo h1 { font-size: 1.4rem; color: #202124; }
.login-logo p { color: var(--gray); font-size: 0.9rem; margin-top: 4px; }

/* HEADER */
header {
  background: var(--card-bg); border-bottom: 1px solid var(--gray-border);
  padding: 0 20px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-content {
  max-width: 1200px; margin: 0 auto; height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.brand { font-size: 1.1rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.header-sub { font-size: 0.8rem; color: var(--gray); }
header nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav-link {
  color: var(--gray); font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm); white-space: nowrap;
  transition: var(--transition);
}
.nav-link:hover { background: var(--gray-light); color: #202124; text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.btn-nav { background: var(--primary); color: white !important; }
.btn-nav:hover { background: var(--primary-dark) !important; }
.logout { opacity: 0.6; }
.logout:hover { opacity: 1; }
.nav-user { font-size: 0.75rem; opacity: 0.7; }

/* MAIN */
main { max-width: 1200px; margin: 0 auto; padding: 24px 20px; width: 100%; flex: 1; }

/* PAGE HEADER */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.page-header h2 { font-size: 1.3rem; font-weight: 600; }

/* PROXY STATUS BAR */
.proxy-bar {
  display: flex; align-items: center; gap: 8px;
  background: #1a1a2e; color: #a8ffc8; padding: 10px 16px;
  border-radius: var(--radius); margin-bottom: 16px;
  font-size: 0.85rem;
}
.proxy-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00ff88; display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
.proxy-bar code { background: rgba(255,255,255,0.1); color: #fff; padding: 2px 8px; border-radius: 4px; }

/* STATS */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--gray-border);
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: var(--transition); border-left: 4px solid var(--gray);
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card.stat-aktiv { border-left-color: var(--success); }
.stat-card.stat-wartung { border-left-color: var(--warning); }
.stat-card.stat-nicht_bezahlt { border-left-color: var(--danger); }
.stat-card.stat-abgelaufen { border-left-color: #5f6368; }
.stat-card.stat-in_bearbeitung { border-left-color: var(--primary); }
.stat-card.stat-sonstiges { border-left-color: var(--gray); }
.stat-icon { font-size: 1.5rem; width: 40px; text-align: center; }
.stat-count { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--gray); font-weight: 500; }

/* TOOLBAR */
.toolbar { margin-bottom: 16px; }
.search-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: var(--card-bg); padding: 12px; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
  align-items: center;
}
.search-input {
  flex: 1; min-width: 180px; padding: 9px 14px; border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); font-size: 0.9rem; background: var(--bg);
  transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(26,115,232,0.12); }
.status-filter {
  padding: 9px 14px; border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); font-size: 0.9rem;
  background: var(--bg); min-width: 150px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(26,115,232,0.3); }
.btn-secondary { background: var(--gray-light); color: var(--gray); border: 1px solid var(--gray-border); }
.btn-secondary:hover { background: #e2e4e7; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* FORMS */
.form-section {
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-light);
}
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h3 {
  font-size: 1rem; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.form-help { font-size: 0.82rem; color: var(--gray); margin-bottom: 12px; }
.form-hint { display: block; font-size: 0.78rem; color: var(--gray); margin-top: 4px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.85rem; color: #3c4043; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
  background: var(--bg); transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); background: white;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.code-input {
  font-family: 'Courier New', Consolas, monospace !important;
  font-size: 0.85rem !important; line-height: 1.5 !important;
  tab-size: 2;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.domain-form { background: var(--card-bg); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-border); }

/* DNS BOX */
.dns-box {
  margin-top: 16px; background: #1a1a2e; color: #e0e0e0;
  padding: 20px 24px; border-radius: var(--radius);
}
.dns-box h3 { color: white; font-size: 1rem; margin-bottom: 8px; }
.dns-box p { font-size: 0.85rem; color: #aaa; }
.dns-code {
  background: #0d0d1a; padding: 12px 16px; border-radius: var(--radius-sm);
  margin: 10px 0; font-family: 'Courier New', monospace;
  border: 1px solid #333; overflow-x: auto;
}
.dns-code code { color: #00ff88; font-size: 0.9rem; }

/* ALERT */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #fce8e6; color: var(--danger); border: 1px solid #f5c6c2; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #ceead6; }

/* BADGES */
.badge {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; align-items: center;
}
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-pro {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; font-size: 0.65rem; letter-spacing: 0.5px;
}
.proxy-badge {
  background: #1a1a2e; color: #00ff88; font-size: 0.7rem;
  padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.code-badge {
  background: #2d2d2d; color: #ffc857; font-size: 0.7rem;
  padding: 2px 8px; border-radius: 4px; font-weight: 700;
}

/* DOMAIN COUNT */
.domain-count {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.85rem; color: var(--gray); margin-bottom: 12px;
}
.active-filter {
  background: var(--primary-light); color: var(--primary);
  padding: 3px 10px; border-radius: 20px; font-size: 0.8rem;
}

/* DOMAIN CARDS */
.domain-list { display: grid; gap: 12px; }
.domain-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
  border-left: 4px solid var(--gray); transition: var(--transition);
}
.domain-card:hover { box-shadow: var(--shadow-hover); }
.domain-card.status-aktiv { border-left-color: var(--success); }
.domain-card.status-wartung { border-left-color: var(--warning); }
.domain-card.status-nicht_bezahlt { border-left-color: var(--danger); }
.domain-card.status-abgelaufen { border-left-color: #5f6368; }
.domain-card.status-in_bearbeitung { border-left-color: var(--primary); }
.domain-card.status-sonstiges { border-left-color: var(--gray); }

.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 6px; flex-wrap: wrap; gap: 8px;
}
.card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title a { font-size: 1rem; font-weight: 600; color: #202124; }
.card-title a:hover { color: var(--primary); }
.card-kunde { font-size: 0.8rem; color: var(--gray); font-weight: 400; }
.ziel-url { color: var(--primary); font-size: 0.8rem; word-break: break-all; }

.status-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 0.75rem;
  font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: var(--transition); user-select: none;
}
.status-badge:hover { opacity: 0.8; }
.status-badge.status-aktiv { background: var(--success-bg); color: var(--success); }
.status-badge.status-wartung { background: var(--warning-bg); color: #e37400; }
.status-badge.status-nicht_bezahlt { background: #fce8e6; color: var(--danger); }
.status-badge.status-abgelaufen { background: #f1f3f4; color: var(--gray); }
.status-badge.status-in_bearbeitung { background: var(--primary-light); color: var(--primary); }
.status-badge.status-sonstiges { background: #f1f3f4; color: var(--gray); }

.card-body { padding: 8px 16px 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px; }
.card-row { font-size: 0.85rem; color: #3c4043; }
.label { font-weight: 600; color: var(--gray); font-size: 0.8rem; display: block; margin-bottom: 1px; }
.expired { color: var(--danger); font-weight: 600; }
.card-notizen { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-light); }
.card-notizen p { font-size: 0.85rem; color: #3c4043; margin-top: 2px; font-style: italic; }

.card-actions {
  padding: 8px 16px; background: var(--gray-light);
  border-top: 1px solid var(--gray-border);
  display: flex; gap: 6px;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: #202124; margin-bottom: 6px; }

/* ACTIVITY */
.activity-list { display: grid; gap: 2px; background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--gray-border); overflow: hidden; }
.activity-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--gray-light); align-items: flex-start;
  transition: var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--gray-light); }
.activity-icon { font-size: 1.1rem; width: 28px; text-align: center; padding-top: 2px; }
.activity-content { flex: 1; }
.activity-action { font-size: 0.85rem; line-height: 1.4; }
.activity-action em { color: var(--gray); font-size: 0.8rem; display: block; }
.activity-time { font-size: 0.75rem; color: var(--gray); margin-top: 2px; }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-card {
  background: var(--card-bg); padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
}
.settings-card h3 { font-size: 1rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.info-list { display: grid; gap: 8px; }
.info-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 4px 0; }
.info-actions { margin-top: 16px; display: flex; gap: 8px; }

/* AGENT HERO */
.agent-hero {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a3e 100%);
  border-radius: var(--radius); padding: 32px; color: #e0e0e0;
  border: 1px solid #333; margin-bottom: 8px;
}
.agent-badge {
  display: inline-block; background: linear-gradient(135deg, #f9ab00, #ff6d00);
  color: #1a1a2e; font-size: 0.7rem; font-weight: 800; padding: 4px 14px;
  border-radius: 20px; letter-spacing: 1px; margin-bottom: 12px;
}
.agent-hero h2 { font-size: 1.5rem; color: white; margin-bottom: 8px; }
.agent-desc { font-size: 0.9rem; color: #aaa; line-height: 1.6; margin-bottom: 20px; }
.agent-desc strong { color: #fff; }
.agent-setup { display: grid; gap: 8px; margin-bottom: 20px; }
.agent-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.85rem; color: #ccc;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: white; display: flex;
  align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.agent-step code { background: rgba(255,255,255,0.1); color: #00ff88; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }

.agent-preview { margin-bottom: 20px; }
.preview-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.preview-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 0.8rem;
  background: rgba(255,255,255,0.08); color: #aaa; cursor: pointer;
  transition: var(--transition); font-weight: 500;
}
.preview-tab:hover { background: rgba(255,255,255,0.15); color: #fff; }
.preview-tab.active { background: var(--primary); color: white; }
.preview-content { }
.preview-card {
  background: white; color: #202124; border-radius: var(--radius);
  padding: 32px; text-align: center; border-top: 4px solid var(--primary);
  max-width: 400px; margin: 0 auto;
}
.preview-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.preview-card p { margin-top: 8px; }
.preview-msg { text-align: center; padding: 20px; color: #00ff88; font-size: 0.95rem; }

.agent-code-box {
  background: #0d0d1a; border-radius: var(--radius-sm);
  border: 1px solid #333; overflow: hidden;
}
.agent-code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: rgba(255,255,255,0.05);
  border-bottom: 1px solid #333;
}
.agent-code-header span { font-size: 0.85rem; color: #ccc; }
.universal-code { border-radius: 0; max-height: none; font-size: 0.78rem; }
.agent-note { padding: 12px 16px; font-size: 0.82rem; color: #888; border-top: 1px solid #222; }

/* CODE LIBRARY */
.code-library { display: grid; gap: 16px; }
.code-snippet-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
  padding: 20px 24px; transition: var(--transition);
}
.code-snippet-card:hover { box-shadow: var(--shadow-hover); }
.snippet-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px; gap: 12px;
}
.snippet-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.snippet-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 2px 10px; border-radius: 20px; margin-top: 4px;
}
.tag-Stealth { background: #1a1a2e; color: #00ff88; }
.tag-Banner { background: #fef7e0; color: #e37400; }
.tag-Aktion { background: #e8f0fe; color: #1a73e8; }
.tag-Tracking { background: #e6f4ea; color: #188038; }
.tag-Recht { background: #fce8e6; color: #d93025; }
.snippet-desc { font-size: 0.85rem; color: #3c4043; margin-bottom: 12px; }
.snippet-code {
  background: #1a1a2e; color: #e0e0e0; padding: 16px; border-radius: var(--radius-sm);
  font-family: 'Courier New', Consolas, monospace; font-size: 0.8rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  line-height: 1.5; max-height: 300px; overflow-y: auto;
}
.snippet-footer { margin-top: 10px; }
.snippet-note { font-size: 0.8rem; color: var(--gray); font-style: italic; }

/* FOOTER */
footer {
  text-align: center; padding: 20px; color: var(--gray);
  font-size: 0.78rem; margin-top: auto;
  border-top: 1px solid var(--gray-border);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-content { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .header-left { width: 100%; justify-content: center; }
  header nav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .nav-link { font-size: 0.8rem; padding: 5px 10px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .search-row { flex-direction: column; }
  .search-input, .status-filter { width: 100%; min-width: auto; }
  .form-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  main { padding: 16px 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-count { font-size: 1.3rem; }
}
