/* Stone Clean – Admin Panel */
:root {
  --brand: #ea6b1f;
  --brand-dark: #c85812;
  --brand-soft: #fff2e8;
  --ink: #1b1c1e;
  --ink-2: #42464d;
  --muted: #6b7280;
  --line: #e9eaec;
  --bg: #f5f6f8;
  --bg-2: #ffffff;
  --sidebar: #16181c;
  --sidebar-hover: #1f2228;
  --ok: #138a4b;
  --ok-soft: #e5f6ec;
  --danger: #c3342f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20,20,30,.06);
  --shadow-md: 0 6px 20px rgba(20,20,30,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, li, span, small, td, th {
  overflow-wrap: break-word; word-wrap: break-word; hyphens: auto;
}
.admin-content, .admin-brand, .panel, .stat-card, .msg-cell { min-width: 0; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3 { margin: 0 0 .5em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }

/* Login */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem;
  background:
    radial-gradient(600px 400px at 20% 0%, #fff2e8 0%, transparent 60%),
    radial-gradient(600px 400px at 100% 100%, #ffe0c7 0%, transparent 60%),
    #f5f6f8;
}
.login-card {
  background: #fff; width: 100%; max-width: 420px;
  padding: 2rem; border-radius: 16px; box-shadow: 0 30px 80px rgba(20,20,30,.15);
}
.login-brand { display: flex; gap: .7rem; align-items: center; margin-bottom: 1.5rem; }
.login-brand .brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #f5892c); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 6px 16px rgba(234,107,31,.4);
  flex-shrink: 0;
}
.login-brand .brand-mark img { width: 70%; height: 70%; object-fit: contain; display: block; }
.login-brand strong { display: block; font-size: 1.05rem; }
.login-brand small { color: var(--muted); font-size: .8rem; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 1.2rem; }
.login-card form { display: flex; flex-direction: column; gap: .9rem; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.login-card input {
  font: inherit; padding: .7em .85em;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
}
.login-card input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234,107,31,.15); }
.login-hint { color: var(--muted); font-size: .85rem; margin-top: .8rem; text-align: center; }
.login-hint code { background: var(--brand-soft); color: var(--brand-dark); padding: .15em .45em; border-radius: 4px; }
.login-back { display: block; text-align: center; margin-top: 1rem; color: var(--muted); font-size: .85rem; }

/* Shell */
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--sidebar); color: rgba(255,255,255,.8);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.admin-brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.3rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.admin-brand .brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #f5892c); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  flex-shrink: 0;
}
.admin-brand .brand-mark img { width: 70%; height: 70%; object-fit: contain; display: block; }
.admin-brand strong { display: block; font-size: .98rem; }
.admin-brand small { color: rgba(255,255,255,.55); font-size: .78rem; }
.admin-nav { display: flex; flex-direction: column; padding: 1rem .6rem; gap: 2px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .8rem; border-radius: 8px;
  color: rgba(255,255,255,.75); font-size: .92rem; font-weight: 500;
}
.admin-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(234,107,31,.35); }
.admin-foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem;
  font-size: .85rem;
}
.admin-foot a { color: rgba(255,255,255,.6); }
.admin-foot a:hover { color: #fff; }

.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-top {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 1.2rem 2rem; display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
.admin-top h1 { margin: 0; font-size: 1.25rem; }
.admin-user { color: var(--muted); font-size: .9rem; }

.admin-content { padding: 1.8rem 2rem; }

/* Alerts */
.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 1.2rem; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: #fdeded; color: var(--danger); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: #fff; padding: 1.2rem; border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: .3rem;
}
.stat-card small { color: var(--muted); font-size: .85rem; }
.stat-card strong { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.stat-card.highlight { background: linear-gradient(135deg, var(--brand) 0%, #f5892c 100%); color: #fff; border-color: transparent; }
.stat-card.highlight small { color: rgba(255,255,255,.8); }

/* Panels */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; margin-bottom: 1.2rem;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: .75rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .actions { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.data-table-wide { min-width: 900px; }
.panel { overflow-x: auto; }

.thumb { width: 56px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--line); }
.thumb-empty { display: grid; place-items: center; color: var(--muted); }

.msg-cell { max-width: 260px; color: var(--ink-2); font-size: .88rem; }

/* Status pills */
.status { display: inline-block; padding: .2em .6em; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-neu { background: var(--brand-soft); color: var(--brand-dark); }
.status-bearbeitet { background: #e6f0ff; color: #1949c4; }
.status-abgeschlossen { background: var(--ok-soft); color: var(--ok); }

/* Toggle pill */
.toggle {
  background: #f0f1f3; color: var(--muted); border: 0;
  padding: .3em .8em; border-radius: 999px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.toggle.on { background: var(--ok-soft); color: var(--ok); }
.toggle:hover { transform: translateY(-1px); }

/* Mini list */
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; justify-content: space-between; padding: .7rem 0; color: var(--ink); }
.mini-list a:hover { color: var(--brand-dark); }

/* Toolbar row */
.toolbar-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.toolbar-row .search { display: flex; gap: .4rem; }
.toolbar-row input {
  padding: .55em .9em; border-radius: 999px; border: 1px solid var(--line);
  font: inherit; min-width: 260px; background: #fff;
}

/* Admin form */
.form-admin { display: flex; flex-direction: column; gap: 1rem; }
.form-admin label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.form-admin input[type="text"],
.form-admin input[type="number"],
.form-admin input[type="password"],
.form-admin input[type="email"],
.form-admin input[type="date"],
.form-admin select,
.form-admin textarea {
  font: inherit; padding: .65em .85em;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
.form-admin input:focus, .form-admin textarea:focus, .form-admin select:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234,107,31,.15);
}
.form-admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.checkbox-row { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: .5rem 0; }
.checkbox { display: flex !important; flex-direction: row !important; align-items: center; gap: .4rem; font-weight: 500; cursor: pointer; }
.checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

.form-admin-actions {
  display: flex; justify-content: flex-end; gap: .6rem;
  margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}

/* Upload */
.upload-box {
  background: var(--bg); border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 1.2rem; text-align: center;
}
.upload-label { font-weight: 600; color: var(--ink-2); font-size: .9rem; display: block; margin-bottom: .8rem; }
.upload-preview { margin-bottom: 1rem; }
.upload-preview img { width: 100%; max-width: 300px; margin: 0 auto 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.upload-box input[type="file"] {
  display: block; margin: 0 auto; padding: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%;
}
.upload-box small { display: block; margin-top: .6rem; color: var(--muted); font-size: .82rem; }

/* Row form (inline editing) */
.row-form { display: contents; }
.row-form input[type="text"],
.row-form input[type="number"],
.row-form select {
  padding: .4em .6em; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: #fff;
}
.inline { display: inline; }
.form-row-panel {
  display: flex; gap: 1rem; align-items: end; flex-wrap: wrap;
}
.form-row-panel label { flex: 1; min-width: 160px; }

/* Buttons (admin variant shared) */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .55em 1em; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .2s;
  background: #fff; color: var(--ink); text-decoration: none; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(234,107,31,.3); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: #fff0ef; color: var(--danger); border-color: #f6cfcd; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .4em .75em; font-size: .8rem; }
.btn-lg { padding: .75em 1.4em; font-size: .95rem; }

.muted { color: var(--muted); }

/* Mobile */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; flex-direction: row; overflow-x: auto; }
  .admin-nav { flex-direction: row; }
  .admin-foot { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-admin-grid { grid-template-columns: 1fr; }
}
