/* =========================================================
   AVALA KETERING – admin stil
   ========================================================= */

:root {
    --bg:        #f4f6f8;
    --panel:     #ffffff;
    --ink:       #1c2430;
    --muted:     #6b7787;
    --line:      #e2e6ec;
    --brand:     #e0632a;
    --brand-ink: #ffffff;
    --ok:        #1f9d55;
    --warn:      #d98613;
    --err:       #d63b30;
    --radius:    10px;
    --shadow:    0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: #eef1f5;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
code.big { font-size: 16px; padding: 8px 12px; display: inline-block; }

h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 22px 0 8px; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: 24px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 0 20px; height: 56px;
    position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
    padding: 8px 12px; border-radius: 8px; color: var(--ink);
    font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: #f1f3f7; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 16px; }

/* ---------- Panels ---------- */
.panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px; margin-bottom: 20px;
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 20px; }

/* ---------- Cards ---------- */
.cards {
    display: grid; gap: 14px; margin-bottom: 22px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow);
}
.card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-value { font-size: 26px; font-weight: 700; margin: 4px 0; }
.card-sub { font-size: 12px; color: var(--muted); }
.warn-text { color: var(--warn); }
.err-text  { color: var(--err); }

.progress { background: #eef1f5; border-radius: 99px; height: 8px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; }
.table tbody tr:hover { background: #fafbfd; }
.table .num, .table .right { text-align: right; }
.table .center { text-align: center; }
.table .bar { width: 40%; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.kv th { width: 210px; color: var(--muted); font-weight: 500; }
.row-missing td { background: #fffaf2; }
.row-edit td { background: #f7f9ff; }

/* ---------- Badges / tags ---------- */
.badge, .tag {
    display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px;
    border-radius: 99px; text-transform: uppercase; letter-spacing: .03em;
}
.badge.draft  { background: #eceff3; color: #5a6675; }
.badge.sent   { background: #e6f5ec; color: var(--ok); }
.badge.closed { background: #f0e9fb; color: #6b46c1; }
.tag.ok    { background: #e6f5ec; color: var(--ok); }
.tag.warn  { background: #fdf3e2; color: var(--warn); }
.tag.err   { background: #fdeceb; color: var(--err); }

/* ---------- Alerts ---------- */
.alert {
    padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
    border: 1px solid transparent;
}
.alert.ok   { background: #e9f7ef; border-color: #bfe6cd; color: #14663a; }
.alert.warn { background: #fdf6e7; border-color: #f0dcae; color: #8a5a05; }
.alert.err  { background: #fdeceb; border-color: #f3c2be; color: #92211a; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: #3b4657; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=datetime-local], input[type=search], input[type=file],
select, textarea {
    width: 100%; margin-top: 5px; padding: 9px 11px;
    border: 1px solid #cfd6df; border-radius: 8px; font: inherit; background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224,99,42,.14);
}
textarea { resize: vertical; }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.form-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline input, .inline select { margin-top: 0; width: auto; }
.inline.wide { flex: 1; min-width: 260px; }
.inline.wide input { flex: 1; }
.wrap-form { flex-wrap: wrap; }
.inline-check { display: inline; font-weight: 400; }
.inline-check input { width: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
    padding: 7px 13px; border-radius: 99px; background: #fff; border: 1px solid var(--line);
    color: var(--ink); font-size: 13px; font-weight: 500;
}
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs a:hover { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border-radius: 8px; border: 1px solid #cfd6df;
    background: #fff; color: var(--ink); font: inherit; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f4f6f9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.danger { color: var(--err); border-color: #f0c3bf; }
.btn.danger:hover { background: #fdeceb; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 6px; }

/* ---------- Menu options editor ---------- */
.opt-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.opt-num {
    flex: 0 0 28px; height: 28px; margin-top: 6px; border-radius: 50%;
    background: var(--brand); color: #fff; display: flex; align-items: center;
    justify-content: center; font-size: 13px; font-weight: 700;
}
.opt-fields { flex: 1; display: grid; gap: 6px; }
.opt-fields input { margin-top: 0; }
.opt-del { margin-top: 6px; }

/* ---------- Auth stranice ---------- */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(160deg, #2b3444, #131922);
}
.auth-card {
    background: #fff; padding: 30px; border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3); width: 100%; max-width: 400px;
}
.auth-card h1 { margin-bottom: 4px; font-size: 21px; }
.auth-card .muted { margin-top: 0; margin-bottom: 20px; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
    .nav { order: 3; width: 100%; }
    .wrap { padding: 16px 12px 50px; }
    .table { font-size: 13px; }
    .table th, .table td { padding: 7px 6px; }
    .hide-sm { display: none; }
}
