@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --cp-navy: #071a38;
  --cp-blue: #1655b8;
  --cp-gold: #c99118;
  --cp-bg: #f7f9fc;
  --cp-line: #e5eaf1;
  --cp-muted: #667085;
  --cp-white: #ffffff;
  --cp-shadow: 0 14px 34px rgba(18,36,64,.07);
}

* { box-sizing: border-box; }

.cp-body,
.cp-login-body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--cp-bg);
  color: var(--cp-navy);
}

.cp-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.cp-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px 15px;
  background: #fff;
  border-right: 1px solid var(--cp-line);
}

.cp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 0 7px 17px;
  border-bottom: 1px solid var(--cp-line);
  text-decoration: none;
  color: var(--cp-navy);
}

.cp-brand img {
  width: 78px;
  height: 50px;
  object-fit: contain;
}

.cp-brand strong,
.cp-brand span {
  display: block;
}

.cp-brand strong { font-size: 13px; }
.cp-brand span {
  margin-top: 3px;
  color: var(--cp-gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.cp-nav {
  display: grid;
  gap: 5px;
  margin-top: 20px;
}

.cp-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: #12213c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cp-nav a span {
  width: 20px;
  text-align: center;
  color: var(--cp-gold);
}

.cp-nav a:hover,
.cp-nav a.active {
  background: #fbf4e7;
  color: var(--cp-gold);
}

.cp-sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--cp-line);
}

.cp-sidebar-footer a {
  color: var(--cp-muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.cp-main {
  min-width: 0;
  padding: 34px 36px 48px;
}

.cp-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.cp-kicker {
  margin: 0 0 7px;
  color: var(--cp-gold);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 10px;
  font-weight: 800;
}

.cp-topbar h1,
.cp-login-card h2 {
  margin: 0;
  letter-spacing: -.04em;
}

.cp-topbar h1 { font-size: 31px; }
.cp-muted { color: var(--cp-muted); }

.cp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.cp-button-primary {
  background: var(--cp-gold);
  color: #071827;
}

.cp-button-secondary {
  background: #eef2f7;
  color: var(--cp-navy);
}

.cp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 22px;
}

.cp-kpi {
  padding: 20px;
  border: 1px solid var(--cp-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--cp-shadow);
}

.cp-kpi span {
  display: block;
  color: var(--cp-muted);
  font-size: 12px;
  font-weight: 700;
}

.cp-kpi strong {
  display: block;
  margin-top: 11px;
  font-size: 28px;
}

.cp-panel {
  padding: 24px;
  border: 1px solid var(--cp-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--cp-shadow);
}

.cp-panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.cp-panel-header h2 { margin: 0; font-size: 20px; }
.cp-panel-header a {
  color: var(--cp-gold);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.cp-table-wrap { overflow-x: auto; }

.cp-table {
  width: 100%;
  border-collapse: collapse;
}

.cp-table th,
.cp-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--cp-line);
  text-align: left;
  font-size: 12px;
}

.cp-table th {
  color: #344054;
  background: #fafbfc;
}

.cp-ticket-link {
  color: var(--cp-blue);
  font-weight: 800;
  text-decoration: none;
}

.cp-status,
.cp-status-large {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--cp-blue);
  font-size: 10px;
  font-weight: 800;
}

.cp-status-large {
  padding: 8px 13px;
  font-size: 11px;
}

.cp-empty-row {
  padding: 28px !important;
  text-align: center !important;
  color: var(--cp-muted);
}

.cp-form-panel {
  max-width: 900px;
}

.cp-narrow {
  max-width: 650px;
}

.cp-form {
  display: grid;
  gap: 16px;
}

.cp-form-grid {
  grid-template-columns: 1fr 1fr;
}

.cp-field-full {
  grid-column: 1 / -1;
}

.cp-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.cp-form input,
.cp-form select,
.cp-form textarea {
  width: 100%;
  border: 1px solid var(--cp-line);
  border-radius: 10px;
  padding: 12px 13px;
  background: #fff;
  color: var(--cp-navy);
  font: inherit;
  outline: none;
}

.cp-form input:focus,
.cp-form select:focus,
.cp-form textarea:focus {
  border-color: #c9a646;
  box-shadow: 0 0 0 3px rgba(201,145,24,.10);
}

.cp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cp-alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #f2f4f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.cp-alert-error {
  background: #fff1f2;
  color: #b42318;
}

.cp-alert-success {
  background: #ecfdf3;
  color: #067647;
}

.cp-conversation {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.cp-message {
  max-width: 78%;
  padding: 16px 18px;
  border: 1px solid var(--cp-line);
  border-radius: 14px;
  background: #f8fafc;
}

.cp-message.admin {
  margin-left: auto;
  background: #eef4ff;
}

.cp-message header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.cp-message time {
  color: var(--cp-muted);
  font-size: 10px;
}

.cp-message p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.cp-reply-form {
  padding-top: 20px;
  border-top: 1px solid var(--cp-line);
}

.cp-login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .85fr) 1.15fr;
}

.cp-login-brand-panel {
  display: flex;
  flex-direction: column;
  padding: 42px;
  background: var(--cp-navy);
  color: #fff;
}

.cp-login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.cp-login-brand img {
  width: 94px;
  height: 60px;
  object-fit: contain;
}

.cp-login-brand strong,
.cp-login-brand span {
  display: block;
}

.cp-login-brand strong { font-size: 14px; }
.cp-login-brand span {
  margin-top: 4px;
  color: #e5bc55;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.cp-login-copy {
  margin: auto 0;
  max-width: 500px;
}

.cp-login-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1.02;
  letter-spacing: -.05em;
}

.cp-login-copy p:not(.cp-kicker) {
  color: rgba(255,255,255,.68);
  line-height: 1.6;
}

.cp-back-link {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.cp-login-form-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  background: var(--cp-bg);
}

.cp-login-card {
  width: min(470px, 100%);
  padding: 36px;
  border: 1px solid var(--cp-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--cp-shadow);
}

.cp-login-card h2 {
  font-size: 30px;
}

.cp-help {
  margin-top: 18px;
  color: var(--cp-muted);
  font-size: 11px;
}

.cp-help a {
  color: var(--cp-blue);
  font-weight: 700;
}

@media (max-width: 900px) {
  .cp-shell { grid-template-columns: 1fr; }
  .cp-sidebar { min-height: auto; }
  .cp-nav { grid-template-columns: repeat(3, 1fr); }
  .cp-sidebar-footer { display: flex; }
  .cp-login-layout { grid-template-columns: 1fr; }
  .cp-login-brand-panel { min-height: 360px; }
}

@media (max-width: 680px) {
  .cp-main { padding: 24px 16px 36px; }
  .cp-topbar { flex-direction: column; }
  .cp-kpi-grid { grid-template-columns: 1fr 1fr; }
  .cp-form-grid { grid-template-columns: 1fr; }
  .cp-field-full { grid-column: auto; }
  .cp-message { max-width: 100%; }
  .cp-login-brand-panel,
  .cp-login-form-panel { padding: 24px; }
}

@media (max-width: 430px) {
  .cp-nav,
  .cp-kpi-grid { grid-template-columns: 1fr; }
}


/* AC Advisory Area Clienti - contrasto intestazioni v26 */
.cp-table thead {
  background: linear-gradient(180deg, #e8edf4 0%, #dfe6ef 100%);
}

.cp-table th {
  background: linear-gradient(180deg, #e8edf4 0%, #dfe6ef 100%) !important;
  color: #071a38 !important;
  border-bottom: 1px solid #c8d2df !important;
  font-weight: 800 !important;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.cp-table tbody tr:hover {
  background: #f8fafc;
}
