/* ═══════════════════════════════════════════════════════════════════════
   style.css – Brynsveien Kjellerbryggeri – Shared Design System
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg:      #f1f3f5;
    --surface: #ffffff;
    /* Borders & text */
    --border:  #dee2e6;
    --text:    #212529;
    --muted:   #6c757d;
    /* Accent – blue */
    --accent:       #1a6fc4;
    --accent-hover: #155ea8;
    --accent-dim:   rgba(26,111,196,.12);
    /* Semantic colours */
    --danger:       #dc3545;
    --danger-hover: #bb2d3b;
    --green:        #198754;
    /* Shape & depth */
    --radius:       14px;
    --shadow:       0 2px 8px rgba(0,0,0,.08);
    --shadow-hover: 0 6px 20px rgba(0,0,0,.14);
}

[data-theme="dark"] {
    --bg:           #0f1117;
    --surface:      #1c1f26;
    --border:       #2d3240;
    --text:         #e4e6ea;
    --muted:        #8a91a1;
    --accent:       #4da3e0;
    --accent-hover: #6bbae8;
    --accent-dim:   rgba(77,163,224,.15);
    --danger:       #e25563;
    --danger-hover: #ea717e;
    --shadow:       0 2px 8px rgba(0,0,0,.3);
    --shadow-hover: 0 6px 20px rgba(0,0,0,.5);
}

/* ─── View Switch (card / table toggle) ────────────────────────────────── */
.view-switch {
    display: flex;
}

.vsw-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 7px 12px;
    font-family: inherit;
    cursor: pointer;
    font-size: .85rem;
    transition: all .15s;
    line-height: 1;
}
.vsw-btn:first-child { border-radius: 8px 0 0 8px; }
.vsw-btn:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
.vsw-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

/* ─── Table view (toggled via body.table-mode) ──────────────────────────── */
.table-view { display: none; }
body.table-mode .cards-grid { display: none !important; }
body.table-mode .table-view { display: block; }

.table-wrap {
    margin: 8px 16px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
}

.data-table {
    border-collapse: collapse;
    width: 100%;
    font-size: .82rem;
}
.data-table th {
    background: var(--bg);
    color: var(--muted);
    font-weight: 600;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }
.data-table tr.row-hidden { display: none; }

/* ─── Table action buttons ──────────────────────────────────────────────── */
.tbl-btn {
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    white-space: nowrap;
}
.tbl-btn-primary         { background: var(--accent); color: #fff; }
.tbl-btn-primary:hover   { background: var(--accent-hover); color: #fff; }
.tbl-btn-ghost           { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.tbl-btn-ghost:hover     { background: var(--border); }
.tbl-btn-danger          { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.tbl-btn-danger:hover    { background: var(--danger); color: #fff; }

/* ─── Image thumbnail (table rows / card tops) ──────────────────────────── */
.thumb-wrap {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}
.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
