/* PT Besi Jaya Asia - admin panel styles */
:root {
    --primary: #123a5e;
    --secondary: #e07b1f;
    --accent: #0b1b2b;
    --ink: #1f2933;
    --muted: #74838f;
    --line: #e1e7ee;
    --bg: #f4f6f9;
    --radius: 10px;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary); }
h1, h2, h3, h4 { margin: 0 0 .8rem; color: var(--accent); }
.muted { color: var(--muted); font-size: .88rem; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }

/* Sidebar */
.sidebar {
    width: 250px; flex: 0 0 250px;
    background: var(--accent); color: #c6d2de;
    display: flex; flex-direction: column; padding: 1.4rem 0;
}
.sidebar__brand { display: flex; align-items: center; gap: .7rem; padding: 0 1.3rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__brand strong { display: block; color: #fff; font-size: .95rem; }
.sidebar__brand small { color: #8fa2b5; font-size: .75rem; }
.brand__mark {
    width: 38px; height: 38px; border-radius: 8px; background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: 0 0 38px;
}
.sidebar__nav { display: flex; flex-direction: column; padding: 1rem 0; flex: 1; }
.sidebar__nav a { color: #c6d2de; padding: .7rem 1.3rem; font-size: .92rem; border-left: 3px solid transparent; }
.sidebar__nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar__nav a.is-active { background: rgba(255,255,255,.08); border-left-color: var(--secondary); color: #fff; font-weight: 600; }
.sidebar__foot { padding: 1rem 1.3rem 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar__foot a { color: #8fa2b5; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar__actions { display: flex; align-items: center; gap: 1rem; }
.who { color: var(--muted); font-size: .88rem; }
.content { padding: 2rem; }

/* Buttons */
.btn {
    display: inline-block; padding: .65rem 1.3rem; border-radius: 6px; border: 2px solid transparent;
    font-weight: 600; font-size: .9rem; cursor: pointer; font-family: inherit;
}
.btn--primary { background: var(--secondary); color: #fff; }
.btn--primary:hover { background: #c9691a; color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--sm { padding: .45rem 1rem; font-size: .82rem; }
.link-danger { background: none; border: 0; color: #b03030; cursor: pointer; font: inherit; padding: 0; }
.link-danger:hover { text-decoration: underline; }

/* Cards / panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.stat span { display: block; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.stat strong { display: block; font-size: 1.9rem; color: var(--accent); line-height: 1.2; }
.stat small { color: var(--muted); font-size: .8rem; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.panel h3 { font-size: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.toolbar__search { display: flex; gap: .6rem; flex-wrap: wrap; }
.toolbar__search input, .toolbar__search select {
    padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .8rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-unread td { background: #fffaf2; }
.table--kv th { width: 180px; }
.table .actions { display: flex; gap: 1rem; align-items: center; }
.table .actions form { display: inline; }

.badge { padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge--published { background: #e7f6ed; color: #1e6b3f; }
.badge--draft { background: #f1f1f1; color: #666; }

/* Forms */
.form-panel label { display: block; margin-bottom: 1.1rem; font-weight: 600; font-size: .9rem; color: var(--accent); }
.form-panel input[type="text"], .form-panel input[type="email"], .form-panel input[type="number"],
.form-panel input[type="datetime-local"], .form-panel input[type="color"], .form-panel textarea,
.form-panel select, .form input[type="text"], .form input[type="email"], .form input[type="password"], .form textarea {
    width: 100%; margin-top: .35rem; padding: .7rem .85rem; border: 1px solid var(--line);
    border-radius: 6px; font: inherit; font-weight: 400; background: #fff;
}
.form-panel input[type="color"] { height: 44px; padding: .2rem; }
.form-panel input[type="file"] { margin-top: .35rem; font-weight: 400; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form__row--3 { grid-template-columns: repeat(3, 1fr); }
.form__row--4 { grid-template-columns: repeat(4, 1fr); }
.form__actions { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }
label.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
label.checkbox input { width: auto; margin: 0; }

.alert { border-radius: 6px; padding: .9rem 1.2rem; margin-bottom: 1.4rem; font-size: .9rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert--success { background: #e7f6ed; color: #1e6b3f; border: 1px solid #bfe4cd; }
.alert--error { background: #fdecec; color: #a12424; border: 1px solid #f3c9c9; }

.message-body {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    padding: 1.2rem; margin: 1.2rem 0; white-space: pre-line;
}

.pagination { margin-top: 1.5rem; }
.pagination svg { width: 16px; height: 16px; display: inline; vertical-align: middle; }

/* Login */
body.login-page {
    display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, var(--accent), var(--primary));
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0;
}
.login-card { background: #fff; border-radius: 14px; padding: 2.4rem; width: min(400px, 92%); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.login-card__brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.6rem; }
.login-card__brand strong { display: block; color: var(--accent); }
.login-card__brand small { color: var(--muted); font-size: .8rem; }
.login-card__foot { text-align: center; margin: 1.2rem 0 0; font-size: .85rem; }
.form .btn--block { width: 100%; text-align: center; }

@media (max-width: 900px) {
    body.admin { flex-direction: column; }
    .sidebar { width: 100%; flex: none; }
    .grid-2, .form__row, .form__row--3, .form__row--4 { grid-template-columns: 1fr; }
    .content { padding: 1.2rem; }
}
