/* ============================================================
   TIPICO CORPORATE DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --cp:      #C41E3A;
  --cpd:     #A01730;
  /* Neutrals carry a faint warm bias toward --cp instead of true grey —
     R slightly ahead of G/B — so they read as chosen, not defaulted. */
  --cbg:     #FAF8F7;
  --ccard:   #FFFFFF;
  --ct1:     #201A1A;
  --ct2:     #6B615F;
  --cb:      #E3D9D7;
  --ctalt:   #F5EFEE;
  --cnl:     #F9F5F4;
  --cnd:     #362D2C;
  --csuc:    #10A760;
  --cwarn:   #FF9800;
  --cinfo:   #2196F3;

  --font-body:    'Work Sans', 'Segoe UI', Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  --radius: 6px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: var(--font-body);
  background: var(--cbg);
  color: var(--ct1);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- HEADINGS (display face) ---- */
h1, h2, h3, h4,
.t-h1, .t-h2, .t-h3,
.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.t-h1, h1 { font-size: 32px; font-weight: 700; }
.t-h2, h2 { font-size: 24px; }
.t-h3, h3 { font-size: 19px; }
/* Reserve uppercase+tracking for hero/brand-level titles, not every heading */
.t-display {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

/* ---- BUTTONS ---- */
.t-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 180ms var(--ease-out), transform 140ms var(--ease-out), box-shadow 180ms var(--ease-out);
  white-space: nowrap;
}
.t-btn-primary { background: var(--cp); color: white; }
.t-btn-primary:hover { background: var(--cpd); }
.t-btn-secondary { background: transparent; color: var(--ct1); border: 1px solid var(--cb); }
.t-btn-secondary:hover { background: var(--cbg); }
.t-btn-sm { padding: 6px 14px; font-size: 13px; }
.t-btn:active { transform: scale(0.97); }
.t-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ---- INPUTS ---- */
.t-input, .t-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--cb);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--ct1);
}
.t-input::placeholder { color: var(--ct2); }
.t-input:focus, .t-select:focus { outline: none; border: 2px solid var(--cp); box-shadow: 0 0 0 3px rgba(196,30,58,.1); }
.t-input, .t-select { transition: border-color 150ms ease-out, box-shadow 150ms ease-out; }

/* ---- CARD ---- */
.t-card {
  background: var(--ccard);
  border: 1px solid var(--cb);
  border-radius: var(--radius);
  padding: var(--sp-md) 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .t-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
}
.t-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ct1);
  margin-bottom: var(--sp-md);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cb);
}

/* ---- TABLE ---- */
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table thead th {
  background: var(--ctalt);
  color: var(--ct1);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cb);
  font-size: 13px;
  white-space: nowrap;
}
.t-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cb);
  color: var(--ct1);
}
.t-table tbody tr:nth-child(even) td { background: var(--ctalt); }
.t-table tbody tr { transition: background 120ms ease-out; }
.t-table tbody tr:hover td { background: #F0F0F0; }
.t-table tbody tr:last-child td { border-bottom: none; }

/* ---- BADGES ---- */
.t-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
}
.t-badge-red    { background: rgba(196,30,58,.1);  color: var(--cp); }
.t-badge-green  { background: rgba(16,167,96,.1);  color: var(--csuc); }
.t-badge-orange { background: rgba(255,152,0,.1);  color: var(--cwarn); }
.t-badge-blue   { background: rgba(33,150,243,.1); color: var(--cinfo); }
.t-badge-grey   { background: var(--ctalt); color: var(--ct2); }

/* ---- MODAL ---- */
.t-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,.45);
  justify-content: center;
  align-items: center;
}
.t-modal.active { display: flex; }
@keyframes t-fadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes t-slideUp { from { transform:scale(0.95) translateY(10px); opacity:0 } to { transform:scale(1) translateY(0); opacity:1 } }
.t-modal-box {
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--cb);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  animation: t-slideUp 220ms cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
}
.t-modal-header {
  background: var(--cp);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.t-modal-header h2 { font-size: 16px; font-weight: 700; }
.t-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.t-modal-close:hover { color: white; }
.t-modal-body { padding: 20px; }

/* ---- ALERTS ---- */
.t-alert {
  padding: var(--sp-md);
  border-radius: var(--radius);
  border-left: 3px solid;
  margin-bottom: var(--sp-md);
  font-size: 13px;
}
.t-alert-ok  { background:rgba(16,167,96,.08);  border-color:var(--csuc);  color:#0a6640; }
.t-alert-err { background:rgba(196,30,58,.08);  border-color:var(--cp);    color:var(--cpd); }

/* ---- FORM GROUP ---- */
.fg-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ct1);
  margin-bottom: 6px;
}

/* ---- DIVIDER ---- */
.t-divider { border: none; border-top: 1px solid var(--cb); margin: var(--sp-md) 0; }

/* ---- STAT CARD ---- */
.t-stat {
  background: var(--ccard);
  border: 1px solid var(--cb);
  border-radius: var(--radius);
  padding: 16px 20px;
  border-left: 4px solid var(--cb);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .t-stat:hover { box-shadow: 0 6px 20px rgba(0,0,0,.11); transform: translateY(-2px); }
}
.t-stat .stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.1; }
.t-stat .stat-lbl { font-size: 12px; color: var(--ct2); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.t-stat.s-red    { border-left-color: var(--cp);    background: linear-gradient(125deg, rgba(196,30,58,.04) 0%, #fff 55%); } .t-stat.s-red    .stat-num { color: var(--cp); }
.t-stat.s-green  { border-left-color: var(--csuc);  background: linear-gradient(125deg, rgba(16,167,96,.04) 0%, #fff 55%); } .t-stat.s-green  .stat-num { color: var(--csuc); }
.t-stat.s-orange { border-left-color: var(--cwarn); background: linear-gradient(125deg, rgba(255,152,0,.04) 0%, #fff 55%); } .t-stat.s-orange .stat-num { color: var(--cwarn); }
.t-stat.s-blue   { border-left-color: var(--cinfo); background: linear-gradient(125deg, rgba(33,150,243,.04) 0%, #fff 55%); } .t-stat.s-blue   .stat-num { color: var(--cinfo); }
.t-stat.s-grey   { border-left-color: var(--ct2);   background: linear-gradient(125deg, rgba(102,102,102,.04) 0%, #fff 55%); } .t-stat.s-grey   .stat-num { color: var(--ct1); }

/* ---- EMPTY STATE ---- */
.t-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ct2);
  font-size: 14px;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cbg); }
::-webkit-scrollbar-thumb { background: var(--cb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BDBDBD; }
