/* =============================================================
   ServiceDesk Aziendale — style.css
   Stile frontend + base comune
   ============================================================= */

:root {
  --sd-primary:      #1a3c6e;
  --sd-primary-light:#2a5298;
  --sd-accent:       #0d6efd;
  --sd-sidebar-w:    250px;
  --sd-topbar-h:     56px;
}

/* ---- Reset / Base ---- */
body { font-size: .9rem; background: #f0f2f5; color: #333; }
a    { color: var(--sd-accent); }

/* ---- Navbar frontend ---- */
.sd-navbar {
  background: linear-gradient(135deg, var(--sd-primary) 0%, var(--sd-primary-light) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.sd-navbar .nav-link         { color: rgba(255,255,255,.85); transition: color .15s; }
.sd-navbar .nav-link:hover,
.sd-navbar .nav-link.active  { color: #fff; }

/* ---- Avatar piccolo ---- */
.sd-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff; font-weight: 700; font-size: .75rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---- Cards ---- */
.card { border: none; box-shadow: 0 1px 6px rgba(0,0,0,.08); border-radius: 10px; }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 600; }

/* ---- Stat cards ---- */
.stat-card { border-radius: 12px; border: none; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
a > .stat-card { cursor: pointer; }
a:hover > .stat-card { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.stat-card .stat-icon {
  font-size: 2.2rem; opacity: .25;
  position: absolute; right: 12px; top: 12px;
}
.stat-card.primary  { background: linear-gradient(135deg,#1a3c6e,#2a5298); color:#fff; }
.stat-card.success  { background: linear-gradient(135deg,#155724,#28a745); color:#fff; }
.stat-card.warning  { background: linear-gradient(135deg,#856404,#ffc107); color:#fff; }
.stat-card.danger   { background: linear-gradient(135deg,#7b1d1d,#dc3545); color:#fff; }
.stat-card.info     { background: linear-gradient(135deg,#0c5460,#17a2b8); color:#fff; }
.stat-card.secondary{ background: linear-gradient(135deg,#343a40,#6c757d); color:#fff; }

/* ---- Badges priorità custom ---- */
.badge.bg-orange { background-color: #fd7e14 !important; color:#fff; }
.badge.bg-dark   { background-color: #343a40 !important; }

/* ---- Tabelle ---- */
.table { font-size: .875rem; }
.table th { font-weight: 600; white-space: nowrap; color: #555; }
.table tbody tr:hover { background-color: rgba(13,110,253,.04); }

/* ---- Form ---- */
.form-label { font-weight: 500; margin-bottom: .25rem; }
.form-control:focus, .form-select:focus { border-color: var(--sd-accent); box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }

/* ---- Ticket list item ---- */
.ticket-item {
  background: #fff; border-radius: 8px; padding: 1rem 1.25rem;
  margin-bottom: .6rem; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: box-shadow .15s, transform .1s;
  border-left: 4px solid transparent;
}
.ticket-item:hover       { box-shadow: 0 3px 10px rgba(0,0,0,.1); transform: translateY(-1px); }
.ticket-item.prio-urgent { border-left-color: #dc3545; }
.ticket-item.prio-high   { border-left-color: #fd7e14; }
.ticket-item.prio-medium { border-left-color: #ffc107; }
.ticket-item.prio-low    { border-left-color: #198754; }
.ticket-item.sla-breach  { background: #fff8f8; }

/* ---- Timeline storico ---- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content:''; position:absolute; left:10px; top:0; bottom:0; width:2px; background:#e9ecef; }
.timeline-item     { position: relative; margin-bottom: 1.2rem; }
.timeline-item::before {
  content:''; position:absolute; left:-24px; top:4px;
  width:12px; height:12px; border-radius:50%;
  background:var(--sd-accent); border:2px solid #fff;
  box-shadow: 0 0 0 2px var(--sd-accent);
}
.timeline-item.internal::before { background:#ffc107; box-shadow: 0 0 0 2px #ffc107; }
.timeline-body { background:#f8f9fa; border-radius:8px; padding:.75rem 1rem; font-size:.875rem; }
.timeline-body.internal { background:#fff8e1; border-left:3px solid #ffc107; }

/* ---- Comment box ---- */
.comment-public   { background:#fff; border:1px solid #e0e7ff; border-radius:8px; padding:1rem; }
.comment-internal { background:#fff8e1; border:1px solid #ffe082; border-radius:8px; padding:1rem; }
.comment-meta     { font-size:.8rem; color:#6c757d; margin-bottom:.4rem; }

/* ---- SLA indicator ---- */
.sla-ok      { color: #198754; }
.sla-warning { color: #ffc107; }
.sla-breach  { color: #dc3545; font-weight: 600; }

/* ---- Login page ---- */
.login-wrapper { min-height: 100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#1a3c6e 0%,#2a5298 100%); }
.login-card    { width:100%; max-width:420px; border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,.3); }
.login-logo {
  max-width: 220px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem auto;
}
.login-logo-icon { font-size:3rem; color: var(--sd-accent); }

/* ---- Logo classes (admin / frontend) ---- */
.admin-logo {
  max-width: 180px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(255,255,255,.95);
  padding: 6px 10px;
  border-radius: 6px;
}
.frontend-logo {
  max-width: 160px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---- Print ---- */
@media print {
  .sd-navbar, .sd-sidebar, .sd-topbar, nav, footer, .btn, .no-print { display:none !important; }
  body  { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stat-card .stat-icon { display: none; }
}
