/*
  Pannello catalogo gin - La Tana
  Palette e tipografia allineate al sito pubblico:
  accento #987d5f, fondo #111, titoli Oswald, testo Raleway.
*/

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #111;
    color: #e6e6e6;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: #987d5f; text-decoration: none; transition: color .3s linear; }
a:hover { color: #c2a37c; }

img { max-width: 100%; height: auto; display: block; }

/* ------------------------------------------------------------ topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
    padding: 0 32px;
    background: #0d0d0d;
    border-bottom: 1px solid #242424;
}

.topbar-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    padding: 20px 0;
    white-space: nowrap;
}
.topbar-brand span { color: #987d5f; }

.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }

.topbar-nav a {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8b8b8b;
    padding: 22px 14px;
    border-bottom: 2px solid transparent;
}
.topbar-nav a:hover { color: #fff; }
.topbar-nav a.attivo { color: #fff; border-bottom-color: #987d5f; }

.topbar-user {
    font-size: 12px;
    color: #6f6f6f;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.topbar-user strong { color: #b9b9b9; font-weight: 700; }

/* contatore live in alto */
.contatore {
    display: flex;
    align-items: center; /* regge sia una riga sola sia le due con "n online" */
    gap: 11px;
    padding: 7px 18px;
    border: 1px solid #2e2820;
    background: #17140f;
}
.contatore-numero {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: #987d5f;
}
.contatore-etichetta {
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #6f6f6f;
    display: block;
}

.contatore-testo { line-height: 1.35; }

/* Compare solo quando qualche bottiglia e nascosta: cosi si vede
   subito che l'archivio e il sito pubblico non coincidono. */
.contatore-online {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #987d5f;
}
.contatore-online[hidden] { display: none; }
.contatore-online b { font-weight: 700; }

/* ------------------------------------------------------------ layout */

.wrap { max-width: 1320px; margin: 0 auto; padding: 40px 32px 90px; }
.wrap-stretto { max-width: 860px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #fff;
    margin: 0;
}

h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #987d5f;
    margin: 40px 0 18px;
}

.occhiello {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #987d5f;
    margin: 0 0 8px;
}

.nota { color: #7d7d7d; font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------ bottoni */

.btn {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #987d5f;
    background: none;
    border: 1px solid #987d5f;
    padding: 13px 30px;
    cursor: pointer;
    transition: background-color .35s ease, color .35s ease, border-color .35s ease;
    white-space: nowrap;
}
.btn:hover { background: #987d5f; color: #111; }

.btn-pieno { background: #987d5f; color: #111; }
.btn-pieno:hover { background: #b08f6b; border-color: #b08f6b; color: #111; }

.btn-neutro { color: #8b8b8b; border-color: #3a3a3a; }
.btn-neutro:hover { background: #2a2a2a; border-color: #555; color: #fff; }

.btn-rosso { color: #c2564e; border-color: #6d312c; }
.btn-rosso:hover { background: #7d3b35; border-color: #7d3b35; color: #fff; }

.btn-piccolo { padding: 8px 16px; font-size: 10px; letter-spacing: 0.1em; }

.azioni { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ messaggi */

.msg {
    border: 1px solid #333;
    border-left-width: 3px;
    background: #161616;
    padding: 15px 20px;
    margin: 0 0 26px;
    font-size: 13px;
}
.msg-ok     { border-color: #41703a; border-left-color: #5f9c54; background: #131a12; color: #b6d6ae; }
.msg-errore { border-color: #7d3b35; border-left-color: #c2564e; background: #1c1312; color: #e0b0ab; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------ filtri */

.filtri {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 20px 22px;
    border: 1px solid #242424;
    background: #151515;
    margin-bottom: 26px;
}
.filtri .campo { flex: 1 1 175px; min-width: 0; }
.filtri .campo-largo { flex: 2 1 260px; }

/* ------------------------------------------------------------ form */

.campo { margin-bottom: 24px; }

label, .etichetta {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8b8b8b;
    margin-bottom: 8px;
}

input[type=text], input[type=search], input[type=password], select, textarea {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 11px 13px;
    outline: none;
    transition: border-color .3s ease;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.7; }

input:focus, select:focus, textarea:focus { border-color: #987d5f; }
input::placeholder, textarea::placeholder { color: #4f4f4f; font-weight: 600; }

select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23987d5f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 11px;
    padding-right: 34px;
}
select option { background: #1a1a1a; color: #fff; }

.aiuto { color: #666; font-size: 12px; font-weight: 600; margin-top: 7px; }

.riga { display: flex; gap: 22px; flex-wrap: wrap; }
.riga > .campo { flex: 1 1 260px; min-width: 0; }

.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 17px; height: 17px; accent-color: #987d5f; }
.check label { margin: 0; text-transform: none; font-size: 13px; letter-spacing: 0.03em; color: #c9c9c9;
               font-family: 'Raleway', sans-serif; font-weight: 600; }

.form-azioni {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #242424;
}

/* ------------------------------------------------------------ upload */

.dropzone {
    border: 1px dashed #3a3a3a;
    background: #141414;
    padding: 30px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .3s ease, background-color .3s ease;
}
.dropzone:hover, .dropzone.sopra { border-color: #987d5f; background: #17140f; }
.dropzone input[type=file] { display: none; }
.dropzone-testo {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8b8b8b;
}
.dropzone-testo b { color: #987d5f; font-weight: 700; }

.anteprima {
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}
.anteprima img {
    width: 150px;
    border: 1px solid #2a2a2a;
    background: #0d0d0d;
}

/* ------------------------------------------------------------ tabella */

.tabella-wrap { border: 1px solid #242424; background: #151515; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 780px; }

thead th {
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #7d7d7d;
    text-align: left;
    padding: 15px 18px;
    border-bottom: 1px solid #242424;
    background: #121212;
    white-space: nowrap;
}
thead th a { color: #7d7d7d; }
thead th a:hover { color: #987d5f; }

tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid #1f1f1f;
    vertical-align: middle;
    font-size: 13px;
    color: #cfcfcf;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color .2s ease; }
tbody tr:hover { background: #191919; }

td.col-img { width: 74px; padding-right: 0; }
td.col-img img, td.col-img .vuota {
    width: 56px;
    height: 72px;
    object-fit: cover;
    background: #0d0d0d;
    border: 1px solid #262626;
}
td.col-nome { font-weight: 700; color: #fff; font-size: 14px; }
td.col-nome small { display: block; color: #7d7d7d; font-weight: 600; font-size: 12px; margin-top: 2px; }
td.col-azioni { text-align: right; white-space: nowrap; }
td.col-azioni .btn { margin-left: 8px; }

.tag {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border: 1px solid #2e2820;
    color: #987d5f;
    background: #17140f;
}
.tag-spenta { color: #7d7d7d; border-color: #2e2e2e; background: #1a1a1a; }

/* Etichetta cliccabile: mostra/nascondi la bottiglia senza aprire la scheda */
.tag-interruttore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    line-height: 1;
    transition: border-color .3s ease, color .3s ease, background-color .3s ease;
}
.tag-interruttore:hover { border-color: #987d5f; color: #fff; background: #241f17; }

.tag-pallino {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #987d5f;
    flex: 0 0 auto;
}
.tag-spenta .tag-pallino { background: #5f5f5f; }

.vuoto { padding: 70px 24px; text-align: center; color: #6f6f6f; }
.vuoto p { margin: 0 0 22px; }

/* ------------------------------------------------------------ paginazione */

.paginazione {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: 34px;
}
.paginazione a, .paginazione span {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    letter-spacing: 0.06em;
    min-width: 40px;
    text-align: center;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    color: #8b8b8b;
}
.paginazione a:hover { border-color: #987d5f; color: #987d5f; }
.paginazione .corrente { border-color: #987d5f; background: #987d5f; color: #111; font-weight: 700; }
.paginazione .stacco { border: none; color: #4f4f4f; min-width: auto; padding: 10px 2px; }

/* ------------------------------------------------------------ login */

.login-schermo {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-box { width: 100%; max-width: 390px; }
.login-box h1 { font-size: 30px; margin-bottom: 4px; }
.login-box .occhiello { margin-bottom: 34px; }
.login-box .btn { width: 100%; text-align: center; margin-top: 12px; padding: 15px 20px; }
.login-torna { text-align: center; margin-top: 30px; font-size: 12px; }
.login-torna a { color: #5f5f5f; }
.login-torna a:hover { color: #987d5f; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
    .topbar { padding: 0 18px; gap: 14px; }
    .topbar-nav a { padding: 16px 10px; }
    .wrap { padding: 28px 18px 70px; }
    h1 { font-size: 26px; }
}

@media (max-width: 640px) {
    .topbar-brand { padding: 16px 0; font-size: 13px; }
    .contatore { padding: 5px 13px; }
    .contatore-numero { font-size: 21px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .form-azioni .btn { flex: 1 1 100%; text-align: center; }
}
