/* pdf.smartline.info — Admin Styles */
:root {
    --c-primary: #fbbf24;
    --c-primary-dark: #d97706;
    --c-on-primary: #1f2328;
    --c-text: #1f2328;
    --c-muted: #6b7280;
    --c-bg: #f6f5f1;
    --c-card: #ffffff;
    --c-border: #e5e3dc;
    --c-danger: #c0392b;
    --c-ok: #2c8a45;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
    --r: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: var(--c-card);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--c-text);
    font-weight: 600;
}
.brand img { display: block; }
.brand span { font-size: .95rem; color: var(--c-muted); }
.topnav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}
.topnav a {
    text-decoration: none;
    color: var(--c-text);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: .9rem;
    transition: background .12s;
}
.topnav a:hover { background: var(--c-bg); }
.topnav a.is-active { background: var(--c-primary); color: var(--c-on-primary); }
.topnav a.logout { color: var(--c-muted); margin-left: 6px; }
.topnav a.logout:hover { color: var(--c-danger); background: #fcecea; }

/* Container */
.container {
    flex: 1 0 auto;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Page-Head */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-head h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger, .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: var(--c-primary);
    color: var(--c-on-primary);
    padding: 9px 18px;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-card); border-color: #cfcdc6; }
.btn-danger {
    background: var(--c-danger);
    color: #fff;
}
.btn-danger:hover { background: #962f23; color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm {
    padding: 5px 11px;
    font-size: .82rem;
    background: var(--c-card);
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-sm:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-sm.btn-ghost { background: transparent; }

/* Forms */
.form { display: grid; gap: 16px; }
.form-wide { max-width: 720px; }
.form label {
    display: grid;
    gap: 5px;
    font-size: .88rem;
    color: var(--c-text);
    font-weight: 500;
}
.form label > span em { color: var(--c-danger); font-style: normal; }
.form label .hint {
    color: var(--c-muted);
    font-size: .75rem;
    font-weight: 400;
    cursor: help;
}
.form input[type="text"],
.form input[type="number"],
.form input[type="password"],
.form input[type="email"],
.form select,
.form textarea {
    border: 1px solid var(--c-border);
    background: var(--c-card);
    border-radius: 6px;
    padding: 9px 12px;
    font: inherit;
    color: inherit;
    transition: border-color .12s, box-shadow .12s;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: 0;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, .25);
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.form-actions .btn-danger { margin-left: auto; }

.color-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.color-row input[type="color"] {
    width: 48px;
    height: 40px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 2px;
    background: var(--c-card);
    cursor: pointer;
}
.color-row input[type="text"] {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .85rem;
}

.checks {
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: 14px 16px;
    background: var(--c-card);
}
.checks legend { padding: 0 6px; font-size: .85rem; color: var(--c-muted); font-weight: 500; }
.checks .cb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-weight: 400;
    font-size: .92rem;
    cursor: pointer;
}
.checks .cb input { margin: 0; }
.checks .cb small { color: var(--c-muted); }

/* Dropzone */
.dropzone {
    display: block;
    border: 2px dashed var(--c-border);
    border-radius: var(--r);
    background: var(--c-card);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-drag {
    border-color: var(--c-primary);
    background: #fffbea;
}
.dropzone input[type="file"] { display: none; }
.dropzone-inner strong {
    display: block;
    font-size: 1rem;
    color: var(--c-text);
    margin-bottom: 4px;
}
.dropzone-inner small { color: var(--c-muted); }

/* Login */
.login-wrap {
    max-width: 380px;
    margin: 60px auto;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 32px;
}
.login-wrap h1 { margin: 0 0 20px; font-size: 1.4rem; }
.login-wrap .btn-primary { width: 100%; justify-content: center; padding: 10px; }

/* Flash */
.flash {
    padding: 11px 16px;
    border-radius: 6px;
    margin: 0 0 16px;
    font-size: .92rem;
    border: 1px solid transparent;
}
.flash-ok   { background: #e7f5ec; color: #1c5a30; border-color: #b8dec3; }
.flash-err  { background: #fcecea; color: #80261c; border-color: #f0c5be; }
.flash-warn { background: #fdf3df; color: #6e4f10; border-color: #f0d9a4; }
.flash-info { background: #eaf3fc; color: #1e4a78; border-color: #c2dbf3; }

/* PDF-List */
.pdf-list {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.pdf-list th, .pdf-list td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
    font-size: .9rem;
}
.pdf-list th {
    font-weight: 600;
    font-size: .78rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--c-bg);
}
.pdf-list tr:last-child td { border-bottom: 0; }
.pdf-list tr:hover td { background: #faf8f4; }
.pdf-list .num { text-align: right; font-variant-numeric: tabular-nums; }
.pdf-list .actions { text-align: right; white-space: nowrap; }
.pdf-list .actions .btn-sm + .btn-sm { margin-left: 4px; }

.pdf-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.08);
}
.pdf-link {
    color: var(--c-text);
    text-decoration: none;
    font-weight: 500;
}
.pdf-link:hover { color: var(--c-primary); }
.pdf-alias {
    font-size: .78rem;
    color: var(--c-muted);
    margin-top: 2px;
}
.pdf-alias code {
    background: var(--c-bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .82em;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 500;
    background: var(--c-bg);
    color: var(--c-muted);
    text-transform: lowercase;
    letter-spacing: .02em;
}
.badge-mode { background: #efe9e0; color: #5a4a37; }

.empty {
    background: var(--c-card);
    border: 1px dashed var(--c-border);
    border-radius: var(--r);
    padding: 60px 20px;
    text-align: center;
}
.empty p { color: var(--c-muted); margin: 0 0 16px; }

/* Edit-Layout: Form + Snippet-Panel */
.edit-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 980px) {
    .edit-grid { grid-template-columns: 1fr; }
}

.snippet-panel {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
}
.snippet-panel h2 { margin: 0 0 4px; font-size: 1.05rem; }
.snippet-panel h3.snippet-h3 {
    margin: 20px 0 8px;
    font-size: .85rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}
.hint-text { color: var(--c-muted); font-size: .85rem; margin: 0 0 14px; }
.snippet-row {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    font-size: .85rem;
    font-weight: 500;
}
.snippet-row select, .snippet-row input {
    border: 1px solid var(--c-border);
    border-radius: 5px;
    padding: 6px 9px;
    font: inherit;
    font-size: .85rem;
    background: var(--c-card);
}
.snippet-out {
    background: #1f2227;
    color: #d6d8dd;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .76rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0 0 10px;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: all;
    max-height: 220px;
    overflow-y: auto;
}
.snippet-preview {
    margin-top: 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
}
.snippet-preview iframe { display: block; width: 100% !important; }
.snippet-preview > div { width: 100% !important; }

/* Thumbnail-Block im Edit */
.thumb-block {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    align-items: start;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
}
.thumb-img-wrap {
    width: 60px;
    aspect-ratio: 0.7 / 1;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumb-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.thumb-placeholder {
    color: var(--c-muted);
    font-size: .65rem;
    text-align: center;
    padding: 4px;
    line-height: 1.2;
}
.thumb-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.thumb-actions strong {
    font-size: .9rem;
}
.thumb-actions small {
    color: var(--c-muted);
    font-size: .78rem;
    line-height: 1.4;
}
.thumb-actions .btn-sm {
    align-self: flex-start;
    margin-top: 4px;
}
.thumb-status {
    font-size: .76rem;
    color: var(--c-muted);
    min-height: 1em;
}

/* Thumbnail in der PDF-Liste */
.list-thumb {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--c-border);
    display: block;
    background: var(--c-bg);
    flex-shrink: 0;
}
.list-thumb-empty {
    width: 36px;
    height: 48px;
    border: 1px dashed var(--c-border);
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--c-bg);
}

/* Danger-Box */
.danger-box {
    background: var(--c-card);
    border: 1px solid #f0c5be;
    border-left: 4px solid var(--c-danger);
    border-radius: var(--r);
    padding: 24px 28px;
    max-width: 600px;
    box-shadow: var(--shadow-sm);
}
.danger-box h2 { margin: 0 0 8px; font-size: 1.1rem; }
.danger-box code {
    background: var(--c-bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .9em;
}

/* Footer */
.footer {
    flex-shrink: 0;
    padding: 20px 24px;
    background: var(--c-card);
    border-top: 1px solid var(--c-border);
    color: var(--c-muted);
    font-size: .82rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.footer a { color: var(--c-muted); text-decoration: none; }
.footer a:hover { color: var(--c-primary); }
