/* ============================================
   4minuten Seitenbaukasten - Main Styles
   ============================================ */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  color: #475569;
}
.logo strong { color: #1e293b; font-weight: 700; }

/* Dashboard */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}
.section-header {
  margin-bottom: 32px;
}
.section-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}
.section-header p {
  color: #64748b;
  font-size: 1.05rem;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}
.template-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
}
.template-card:hover {
  border-color: #2563eb;
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}
.template-preview {
  height: 200px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.template-preview-inner {
  width: 100%;
  height: 100%;
  transform: scale(0.35);
  transform-origin: top center;
  pointer-events: none;
  overflow: hidden;
}
.template-info {
  padding: 20px;
}
.template-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.template-info p {
  font-size: 0.9rem;
  color: #64748b;
}

/* Projects Grid */
.projects-section {
  margin-top: 20px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.project-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}
.project-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.project-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}
.project-date {
  font-size: 0.85rem;
  color: #94a3b8;
}
.project-card-actions {
  display: flex;
  gap: 8px;
}
.empty-state {
  color: #94a3b8;
  text-align: center;
  padding: 40px;
  grid-column: 1/-1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}
.btn-danger:hover { background: #fecaca; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}
.modal h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal-template-name {
  color: #2563eb;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
