/* Admin — same design system as the public site */

:root {
    --ink: #171717;
    --green-dark: #1C2E1E;
    --green-text: #5A635A;
    --green-soft: #738273;
    --green-cta: #4D6D47;
    --border: #F1F3F1;
    --tint: #FAFBF9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--tint);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Sidebar */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.side-logo { font-weight: 600; letter-spacing: -0.02em; font-size: 1.05rem; margin-bottom: 2rem; display: block; }
.side-logo span { color: var(--green-soft); }

.sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar nav a {
    padding: .55rem .8rem;
    border-radius: .6rem;
    color: var(--green-text);
    font-size: .95rem;
    transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--tint); }
.sidebar nav a.active { background: var(--green-dark); color: #fff; }

.logout-form { margin-top: auto; }

/* Content */

.content { margin-left: 220px; padding: 2.5rem 3rem; max-width: 1100px; }

h1 { font-size: 1.7rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}
.card-num { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; color: var(--green-dark); }
.card-label { color: var(--green-soft); font-size: .85rem; margin-top: .2rem; }

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.panel.narrow { max-width: 420px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

canvas { width: 100%; }

/* Tables */

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--green-soft);
    font-weight: 600;
    padding: .4rem .6rem;
    border-bottom: 1px solid var(--border);
}
td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-weight: 500; }
td.url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--green-text); }
td.empty { color: var(--green-soft); text-align: center; padding: 1.5rem; }

.row-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions form { display: inline; }

.icon-mini {
    display: inline-block;
    width: 18px; height: 18px;
    background: var(--green-dark);
    -webkit-mask: var(--icon) no-repeat center / contain;
    mask: var(--icon) no-repeat center / contain;
}
.cover-mini { height: 34px; border-radius: 6px; display: block; }

/* Forms */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-col { display: flex; flex-direction: column; gap: 1rem; }
.span-2 { grid-column: span 2; }

label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 500; color: var(--green-text); }
label.check { flex-direction: row; align-items: center; gap: .5rem; align-self: end; padding-bottom: .6rem; }
.hint { font-weight: 400; color: var(--green-soft); font-size: .78rem; }

input[type=text], input[type=url], input[type=number], input[type=password], select, textarea {
    font: inherit;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
    background: var(--tint);
    color: var(--ink);
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--green-dark);
    outline-offset: 0;
    background: #fff;
}
textarea { resize: vertical; }

.btn {
    font: inherit;
    font-weight: 500;
    background: var(--green-dark);
    color: #fff;
    border: none;
    border-radius: .6rem;
    padding: .6rem 1.4rem;
    cursor: pointer;
    transition: opacity .15s;
}
.btn:hover { opacity: .85; }

.btn-ghost {
    font: inherit;
    font-size: .85rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: .5rem;
    padding: .35rem .8rem;
    cursor: pointer;
    color: var(--green-text);
    transition: background .15s;
    display: inline-block;
}
.btn-ghost:hover { background: var(--tint); }
.btn-ghost.danger { color: #b3261e; border-color: #f3dad8; }
.btn-ghost.danger:hover { background: #fdf3f2; }

.flash {
    background: #ecf4ea;
    border: 1px solid #d6e5d2;
    color: var(--green-cta);
    border-radius: .6rem;
    padding: .6rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.flash-error {
    background: #fdf3f2;
    border: 1px solid #f3dad8;
    color: #b3261e;
    border-radius: .6rem;
    padding: .6rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(28, 46, 30, .08);
}
.login-card h1 { font-size: 1.25rem; margin: 1rem 0 1.25rem; }
.login-card form { display: flex; flex-direction: column; gap: 1rem; }

/* Responsive */

@media (max-width: 860px) {
    .sidebar {
        position: static;
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: .5rem;
        padding: .75rem 1rem;
        overflow-x: auto;
    }
    .side-logo { margin: 0 1rem 0 0; white-space: nowrap; }
    .sidebar nav { flex-direction: row; }
    .logout-form { margin: 0 0 0 auto; }
    .content { margin: 0; padding: 1.5rem 1rem; }
    .panel-row, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
}
