/* assets/css/gowork.css */

/* =========================
   THEME VARS
========================= */
:root{
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;

  --dark: #2b3d7f;
  --accent: #51b4df;      /* arancio */
  --accentText: #1a1a1a;

  --border: #e5e7eb;
  --dangerBg: #fee2e2;
  --dangerText: #991b1b;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.06);

  /* Topbar */
  --gw-topbar-bg:#1a1a1a;
  --gw-topbar-border:rgba(255,255,255,.08);
  --gw-text:#e5e7eb;
  --gw-muted:#cbd5e1;

  --gw-nav-bg: rgba(255,255,255,.04);
  --gw-nav-border: rgba(255,255,255,.10);
  --gw-nav-hover: rgba(255,255,255,.06);
  --gw-nav-active: rgba(255,255,255,.10);
}

/* =========================
   GLOBAL
========================= */
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a{color:inherit; text-decoration:none;}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

/* =========================
   BUTTONS
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:0;
  border-radius:10px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
  line-height:1;
}
.btn-primary{background: var(--accent); color: var(--accentText);}
.btn-dark{background: var(--dark); color:#fff;}
.btn-block{width:100%;}
.btn-danger{
  background:#dc2626 !important;
  border-color:#dc2626 !important;
  color:#fff !important;
}
.btn-danger:hover{
  background:#b91c1c !important;
  border-color:#b91c1c !important;
  color:#fff !important;
}

/* =========================
   CARD + TYPO
========================= */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}
.title{font-size:16px; font-weight:800; margin:0 0 6px;}
.muted{color: var(--muted); font-size:13px;}

/* =========================
   ALERTS
========================= */
.alert{
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  margin-bottom:12px;
}
.alert-danger{background: var(--dangerBg); color: var(--dangerText);}
.alert-success{background:#dcfce7; color:#14532d;}

/* =========================
   FORMS
========================= */
.form-row{margin-bottom:12px;}
label{display:block; font-size:13px; margin-bottom:6px; color:#374151;}
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:14px;
  background:#fff;
}
textarea{min-height: 90px; resize: vertical;}

/* Password field helper */
.password-field{ position: relative; }
.password-field input{ padding-right: 40px; }
.toggle-password{
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.6;
}
.toggle-password:hover{ opacity: 1; }

/* =========================
   GRID
========================= */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.col-12{grid-column: span 12;}
.col-6{grid-column: span 6;}
.col-5{grid-column: span 5;}
.col-4{grid-column: span 4;}
.col-3{grid-column: span 3;}
.col-2{grid-column: span 2;}

@media (max-width: 900px){
  .col-2,.col-3,.col-4,.col-5,.col-6{grid-column: span 12;}
}

/* =========================
   LOGIN
========================= */
.login-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.login-card{
  width:100%;
  max-width:420px;
  overflow:hidden;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  background:#fff;
}
.login-head{
  text-align: center;
  padding:18px 20px;
  background: var(--dark);
  color:#fff;
}
.login-logo{
  max-width: 180px;
  width: 100%;
  height: auto;
  display: inline-block;
}
.login-subtitle{ font-size: 12px; opacity: 0.85; margin-top: 6px; }
.login-foot{ padding: 15px; text-align: center; font-size: 0.75rem; color: #777; }
.login-foot a{ color: inherit; text-decoration: none; font-weight: 500; }
.login-foot a:hover{ text-decoration: underline; }

/* =========================
   LAYOUT CON SIDEBAR
========================= */
.gw-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.gw-side{
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--gw-topbar-bg);
  border-right: 1px solid var(--gw-topbar-border);
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gw-side__brand{
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--gw-topbar-border);
}
.gw-side__brandlink{
  color: #fff;
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 16px;
}
.gw-side__logo{
  max-width: 160px;
  width: 100%;
  height: auto;
  display:block;
}

.gw-side__title{
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 10px 6px 8px;
}

.gw-side__item{
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  color: rgba(255,255,255,.85);
  font-weight: 800;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.06);
  background: transparent;
  margin: 6px 2px;
}
.gw-side__item:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: #fff;
}
.gw-side__item.is-active{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
  border-left: 4px solid var(--accent);
  padding-left: 8px;
  color: #fff;
}
.gw-side__item.disabled{
  opacity: .45;
  pointer-events: none;
}

.gw-side__footer{
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--gw-topbar-border);
  display: grid;
  gap: 10px;
}
.gw-side__userlabel{
  color: var(--gw-muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gw-content{
  background: var(--bg);
}
.gw-content__top{
  padding: 12px 18px 0;
}

/* MOBILE: overlay sidebar */
.gw-side-toggle{
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
}

@media (max-width: 900px){
  .gw-layout{ grid-template-columns: 1fr; }

  .gw-side{
    position: fixed;
    left: -280px;
    width: 260px;
    transition: left .18s ease;
    z-index: 2000;
  }

  body.gw-side-open .gw-side{ left: 0; }

  .gw-side-toggle{
    display: inline-flex;
    align-items:center;
    gap:8px;
  }
}

/* =========================
   WIDE LAYOUT (full width)
========================= */
body.gw-wide .container{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px;
}

.gw-page{
  padding: 14px 18px 18px;
}

@media (max-width: 900px){
  body.gw-wide .container{ padding: 14px; }
  .gw-page{ padding: 12px 14px 14px; }
}

/* =========================
   TOPBAR 2 (globale)
========================= */
.gw-topbar2{
  position: sticky;
  top: 0;
  z-index: 1500;

  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  gap: 12px;

  padding: 10px 14px;
  background: #009bde;
  border-bottom: 1px solid var(--gw-topbar-border);
}

.gw-topbar2__left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.gw-topbar2__title{
  color:#fff;
  font-weight:900;
  letter-spacing:.3px;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.gw-topbar2__center{
  min-width:0;
  display:flex;
  justify-content:center;
}

.gw-topbar2__right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}

.gw-topbar2__user{
  color: rgba(255,255,255,.85);
  font-weight:800;
  font-size:12px;
  max-width: 220px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.gw-topbar2__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.gw-topbar2__btn:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
}
.gw-topbar2__btn--danger{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
/* Tabs in topbar (CLASSIC MENU) */
.gw-topbar-tabs{
  display:flex;
  align-items:center;
  gap:0;                 /* niente spazi “a pillola” */
  flex-wrap: wrap;
  justify-content:center;
}

/* link base */
.gw-topbar-tab{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: rgba(255,255,255,.82);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

/* divisore verticale tra le voci */
.gw-topbar-tab:not(:last-child)::after{
  content:"";
  display:block;
  width:1px;
  height:16px;
  background: rgba(255,255,255,.18);
  margin-left: 10px;
}

/* hover */
.gw-topbar-tab:hover{
  color:#fff;
  text-decoration: none;
}

/* stato attivo: più chiaro e “marcato” */
.gw-topbar-tab.is-active{
  color:#fff;
  font-weight: 900;
}

/* underline/marker per attivo (molto leggibile) */
.gw-topbar-tab.is-active::before{
  content:"";
  position:absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 2px;
  background: rgba(255,255,255,.80);
  border-radius: 2px;
}

/* focus accessibilità */
.gw-topbar-tab:focus-visible{
  outline: 2px solid rgba(255,255,255,.55);
  outline-offset: 3px;
}

/* Compact: meno padding e marker più vicino */
body.gw-compact .gw-topbar-tab{
  padding: 5px 9px;
  font-size: 11px;
}
body.gw-compact .gw-topbar-tab.is-active::before{
  bottom: -5px;
}


/* =========================
   Sidebar collapse (desktop) - FIX
   (no display:none)
========================= */
body.gw-side-collapsed .gw-layout{
  grid-template-columns: 0 1fr;
}

/* comprimo sidebar senza rimuoverla dal flow */
body.gw-side-collapsed .gw-side{
  width: 0 !important;
  padding: 0 !important;
  border-right: 0 !important;
  overflow: hidden !important;
}

/* nascondo tutto il contenuto interno */
body.gw-side-collapsed .gw-side *{
  display: none !important;
}

/* topbar: tolgo le colonne “fisse” quando sidebar è chiusa */
body.gw-side-collapsed .gw-topbar2{
  grid-template-columns: auto 1fr auto;
}
body.gw-side-collapsed .gw-topbar2__center{
  justify-content: center;
}

/* =========================
   TICKETS / GENERIC PAGE HEAD
========================= */
.gw-pagehead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.gw-filters .grid{align-items:end;}

.gw-tablewrap{overflow:auto;}
.gw-table{
  width:100%;
  border-collapse: collapse;
}
.gw-table th, .gw-table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align:left;
}
.gw-table thead th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: rgba(0,0,0,.02);
}

/* Badge base */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.06);
}
.badge-stato-aperto{ background:#e0f2fe; }
.badge-stato-in_lavorazione{ background:#fef9c3; }
.badge-stato-in_attesa{ background:#ede9fe; }
.badge-stato-chiuso{ background:#e5e7eb; }
.badge-prio-bassa{ background:#e5e7eb; }
.badge-prio-media{ background:#dbeafe; }
.badge-prio-alta{ background:#fee2e2; }
.badge-prio-critica{ background:#fecaca; border-color: rgba(0,0,0,.12); }
.badge-role{ background: rgba(0,0,0,.06); }

.gw-ticket-meta{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
}
@media (max-width: 900px){
  .gw-ticket-meta{ grid-template-columns: 1fr; }
}

.gw-ticket-desc{
  background: rgba(0,0,0,.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.gw-thread{ display:grid; gap:10px; }
.gw-msg{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background:#fff;
}
.gw-msg.is-mine{
  background: rgba(245, 158, 11, .06);
  border-color: rgba(245, 158, 11, .25);
}
.gw-msg__head{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.gw-msg__author{ font-weight: 900; }
.gw-msg__time{ color: var(--muted); font-size: 12px; margin-left:auto; }
.gw-msg__body{ font-size: 14px; }

.gw-attach{ margin-top:10px; display:grid; gap:10px; }
.gw-attach__item{
  padding:10px;
  border-radius:12px;
  border:1px dashed var(--border);
  background: rgba(0,0,0,.02);
}
.gw-attach__item a{ font-weight:900; text-decoration: underline; }

.gw-adminbar{
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.02);
}

/* Active Filters */
.gw-activefilters{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  margin: 12px 0;
}
.gw-activefilters__label{
  font-weight:900;
  font-size:13px;
  color: var(--muted);
  white-space:nowrap;
}
.gw-activefilters__chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.gw-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(245,158,11,.10);
  border:1px solid rgba(245,158,11,.25);
  font-size:12px;
  font-weight:800;
}

/* =========================
   COMPACT / DENSE UI
   Attivo quando <body class="gw-compact">
========================= */
body.gw-compact{
  font-size: 13px;
}

body.gw-compact .title{ font-size: 16px; }
body.gw-compact .muted{ font-size: 12px; }

body.gw-compact label{
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

body.gw-compact .btn{
  padding: 6px 9px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 11px;
}

body.gw-compact input,
body.gw-compact select,
body.gw-compact textarea{
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
}

body.gw-compact .card{ padding: 14px; }

body.gw-compact .alert{
  padding: 10px 12px;
  font-size: 12.5px;
}

body.gw-compact .table th,
body.gw-compact .table td{
  padding: 5px 6px;
  font-size: 11px;
}
body.gw-compact .table th{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

body.gw-compact .gw-table th,
body.gw-compact .gw-table td{
  padding: 7px 8px;
}
body.gw-compact .gw-table thead th{
  font-size: 10px;
  letter-spacing: .04em;
}

body.gw-compact .badge{
  padding: 4px 8px;
  font-size: 11px;
}

body.gw-compact .gw-side__item{
  padding: 8px 10px;
  font-size: 12px;
}
body.gw-compact .gw-side__brandlink{ font-size: 15px; }

body.gw-compact .gw-topbar-tab{
  padding: 6px 9px;
  font-size: 11px;
}

/* =========================
   MAGAZZINO-LIKE COMPACT UI
   (riusabile su tutte le pagine)
========================= */

/* Pulsanti compatti */
.btn-mini{
  padding: 8px 8px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
}

/* Filtri 12 colonne come magazzino */
.filters{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:10px;
  align-items:end;
}
.filters .col-3{ grid-column: span 3; }
.filters .col-4{ grid-column: span 4; }
.filters .col-2{ grid-column: span 2; }
.filters .col-12{ grid-column: span 12; }
@media (max-width: 900px){
  .filters .col-3, .filters .col-4, .filters .col-2{ grid-column: span 12; }
}
.filters label{ font-size: 12px; font-weight: 800; }
.filters input, .filters select, .filters textarea{ font-size: 12px; padding: 7px 9px; }

/* Tabella compatta stile MySQL */
.table-wrap{ overflow:auto; margin-top: 10px; }
.table-compact{
  width:100%;
  border-collapse: collapse;
  min-width: 1080px;
  font-size: 11px;
}
.table-compact th, .table-compact td{
  border-bottom: 1px solid var(--border);
  padding: 5px 6px;
  text-align:left;
  vertical-align: middle;
  white-space: nowrap;
}
.table-compact th{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing:.03em;
  color: var(--muted);
}

/* Separatore */
.hr{ height:1px; background: var(--border); margin: 12px 0; }

/* Badge “pill” */
.pill{
  display:inline-flex;
  padding:3px 7px;
  border-radius:999px;
  font-weight:900;
  font-size:10px;
}
.pill-ok{ background: rgba(16,185,129,.12); color: #065f46; }
.pill-off{ background: rgba(239,68,68,.12); color: #7f1d1d; }
.pill-warn{ background: rgba(245,158,11,.14); color: #7c2d12; }

.gw-chip-mini{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
  font-size:10.5px;
  font-weight:800;
}
/* =========================
   GLOBAL TYPOGRAPHY RULES
   GARDASCAVI
========================= */

/* Base text */
html {
  font-size: 12px; /* riferimento globale */
}

body {
  font-size: 12px;
  line-height: 1.45;
}

/* Testi comuni */
p,
span,
label,
input,
select,
textarea,
button,
td,
th,
li,
.small,
.muted {
  font-size: 12px;
}

/* Tabelle */
table {
  font-size: 12px;
}
.table-compact td,
.table-compact th {
  font-size: 11.5px;
}

/* Badge / pill / status */
.badge,
.pill,
.tag {
  font-size: 11px;
}

/* Neutralizza utility Bootstrap */
.fs-1, .fs-2, .fs-3, .fs-4, .fs-5, .fs-6 {
  font-size: 12px !important;
}

/* Eccezione solo per titoli veri */
h1.fs-1,
h1.fs-2 {
  font-size: 16px !important;
}

.modal,
.dropdown-menu,
.form-control,
.form-select {
  font-size: 12px;
}

.modal-title {
  font-size: 14px;
}

.gw-compact-hard * {
  font-size: 12px !important;
}

.gw-compact-hard h1 {
  font-size: 16px !important;
}
