/* Download Area - stile (i colori del marchio arrivano dalle variabili impostate nel pannello) */
:root { --c-primary: #0093d0; --c-dark: #000000; --c-bg: #f8f9fa; --c-text: #1e293b; --c-muted: #94a3b8; --c-border: #e2e8f0; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--c-bg) center top / cover no-repeat fixed;
  color: var(--c-text); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--c-primary); }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic-xl { width: 48px; height: 48px; }
.muted { color: #64748b; }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.pre { white-space: pre-line; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.inline { display: inline; margin: 0; }

/* intestazione */
.site-header { background: #fff; border-bottom: 1px solid var(--c-border); }
.header-inner { display: flex; align-items: stretch; gap: 1rem; min-height: 76px; }
.logo { display: flex; align-items: center; padding: .25rem 0; }
.logo img { max-height: 70px; max-width: 220px; width: auto; display: block; }
.toolbar { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 40px; height: 40px; padding: 0 .5rem;
  border: 0; background: none; color: var(--c-dark); border-radius: 4px; cursor: pointer; text-decoration: none; font: inherit; font-size: 13px; font-weight: 700; }
.tool:hover { background: #f1f5f9; color: var(--c-primary); }
.tool-danger:hover { color: #dc2626; }
.tool-login { color: var(--c-primary); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.brand-blocks { display: flex; align-self: stretch; }
.block-dark, .block-primary { display: flex; flex-direction: column; justify-content: center; color: #fff; padding: .75rem 2rem; }
.block-dark { background: var(--c-dark); min-width: 215px; }
.block-primary { background: var(--c-primary); min-width: 228px; }
.block-title { font-size: 14px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.block-sub { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-top: .2rem; }
.block-count { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.block-count .ic { width: 20px; height: 20px; }
.block-date { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .9; font-weight: 500; padding-left: 30px; }

/* contenuto */
.main { flex: 1; padding-top: 2.2rem; padding-bottom: 2rem; }
.card { background: #fff; border: 1px solid var(--c-border); border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.04); padding: 1.5rem; margin-bottom: 1.5rem; }
.card.narrow { max-width: 460px; margin: 1rem auto 2rem; }
.card.narrow-wide { max-width: 780px; margin: 0 auto 2rem; }
.table-card { padding: 0; overflow: visible; }
.h1 { font-size: 20px; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.h2 { font-size: 15px; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; color: #0f172a; text-transform: uppercase; letter-spacing: .06em; }
.h2 .ic, .h1 .ic { color: var(--c-primary); }
.empty { text-align: center; padding: 3rem 1rem; color: #64748b; }
.notice { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--c-border); border-left: 4px solid var(--c-primary);
  padding: .8rem 1rem; margin-bottom: 1rem; font-size: 14px; }
.notice .btn { margin-left: auto; }
.search { position: relative; margin-bottom: 1rem; }
.search .ic { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.search input { width: 100%; padding: .8rem 1rem .8rem 2.6rem; border: 1px solid var(--c-border); border-radius: 3px; font: inherit; background: #fff; }
.search input:focus { outline: 2px solid var(--c-primary); outline-offset: -1px; }

/* tabella file */
table.files { width: 100%; border-collapse: collapse; }
.files thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #475569; font-weight: 700;
  padding: 1.5rem 1.75rem; background: #f8fafc; border-bottom: 1px solid var(--c-border); }
.files td { padding: 1.5rem 1.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.files tr:last-child td { border-bottom: 0; }
.files tbody tr:hover { background: #fcfdfe; }
.files .c-type { width: 170px; white-space: nowrap; }
.files .c-size { width: 130px; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #475569; white-space: nowrap; }
.files .c-actions { width: 230px; text-align: center; }
.files th.c-actions { text-align: center; }
.files th.c-size { text-align: right; }
.fname { font-weight: 600; font-size: 15px; color: var(--c-text); overflow-wrap: anywhere; }
.fdate { font-size: 11px; color: var(--c-muted); margin-top: .15rem; }
.locked .fname { color: #64748b; }
.ft { width: 26px; height: 30px; vertical-align: middle; }
.ft-pdf { color: #de2c2c; } .ft-word { color: #2b579a; } .ft-excel { color: #217346; } .ft-powerpoint { color: #d24726; }
.ft-zip { color: #e6a23c; } .ft-image { color: #13a35a; } .ft-video { color: #8e44ad; } .ft-audio { color: #00a0e9; } .ft-generic { color: #718096; }
.badge { display: inline-block; margin-left: .55rem; padding: .15rem .55rem; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; background: #f1f5f9; border: 1px solid var(--c-border); border-radius: 3px; vertical-align: middle; }
.actions { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: 40px; height: 40px; border: 1px solid var(--c-border);
  border-radius: 4px; background: #fff; color: var(--c-dark); cursor: pointer; text-decoration: none; font: inherit; transition: border-color .15s, background .15s; padding: 0; }
.act:hover { border-color: var(--c-dark); background: #f8fafc; }
.act-view, .act-share, .act-login { color: var(--c-primary); }
.act-view:hover, .act-share:hover, .act-login:hover { border-color: var(--c-primary); background: #f0f9ff; }
.act-login { width: auto; padding: 0 .8rem; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.act-disabled { color: #cbd5e1; background: #f8fafc; cursor: not-allowed; }
.act-disabled:hover { border-color: var(--c-border); }
.act-danger { color: #dc2626; }
.act-danger:hover { border-color: #dc2626; background: #fef2f2; }
.dropdown { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 14rem; background: #fff; border: 1px solid var(--c-border);
  border-radius: 6px; box-shadow: 0 10px 25px rgba(15,23,42,.12); padding: .3rem 0; text-align: left; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .7rem 1rem; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; color: #334155; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: #f8fafc; color: var(--c-primary); }
.toast { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50; display: flex; align-items: center; gap: .5rem; background: #0f172a; color: #fff;
  padding: .75rem 1.1rem; border-radius: 6px; font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(1rem); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast .ic { color: #4ade80; }

/* piè di pagina */
.site-footer { text-align: center; color: #94a3b8; font-size: 12px; padding: 1rem 1rem 2.5rem; }
.site-footer a { color: var(--c-primary); text-decoration: none; }
.site-footer p { margin: .3rem 0; }
.footer-login a { color: #94a3b8; }

/* moduli, pulsanti, avvisi */
.form label, label.block { display: block; margin-bottom: .9rem; font-size: 13px; font-weight: 600; color: #334155; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=number], .form select, .form textarea,
.admin-table input[type=text], .admin-table select, .filters input, .filters select {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 4px; font: inherit; font-size: 14px; background: #fff; color: var(--c-text); }
.admin-table input[type=text], .admin-table select { margin-top: 0; font-size: 13px; padding: .4rem .55rem; min-width: 10rem; }
.form input:focus, .form select:focus, .form textarea:focus, .admin-table input:focus { outline: 2px solid var(--c-primary); outline-offset: -1px; border-color: transparent; }
.form input[type=color] { display: block; width: 100%; height: 42px; margin-top: .3rem; padding: 2px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; }
.form input[type=file] { display: block; margin-top: .4rem; font-size: 13px; max-width: 100%; }
label.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; margin-bottom: .7rem; cursor: pointer; font-size: 14px; }
label.check input { margin-top: .25rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border: 1px solid #cbd5e1; border-radius: 4px;
  background: #fff; color: #0f172a; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; letter-spacing: .02em; }
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { filter: brightness(.92); color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: 12px; }
.btn-block { width: 100%; padding: .8rem; }
.alert { padding: .8rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 14px; border: 1px solid; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0 0 1.5rem; font-size: 14px; }
.kv dt { color: #64748b; font-weight: 600; }
.kv dd { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.25rem; }
details { margin-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: .5rem; }

/* pannello */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.tab { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
  color: #334155; text-decoration: none; font-size: 13px; font-weight: 700; }
.tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.tab-right { margin-left: auto; }
.subtabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--c-border); margin-bottom: 1rem; }
.subtabs a { padding: .5rem 0; text-decoration: none; color: #64748b; font-weight: 700; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: var(--c-primary); border-color: var(--c-primary); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .5rem; }
.filters input[type=search] { flex: 1 1 14rem; width: auto; margin: 0; }
.filters label { display: flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600; }
.filters input[type=date] { width: auto; margin: 0; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: .6rem .6rem; border-bottom: 1px solid var(--c-border); background: #f8fafc; }
.admin-table td { padding: .6rem .6rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table.small td { font-size: 13px; }
.admin-table .num { text-align: right; }
.admin-table .ft { width: 20px; height: 24px; margin-right: .3rem; }
.admin-table .act { width: 34px; height: 34px; }
.edit-row td { background: #f8fafc; }
.upload-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.upload-form input[type=file] { flex: 1 1 18rem; padding: .7rem; border: 2px dashed var(--c-primary); border-radius: 4px; background: #f8fbff; font-size: 13px; }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-off { background: #fee2e2; color: #991b1b; }
.pager { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { padding: .3rem .65rem; border: 1px solid var(--c-border); border-radius: 4px; font-size: 13px; text-decoration: none; }
.pager .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.toplist { margin: 0; padding-left: 1.2rem; }
.toplist li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.mode-card { display: flex !important; flex-direction: column; gap: .3rem; border: 2px solid var(--c-border); border-radius: 6px; padding: .9rem 1rem; cursor: pointer; margin: 0 !important; }
.mode-card:has(input:checked) { border-color: var(--c-primary); background: #f0f9ff; }
.mode-card input { align-self: flex-start; }
.mode-card strong { font-size: 15px; }
.brand-slot { margin-bottom: .9rem; }
.brand-slot .label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: .3rem; }
.brand-preview { display: flex; align-items: center; justify-content: center; height: 90px; border: 1px solid var(--c-border); border-radius: 4px;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; overflow: hidden; }
.brand-preview img { max-height: 80px; max-width: 90%; }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.chk { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.chk .ic { margin-top: 2px; }
.chk-ok .ic { color: #16a34a; } .chk-warn .ic { color: #d97706; } .chk-bad .ic { color: #dc2626; }
.chk-bad strong { color: #991b1b; }

/* tablet */
@media (min-width: 681px) and (max-width: 1100px) {
  .block-dark, .block-primary { padding: .75rem 1.2rem; min-width: 0; }
  .files thead th, .files td { padding: 1.2rem 1rem; }
}

/* telefono: tabella trasformata in schede */
@media (max-width: 680px) {
  .header-inner { flex-direction: column; align-items: center; gap: .5rem; padding: 1rem 1rem 0; }
  .toolbar { margin: 0; }
  .brand-blocks { flex-direction: column; align-self: stretch; width: auto; margin: 0 -1rem; }
  .block-dark, .block-primary { align-items: center; text-align: center; padding: 1rem; min-width: 0; }
  .block-date { padding-left: 0; }
  .main { padding-top: 1.25rem; }
  .table-card { background: transparent; border: 0; box-shadow: none; }
  table.files, .files tbody { display: block; }
  .files thead { display: none; }
  .files tbody tr { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .8rem; padding: 1.4rem 1rem; margin-bottom: 1rem;
    background: #fff; border: 1px solid var(--c-border); border-radius: 6px; box-shadow: 0 4px 6px -1px rgba(0,0,0,.05); }
  .files td { display: block; padding: 0; border: 0; width: 100% !important; text-align: center !important; }
  .actions { width: 100%; }
  .act { flex: 1; max-width: 5rem; height: 46px; }
  .act-login { max-width: none; }
  .dropdown { flex: 1; max-width: 5rem; }
  .dropdown .act { width: 100%; max-width: none; }
  .grid2, .grid3, .modes { grid-template-columns: 1fr; }
  .tab span { display: none; }
  .tab-right { margin-left: 0; }
  .card { padding: 1.1rem; }
  .table-card { padding: 0; }
  .kv { grid-template-columns: 1fr; }
}
