/* Comparator preturi - stiluri.
   Fara framework: se incarca instant si nu depinde de niciun CDN
   (politica CSP a aplicatiei nici nu ar permite resurse externe). */

:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --border: #dfe4ea;
    --text: #1f2933;
    --muted: #6b7684;
    --accent: #1f6f8b;
    --accent-dark: #17566c;
    --ok: #1e7f4f;
    --ok-bg: #e7f6ee;
    --warn: #9a6700;
    --warn-bg: #fff6e0;
    --err: #b3261e;
    --err-bg: #fdecea;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- antet */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 58px;
    flex-wrap: wrap;
}
.brand {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--accent); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ continut */

main { padding: 28px 0 60px; }
h1 { font-size: 23px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 22px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.card.tight { padding: 14px 16px; }

/* ------------------------------------------------------------ formulare */

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(31, 111, 139, .35);
    border-color: var(--accent);
}
textarea { min-height: 220px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--bg); color: var(--text); }
.btn.danger { background: #fff; color: var(--err); border-color: #f0c2bd; }
.btn.danger:hover { background: var(--err-bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.searchbar { display: flex; gap: 10px; flex-wrap: wrap; }
.searchbar input[type=search] { flex: 1; min-width: 260px; font-size: 16px; padding: 12px 14px; }
.inline { display: inline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 180px; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.checkline input { width: auto; }

/* -------------------------------------------------------------- tabele */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 9px 10px;
    white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.best td { background: var(--ok-bg); }
.best .price { color: var(--ok); }
.dim td { color: var(--muted); }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 28px; }

/* ------------------------------------------------------------- etichete */

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.neutral { background: var(--bg); color: var(--muted); }

.alert {
    padding: 12px 15px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 14px;
}
.alert.success { background: var(--ok-bg); border-color: #b7e4cc; color: #10603a; }
.alert.error { background: var(--err-bg); border-color: #f5c2c0; color: #8c1d18; }
.alert.info, .alert.warning { background: var(--warn-bg); border-color: #f3dfae; color: #7a5200; }

/* ------------------------------------------------------------- sumar */

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 18px;
    min-width: 138px;
    flex: 1;
}
.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v.ok { color: var(--ok); }
.stat .m { font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.truncate { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------------- grafic */

.chart { width: 100%; height: auto; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: rgba(31, 111, 139, .10); }
.chart .dot { fill: var(--accent); }
.chart .grid { stroke: #e8ecf0; stroke-width: 1; }
.chart .lbl { font-size: 10px; fill: var(--muted); }

/* ------------------------------------------------------ autentificare */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-box { width: 100%; max-width: 380px; }
.login-box .card { padding: 28px; }
.login-box h1 { text-align: center; margin-bottom: 22px; font-size: 20px; }
.login-box .field { margin-bottom: 15px; }
.login-box .btn { width: 100%; padding: 12px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* --------------------------------------------------------------- print */

@media print {
    .topbar, .no-print, .btn { display: none !important; }
    body { background: #fff; font-size: 12px; }
    .card { border: none; box-shadow: none; padding: 0; }
    table { font-size: 11px; }
    a { color: inherit; text-decoration: none; }
}

/* ------------------------------------------------- filtre (jurnal admin)
   Linie de linkuri de filtrare cu optiunea curenta evidentiata. */

.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters a {
    padding: 4px 11px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
}
.filters a:hover { background: var(--border); color: var(--text); }
.filters a.active { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
    .topbar .wrap { min-height: auto; padding-top: 10px; padding-bottom: 10px; }
    .stat { min-width: 100%; }
    .truncate { max-width: 180px; }
}
