/* ==========================================================================
   ctrl.edelweiss.codes — Admin
   ========================================================================== */

:root {
    --bg: #0b0f14;
    --bg-2: #10161e;
    --bg-3: #161e28;
    --line: #1f2a38;
    --text: #e8edf3;
    --muted: #8b98a9;
    --accent: #9ecbff;
    --flower: #e8c95f;
    --green: #4ade80;
    --red: #f87171;
    --r-md: 12px;
    --r-pill: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }

/* ---------- Layout ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 800; font-size: 18px; color: #fff; display: flex; align-items: center; gap: 9px; }
.topbar .brand img { width: 24px; height: 24px; }
.topbar .brand .dot { color: var(--flower); }
.topbar .brand .codes { color: var(--accent); }
.topbar nav { display: flex; gap: 20px; align-items: center; }
.topbar nav a { font-size: 14px; font-weight: 600; color: var(--muted); }
.topbar nav a:hover, .topbar nav a.active { color: #fff; }
.topbar form { display: inline; }
.topbar button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.topbar button:hover { color: var(--red); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 28px; }

/* ---------- Cards / Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 32px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.stat b { display: block; font-size: 28px; color: #fff; }
.stat span { font-size: 12.5px; color: var(--muted); text-transform: lowercase; letter-spacing: .06em; }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 17px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { margin-bottom: 0; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: lowercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(158, 203, 255, .03); }
tr[data-href] { cursor: pointer; }

/* ---------- Status-Pills ---------- */

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: var(--r-pill); background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }
.pill.new { color: var(--accent); border-color: rgba(158, 203, 255, .4); }
.pill.in_progress, .pill.assigned, .pill.queued { color: var(--flower); border-color: rgba(232, 201, 95, .4); }
.pill.in_review { color: #c4b5fd; border-color: rgba(196, 181, 253, .4); }
.pill.internal_review { color: #7dd3fc; border-color: rgba(125, 211, 252, .4); }
.pill.testserver { color: #fb923c; border-color: rgba(251, 146, 60, .4); }
.pill.approved, .pill.sent { color: var(--green); border-color: rgba(74, 222, 128, .4); }
.pill.deployed, .pill.billed, .pill.paid { color: var(--green); }
.pill.cancelled { color: var(--red); border-color: rgba(248, 113, 113, .4); }
.pill.draft { color: var(--muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-row .pill.end { margin-left: auto; }
.filter-search { display: none; }
.tag-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-input { flex: 1; min-width: 140px; background: none; border: 0; color: var(--text); padding: 6px 0; font: inherit; outline: none; }
.tag-options { list-style: none; margin-top: 8px; max-height: 220px; overflow: auto; }
.tag-options li { padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.tag-options li:hover { background: var(--bg-3); }
.tag-x { background: none; border: 0; color: inherit; cursor: pointer; padding-left: 4px; font: inherit; opacity: .7; }
.tag-x:hover { opacity: 1; }
.tag-clear { display: inline-block; margin-top: 10px; font-size: 13px; }
.pill.active { background: var(--bg-3); color: #fff; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: lowercase; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 14px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(158, 203, 255, .12); }
.field textarea { min-height: 110px; resize: vertical; }

/* luft vor submit-buttons am form-ende */
form > .btn, form > .row-actions, form > .pill-row { margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-name { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 16px; }
.grid-addr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.grid-addr .span4 { grid-column: span 4; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: var(--r-pill); background: var(--accent); color: var(--bg); font-weight: 700; font-size: 14px; border: 0; cursor: pointer; transition: filter .2s, border-color .2s, color .2s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { filter: brightness(.95); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.sm { padding: 6px 16px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid rgba(248, 113, 113, .4); }

.switch { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: 20px; user-select: none; text-transform: lowercase; }
/* schalter in einem field auf input-hoehe zentrieren
   (.field label{block} wuerde sonst das flex-layout killen) */
.field .switch { display: inline-flex; min-height: 42px; margin-bottom: 0; }
.switch input { display: none; }
.switch .track { display: inline-flex; align-items: center; box-sizing: border-box; flex-shrink: 0; width: 46px; height: 26px; padding: 0 2px; border-radius: var(--r-pill); background: var(--bg-3); border: 1.5px solid var(--line); transition: all .2s ease; }
.switch .track::after { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch:hover .track { border-color: var(--muted); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:has(input:checked) { color: var(--text); }
.switch:has(input:checked) .track { background: var(--accent); border-color: var(--accent); }
.switch:has(input:checked) .track::after { transform: translateX(21px); background: #fff; }

/* ---------- Misc ---------- */

.flash { background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .35); color: var(--green); padding: 12px 18px; border-radius: var(--r-md); margin-bottom: 24px; font-size: 14px; }
.error-list { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: var(--red); padding: 12px 18px; border-radius: var(--r-md); margin-bottom: 24px; font-size: 14px; }
.head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.head-row h1 { font-size: 24px; }
.muted { color: var(--muted); font-size: 13px; }
.mt { margin-top: 10px; }
.mono { font-family: ui-monospace, monospace; font-size: 13px; }

/* ---------- Customer vcard ---------- */

.vcard { display: flex; gap: 28px; padding: 28px; }
.vcard-mark { width: 96px; height: 96px; flex-shrink: 0; border-radius: 18px; background: radial-gradient(circle at 50% 30%, rgba(158, 203, 255, .15), transparent 70%), var(--bg-3); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.vcard-mark img { width: 62px; height: 62px; }
.vcard-body { flex: 1; min-width: 0; }
.vcard-name { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vcard-rows { margin-top: 16px; display: grid; gap: 9px; font-size: 14px; }
.vcard-rows > div { display: flex; gap: 12px; align-items: baseline; }
.vcard-rows span { min-width: 70px; flex-shrink: 0; font-size: 11.5px; font-weight: 700; text-transform: lowercase; letter-spacing: .07em; color: var(--muted); }
.vcard-rows address { font-style: normal; }

.events { list-style: none; }
.events li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; }
.events li:last-child { border: 0; }
.events .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 130px; }
.events .actor { font-size: 11px; font-weight: 700; text-transform: lowercase; letter-spacing: .06em; color: var(--accent); }

.login-body { background: radial-gradient(1100px 480px at 50% -8%, rgba(158, 203, 255, .12), transparent 60%), var(--bg); -webkit-font-smoothing: antialiased; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 700px; }
.login-split { display: flex; align-items: center; gap: 36px; }
.login-flower { flex: 1; min-width: 0; align-self: stretch; object-fit: contain; }
.login-form { flex: 1.2; min-width: 0; }
.login-form .btn { width: 100%; justify-content: center; }

@media (max-width: 700px) {
    .grid2, .grid-name { grid-template-columns: 1fr; }
    .grid-addr { grid-template-columns: repeat(4, 1fr); }
    .grid-addr .span4 { grid-column: span 3; }
    .login-split { flex-direction: column; }
    .login-flower { align-self: center; height: 110px; }
    .vcard { flex-direction: column; }
    .topbar nav { gap: 12px; }
    .filters-pills { display: none; }
    .filter-search { display: block; }
}

/* ---------- Customer type slide ---------- */
.category-field { max-width: 320px; margin-bottom: 20px; }

.dns-table input, .dns-table select { width: 100%; padding: 6px 10px; font-size: 13px; }
.dns-table input[name$="[name]"] { width: 110px; }
.dns-table input[name$="[ttl]"] { width: 80px; }
.dns-tips { margin: 12px 0 20px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.customer-icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 8px; }
.vcard-mark img { width: 90px; height: 90px; }

.type-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-pill); overflow: hidden; margin-bottom: 20px; }
.type-toggle label { padding: 9px 22px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .25s; text-transform: lowercase; }
.type-toggle label.active { background: var(--accent); color: var(--bg); }
.type-toggle input { display: none; }

.slide-viewport { overflow: hidden; }
.slide-track { display: flex; width: 200%; transition: transform .35s ease; }
.slide-track.show-private { transform: translateX(-50%); }
.slide-panel { width: 50%; flex-shrink: 0; }

.row-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }

.clone-cell { white-space: nowrap; }
.clone-cmd { display: inline-block; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-size: 12.5px; }
.copy-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; vertical-align: middle; }
.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--green); }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(4, 8, 12, .7); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.4rem 1.6rem; width: min(680px, 100%); max-height: 90vh; overflow-y: auto; }
