/* Admin stylesheet – navazuje na stejnou paletu, ale sidebar layout */
:root {
    --color-bg: #f7f6f3;
    --color-surface: #ffffff;
    --color-text: #131313;
    --color-muted: #6b6b6b;
    --color-border: #e5e3dd;
    --color-accent: #0a5c3a;
    --color-accent-hover: #07492e;
    --color-danger: #b91c1c;
    --radius: 6px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.admin {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

body.admin {
    display: grid; grid-template-columns: 240px 1fr; min-height: 100vh;
}

.admin-sidebar {
    background: #131313; color: rgba(255,255,255,.85);
    padding: 24px 20px; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.admin-logo {
    color: #fff; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 1.1rem;
    margin-bottom: 24px; display: block;
}
.admin-logo em { color: #b7e4c8; font-style: normal; font-weight: 400; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-sidebar nav a {
    color: rgba(255,255,255,.75); padding: 10px 12px;
    border-radius: var(--radius); font-size: .92rem;
    display: block; text-decoration: none;
}
.admin-sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar nav a.is-active { background: var(--color-accent); color: #fff; }

.admin-sidebar__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; font-size: .85rem; }
.admin-sidebar__bottom a { display: block; color: rgba(255,255,255,.65); padding: 4px 0; }
.admin-sidebar__bottom a:hover { color: #fff; }
.admin-sidebar__bottom .muted { color: rgba(255,255,255,.5); margin: 0 0 8px; }

.admin-main { padding: 32px 40px 80px; }
.admin-main__head { margin-bottom: 28px; }
.admin-main__head h1 { font-size: 1.75rem; margin: 0; }
.admin-main__actions { margin-bottom: 20px; display: flex; gap: 10px; }

/* Tables */
.table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--color-border); font-size: .93rem; }
.table th { background: #faf9f5; font-weight: 600; color: var(--color-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.table a.btn { margin-left: 4px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat {
    display: block; text-decoration: none; color: inherit;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 20px 22px;
    transition: transform .1s, box-shadow .1s;
}
a.stat:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.05); text-decoration: none; }
.stat__label { display: block; color: var(--color-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.stat__value { display: block; font-size: 2rem; font-weight: 600; margin-top: 6px; color: var(--color-text); }
.stat__value small { font-size: .6em; color: var(--color-muted); font-weight: 400; }

/* Buttons – sdílené se style.css (duplikujeme pro nezávislost admina) */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px; font-size: .9rem; font-weight: 500;
    border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--ghost { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { border-color: var(--color-text); }
.btn--danger { background: #fff; color: var(--color-danger); border-color: #fecaca; }
.btn--danger:hover { background: #fef2f2; }
.btn--sm { padding: 6px 12px; font-size: .82rem; }
.btn--lg { padding: 14px 24px; font-size: 1rem; }
.btn--block { width: 100%; }

/* Flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 16px; font-size: .92rem; }
.flash--success { background: #dcfce7; color: #166534; }
.flash--error { background: #fef2f2; color: #b91c1c; }
.flash--info { background: #e0f2fe; color: #0c4a6e; }

/* Forms */
.form--admin {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: block;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.form--admin label, .form label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; font-size: .9rem; color: var(--color-muted); }
.form--admin label > span { color: var(--color-text); font-weight: 500; }
.form--admin input, .form--admin select, .form--admin textarea,
.form input, .form select, .form textarea {
    font: inherit; color: inherit;
    padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius);
    background: #fff; width: 100%;
}
.form--admin textarea { font-family: inherit; }
.form--admin input:focus, .form--admin select:focus, .form--admin textarea:focus {
    outline: 2px solid #e9f1ec; border-color: var(--color-accent);
}
.form__check { flex-direction: row !important; align-items: flex-start; gap: 10px; }
.form__check input { width: 18px; height: 18px; margin-top: 2px; }
.form__full { width: 100%; }
.form hr { border: 0; border-top: 1px solid var(--color-border); margin: 14px 0; }

/* Inline form */
.inline-form { display: inline; }
.inline-form select { padding: 6px 10px; font-size: .85rem; }

/* Thumbs edit (obrázky v edit formuláři) */
.thumbs-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 8px; }
.thumb-edit { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; font-size: .82rem; }
.thumb-edit img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.thumb-edit span { padding: 6px 8px; }

/* Login */
.admin-login {
    display: grid; grid-template-columns: 1fr; place-items: center;
    min-height: 100vh; background: #131313; color: #fff;
    padding: 24px;
}
.admin-login .admin-logo { margin-bottom: 12px; }
.admin-login .form { background: #1e1e1e; color: #fff; border: 1px solid rgba(255,255,255,.08); display: block; }
.admin-login h1 { color: #fff; margin: 0 0 20px; font-size: 1.5rem; }
.admin-login input { background: #2a2a2a; border-color: rgba(255,255,255,.1); color: #fff; }
.login-card { max-width: 380px; width: 100%; background: #1e1e1e; border-radius: var(--radius-lg); padding: 36px; border: 1px solid rgba(255,255,255,.08); }
.login-card .muted { color: rgba(255,255,255,.5); margin-top: 16px; font-size: .85rem; }
.login-card .muted a { color: rgba(255,255,255,.7); }

/* Detail card */
.detail-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 28px; max-width: 720px; }
.detail-card dl { margin: 0 0 20px; display: grid; grid-template-columns: 1fr; gap: 0; }
.detail-card dl > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.detail-card dl > div:last-child { border-bottom: 0; }
.detail-card dt { color: var(--color-muted); margin: 0; }
.detail-card dd { margin: 0; font-weight: 500; }
.detail-card .message-box { background: #faf9f5; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 16px; margin: 8px 0 20px; }
.detail-card .actions { display: flex; gap: 10px; }

/* Misc */
.muted { color: var(--color-muted); }
.link-arrow { color: var(--color-accent); font-weight: 500; }
.link-arrow::after { content: ' →'; }

@media (max-width: 800px) {
    body.admin { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .admin-main { padding: 24px; }
}
