* { box-sizing: border-box; }

/* --- Layout z sidebarem po lewej --- */
.layout { display: flex; gap: 2em; max-width: 1280px; margin: 2em auto; padding: 0 1em; }
.layout .sidebar { width: 160px; flex-shrink: 0; }
.layout .content { flex: 1; }

/* --- Look platformy morele — spójny ze stylem managera --- */
body { font: 16px/1.4 system-ui, sans-serif; color: #222; }
a { color: #2563eb; }

/* Sidebar - prosty, jak linki w menu */
.sidebar { display: flex; flex-direction: column; gap: 1em; padding-top: 1em; }
.sidebar .item {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: .95em;
}
.sidebar .item:hover { text-decoration: underline; }
.sidebar .item.active { color: #2563eb; font-weight: 600; }

/* Nagłówek platformowy (jak header.top managera) */
header.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5em; padding-bottom: 1em; border-bottom: 1px solid #eee; }
header.top h1 { margin: 0; font-size: 1.05em; font-weight: 600; }
header.top h1 a { color: #2563eb; text-decoration: none; }
header.top h1 a:hover { text-decoration: underline; }
header.top .left { display: flex; align-items: baseline; gap: 1.5em; }
header.top .menu { display: flex; gap: 1em; }
header.top .menu a { color: #2563eb; text-decoration: none; font-size: .9em; }
header.top .menu a:hover { text-decoration: underline; }
header.top .right { display: flex; align-items: center; gap: 1em; }
header.top .who { color: #666; font-size: .9em; }
header.top a.logout { color: #666; text-decoration: none; font-size: .9em; }
header.top a.logout:hover { color: #c00; }

/* Typografia */
h1.page-title, .page-title { margin: 0 0 .5em; font-size: 1.6em; font-weight: 700; color: #222; line-height: 1.2; }
h2 { font-size: 1.05em; margin: 1.5em 0 .8em; color: #444; font-weight: 600; }
.meta { color: #666; font-size: .9em; margin-bottom: 1.5em; }
.error { background: #fee; color: #c00; padding: 1em; border-radius: 4px; margin-bottom: 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f4f4; padding: .1em .35em; border-radius: 3px; font-size: .9em; }
ul { padding-left: 1.4em; }
li { margin: .3em 0; }
small { color: #999; }

/* Akcenty hello-world w palecie managera */
.big-number { font-size: 2.8em; font-weight: 700; margin: .3em 0 .2em; color: #2563eb; }
blockquote { margin: 1.2em 0; padding: 1em 1.3em; background: #f6f7f9; border-left: 4px solid #2563eb; font-size: 1.1em; border-radius: 0 6px 6px 0; }

/* Formularze/przyciski — jeden standard jak w managerze */
input, select, textarea, button, .btn { font-family: inherit; font-size: .95em; line-height: 1.3; border-radius: 5px; box-sizing: border-box; }
input, select, textarea { padding: .45em .7em; border: 1px solid #ccc; background: #fff; color: #222; }
/* Select: własna strzałka (appearance:none) — natywna jest ściśnięta przy prawej krawędzi,
   a padding-right nie kontroluje odstępu strzałka→krawędź. Dajemy jej oddech (right .7em). WAŻNE. */
select {
    appearance: none; -webkit-appearance: none;
    padding-right: 2em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='1.6'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7em center; background-size: .8em;
}
button, .btn { padding: .45em 1em; border: 1px solid #2563eb; background: #2563eb; color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* --- Interaktywne widgety (Alpine.js) --- */
[x-cloak] { display: none; }
.muted { color: #888; font-size: .85em; }

/* Tabele - prosty styl */
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95em; }
th, td { padding: .4em .6em; border-bottom: 1px solid #eee; text-align: left; }
th { font-weight: 600; }
tr:hover { background: #f8f9fa; }

/* --- Logowanie managera --- */
.login { max-width: 340px; margin: 12vh auto 0; padding: 0 1em; }
.login form { display: flex; flex-direction: column; gap: 1em; }
.login label { display: flex; flex-direction: column; gap: .35em; font-size: .9em; color: #444; }
.login input { font: inherit; padding: .55em .7em; border: 1px solid #ccc; border-radius: 6px; }
.login input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb; }
.login button { font: inherit; padding: .6em; border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; }
.login button:hover { background: #1d4ed8; }
.login .error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; padding: .6em .8em; border-radius: 6px; }

/* --- portal --- */
.code { font-family: ui-monospace, monospace; font-size: .8em; color: #666; background: #f3f4f6; padding: .1em .4em; border-radius: 4px; }
.tag { font-size: .75em; color: #1d4ed8; background: #eff6ff; padding: .1em .5em; border-radius: 999px; margin-left: .3em; }
.flash { padding: .6em .8em; border-radius: 6px; margin: 0 0 1em; }
.flash.ok { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.flash.error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
ul.list { list-style: none; padding: 0; margin: 0 0 1em; }
ul.list li { padding: .5em 0; border-bottom: 1px solid #eee; }
ul.list .sub { margin-top: .3em; font-size: .9em; color: #555; }
form.inline { display: inline; }
form.row { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; margin: .5em 0 1.5em; }
form.row input, form.row select { font: inherit; padding: .4em .6em; border: 1px solid #ccc; border-radius: 6px; }
form.row button, .sub button { font: inherit; padding: .4em .8em; border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; }
button.link { background: none; border: 0; color: #2563eb; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
button.danger, button.link.danger { color: #b91c1c; }
form.row button.danger { background: #b91c1c; color: #fff; }
.sub form.inline input { font: inherit; padding: .2em .4em; border: 1px solid #ccc; border-radius: 4px; }

/* --- manager --- */
table.grid { border-collapse: collapse; width: 100%; font-size: .92em; }
table.grid th, table.grid td { text-align: left; padding: .45em .6em; border-bottom: 1px solid #eee; vertical-align: top; }
table.grid th { color: #666; font-weight: 600; font-size: .85em; }
table.logs td:last-child { font-family: ui-monospace, monospace; font-size: .85em; word-break: break-all; }
table.logs tr.sev3 td, table.logs tr.sev2 td { color: #b91c1c; }
table.logs tr.sev4 td { color: #92400e; }

/* --- zakładki --- */
nav.tabs { display: flex; gap: .2em; border-bottom: 1px solid #ddd; margin: 0 0 1.2em; }
nav.tabs a { padding: .5em .9em; color: #555; text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
nav.tabs a:hover { color: #2563eb; }
nav.tabs a.active { color: #222; font-weight: 600; background: #fff; border-color: #ddd; }
