/* ============================================================
   Admin-Stylesheet – Ferienwohnung bei Onkel Willi
   ============================================================ */
:root {
  --admin-sidebar: #1E3A1E;
  --admin-accent:  #C9A84C;
  --admin-bg:      #F4F6F8;
  --admin-white:   #FFFFFF;
  --admin-border:  #E2E8F0;
  --admin-text:    #2D3748;
  --admin-muted:   #718096;
  --admin-green:   #2D5016;
  --admin-red:     #C62828;
  --admin-blue:    #1565C0;
  --admin-shadow:  0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Open Sans', sans-serif; background: var(--admin-bg); color: var(--admin-text); font-size: 14px; line-height: 1.6; }
a { color: var(--admin-green); text-decoration: none; }
a:hover { color: var(--admin-accent); }
img { max-width: 100%; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--admin-sidebar);
  color: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.sidebar-logo img { height: 80px; filter: brightness(0) invert(1) opacity(.9); }
.sidebar-logo p { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-nav a, .sidebar-section { display: block; padding: 10px 20px; color: rgba(255,255,255,.75); font-size: .88rem; transition: .2s; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; border-left-color: var(--admin-accent); }
.sidebar-nav a.active { background: rgba(201,168,76,.15); color: var(--admin-accent); border-left-color: var(--admin-accent); }
.sidebar-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.35); padding-top: 20px; padding-bottom: 6px; }
.sidebar-nav a .nav-icon { margin-right: 8px; font-size: 1rem; }
.sidebar-bottom { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-bottom a { font-size: .83rem; color: rgba(255,255,255,.5); }

/* Main content */
.admin-main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: var(--admin-white);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--admin-shadow);
}
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--admin-text); }
.topbar-user { font-size: .85rem; color: var(--admin-muted); }
.admin-content { padding: 32px; flex: 1; }
.admin-content h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--admin-text); margin-bottom: 8px; }
.admin-content .page-subtitle { color: var(--admin-muted); margin-bottom: 32px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--admin-white);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--admin-shadow);
  border-left: 4px solid var(--admin-green);
}
.stat-card.orange { border-left-color: #E67E22; }
.stat-card.blue   { border-left-color: var(--admin-blue); }
.stat-card.red    { border-left-color: var(--admin-red); }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--admin-text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .82rem; color: var(--admin-muted); }

/* Cards */
.admin-card {
  background: var(--admin-white);
  border-radius: 10px;
  box-shadow: var(--admin-shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h2 { font-size: 1rem; font-weight: 700; color: var(--admin-text); }
.admin-card-body { padding: 24px; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; padding: 10px 14px; background: var(--admin-bg); color: var(--admin-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; border-bottom: 2px solid var(--admin-border); }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--admin-border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #F8FAFC; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge-anfrage   { background: #FFF3E0; color: #E65100; }
.badge-bestaetigt{ background: #E8F5E9; color: #2E7D32; }
.badge-storniert { background: #FFEBEE; color: #C62828; }
.badge-abgeschlossen { background: #E3F2FD; color: #1565C0; }

/* Buttons */
.btn-admin { display: inline-block; padding: 8px 18px; border-radius: 6px; font-size: .83rem; font-weight: 600; cursor: pointer; border: none; transition: .2s; }
.btn-primary { background: var(--admin-green); color: #fff; }
.btn-primary:hover { background: #1E3A1E; color: #fff; }
.btn-danger  { background: var(--admin-red); color: #fff; }
.btn-danger:hover { background: #B71C1C; color: #fff; }
.btn-secondary { background: var(--admin-border); color: var(--admin-text); }
.btn-secondary:hover { background: #CBD5E0; }
.btn-gold    { background: var(--admin-accent); color: #1E3A1E; }
.btn-gold:hover { background: #A08030; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .78rem; }

/* Forms */
.admin-form .form-group { margin-bottom: 20px; }
.admin-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--admin-text); margin-bottom: 6px; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="date"],
.admin-form input[type="number"],
.admin-form input[type="password"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--admin-border);
  border-radius: 8px;
  font-family: 'Open Sans', sans-serif;
  font-size: .88rem;
  color: var(--admin-text);
  background: var(--admin-white);
  transition: .2s;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus { outline: none; border-color: var(--admin-green); }
.admin-form textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: .78rem; color: var(--admin-muted); margin-top: 4px; }

/* Alerts */
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; font-size: .88rem; }
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #4CAF50; }
.alert-error   { background: #FFEBEE; color: #C62828; border-left: 4px solid #F44336; }
.alert-info    { background: #E3F2FD; color: #1565C0; border-left: 4px solid #2196F3; }

/* Image upload area */
.upload-zone {
  border: 2px dashed var(--admin-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--admin-bg);
}
.upload-zone:hover { border-color: var(--admin-green); background: #F0F4F0; }
.upload-zone input { display: none; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 20px; }
.image-item { border-radius: 8px; overflow: hidden; position: relative; border: 2px solid var(--admin-border); }
.image-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.image-actions { padding: 8px; display: flex; gap: 4px; justify-content: center; background: #fff; }

/* Calendar admin */
.cal-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cal-blocked-admin { background: #FFEBEE !important; color: #C62828 !important; cursor: pointer !important; }
.cal-available-admin { cursor: pointer !important; }
.cal-available-admin:hover { background: #FFF3E0 !important; }

/* Block editor */
.block-item { border:1px solid var(--admin-border); border-radius:8px; padding:20px; margin-bottom:14px; background:var(--admin-white); }
.block-item-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid var(--admin-border); }
.block-item-label { font-weight:700; color:var(--admin-green); font-size:.9rem; }
.btn-delete-block { background:none; border:1px solid var(--admin-red); cursor:pointer; color:var(--admin-red); font-size:.78rem; padding:4px 10px; border-radius:5px; font-weight:600; transition:.2s; }
.btn-delete-block:hover { background:var(--admin-red); color:#fff; }
.btn-add-block { display:inline-flex; align-items:center; gap:6px; margin-top:12px; }

/* Emoji field */
.emoji-field-wrap { display:flex; align-items:center; gap:6px; }
.emoji-field-wrap input[type="text"] { width:80px; }
.emoji-btn { font-size:1.3rem; cursor:pointer; padding:5px 9px; border:2px solid var(--admin-border); border-radius:6px; background:var(--admin-white); transition:.15s; line-height:1; user-select:none; }
.emoji-btn:hover { border-color:var(--admin-green); background:#f0f4f0; }
#emoji-picker-wrap { position:fixed; z-index:9999; display:none; box-shadow:0 8px 32px rgba(0,0,0,.18); border-radius:12px; overflow:hidden; }
#emoji-picker-wrap.open { display:block; }

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cal-admin-grid { grid-template-columns: 1fr; }
}
