/* AVONON IT Solutions - Corporate Identity
   Primary  #3c4858 (dark blue)   Accent #e5f6fd (light blue)
   White #ffffff   Grey #b0bec5
   Headings: Montserrat   Body: Lato                              */

:root {
    --avo-dark: #3c4858;
    --avo-dark-2: #324050;
    --avo-accent: #e5f6fd;
    --avo-accent-strong: #7cc6e8;
    --avo-white: #ffffff;
    --avo-grey: #b0bec5;
    --avo-grey-soft: #eef2f5;
    --avo-text: #3c4858;
    --avo-muted: #6b7a8d;
    --avo-ok: #2e9e6b;
    --avo-warn: #c9871f;
    --avo-err: #c0392b;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(60, 72, 88, .12);
    --font-head: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Lato', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-body);
    color: var(--avo-text);
    background: var(--avo-grey-soft);
    font-size: 15px;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--avo-dark); }
a { color: var(--avo-dark); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--avo-dark);
    color: #d8e1ea;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 0 1.5rem 1.25rem; }
.brand img { width: 34px; height: 34px; }
.brand .name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: #fff; line-height: 1; }
.brand .sub { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--avo-accent-strong); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .75rem; }
.nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .8rem; border-radius: 9px;
    color: #cdd8e2; text-decoration: none; font-weight: 400;
    transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: var(--avo-accent); color: var(--avo-dark); font-weight: 700; }
.nav .ico { width: 18px; text-align: center; }
.sidebar .foot { margin-top: auto; padding: 1rem 1.5rem 0; font-size: .72rem; color: #8ea0b2; }

.main { padding: 2rem 2.5rem; max-width: 1200px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.topbar .who { color: var(--avo-muted); font-size: .85rem; }
.topbar .who b { color: var(--avo-dark); }

/* ---------- Cards / tables ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.6rem; margin-bottom: 1.4rem; }
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.stat .v { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--avo-dark); line-height: 1; }
.stat .v.stat-ok  { color: var(--avo-ok); }
.stat .v.stat-warn { color: var(--avo-warn); }
.stat .v.stat-err  { color: var(--avo-err); }
.stat .l { color: var(--avo-muted); font-size: .82rem; margin-top: .35rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--avo-grey-soft); font-size: .88rem; }
th { color: var(--avo-muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: #fafcfe; }
td.actions { white-space: nowrap; text-align: right; }

/* ---------- Buttons ---------- */
.btn {
    font-family: var(--font-body); font-weight: 700; font-size: .85rem;
    border: 1px solid transparent; border-radius: 9px; padding: .5rem .95rem;
    cursor: pointer; background: var(--avo-dark); color: #fff; transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn.secondary { background: var(--avo-accent); color: var(--avo-dark); }
.btn.ghost { background: transparent; color: var(--avo-dark); border-color: var(--avo-grey); }
.btn.danger { background: var(--avo-err); }
.btn.sm { padding: .32rem .6rem; font-size: .78rem; }
.btn + .btn { margin-left: .4rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: .8rem; margin-bottom: .3rem; color: var(--avo-dark); }
.field .hint { font-weight: 400; color: var(--avo-muted); font-size: .76rem; }
input, select, textarea {
    width: 100%; font-family: var(--font-body); font-size: .9rem; color: var(--avo-text);
    padding: .55rem .7rem; border: 1px solid var(--avo-grey); border-radius: 9px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--avo-accent-strong); box-shadow: 0 0 0 3px var(--avo-accent); }
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge.ok { background: #e3f5ec; color: var(--avo-ok); }
.badge.warn { background: #fbf0db; color: var(--avo-warn); }
.badge.err { background: #fbe4e1; color: var(--avo-err); }
.badge.muted { background: var(--avo-grey-soft); color: var(--avo-muted); }
.badge.info { background: var(--avo-accent); color: var(--avo-dark); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(60, 72, 88, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); width: 100%; max-width: 620px; padding: 1.6rem 1.8rem; }
.modal h2 { margin-top: 0; }
.modal .modal-foot { display: flex; justify-content: flex-end; margin-top: 1.2rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--avo-dark), var(--avo-dark-2)); }
.login-card { background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); width: 100%; max-width: 380px; padding: 2.2rem; text-align: center; }
.login-card img { width: 56px; height: 56px; }
.login-card h1 { margin: .8rem 0 .2rem; font-size: 1.3rem; }
.login-card p { color: var(--avo-muted); margin-top: 0; font-size: .85rem; }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; margin-top: .4rem; }

/* ---------- Misc ---------- */
.muted { color: var(--avo-muted); }
.assistant-steps { list-style: none; padding: 0; margin: 0 0 1rem; }
.assistant-steps li { display: flex; gap: .8rem; padding: .55rem 0; align-items: flex-start; }
.assistant-steps .n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--avo-accent); color: var(--avo-dark); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.assistant-steps li.done .n { background: var(--avo-ok); color: #fff; }
.assistant-steps li.active .n { background: var(--avo-dark); color: #fff; }
.linkbox { display: flex; gap: .5rem; margin: .6rem 0; }
.linkbox input { font-family: ui-monospace, monospace; font-size: .78rem; }
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--avo-dark); color: #fff; padding: .8rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); z-index: 80; max-width: 380px; }
.toast.err { background: var(--avo-err); }
.toast.ok { background: var(--avo-ok); }
.empty { text-align: center; color: var(--avo-muted); padding: 2.5rem 1rem; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--avo-grey); border-top-color: var(--avo-dark); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .main { padding: 1.2rem; }
    .row2 { grid-template-columns: 1fr; }
}
