/* CSARR Facile Web - style pastel moderne */

:root{
  --bg: #f7f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --primary: #7c6ee6;      /* violet pastel */
  --primary2: #69d1c5;     /* menthe */
  --danger: #ef4444;
  --focus: rgba(124, 110, 230, 0.25);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 10% 0%, rgba(124,110,230,.14), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(105,209,197,.16), transparent 60%),
    var(--bg);
}

.page{ max-width: 1500px; margin: 0 auto; padding: 22px; }

.topbar{
  display:flex;
  align-items:flex-start;
  gap:16px;
  margin-bottom: 18px;
}

.brand{ display:flex; gap:14px; align-items:center; }

.header-right{
  margin-left: auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}

.logo{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: var(--shadow);
  display:grid;place-items:center;
  color:white;font-weight:800;
}
.title{ font-size: 20px; font-weight: 800; line-height: 1.1; }
.subtitle{ font-size: 13px; color: var(--muted); margin-top: 2px; }

.right-meta{
  margin-top:0;
  text-align:right;
  white-space:nowrap;
}
.sep{ opacity: .6; margin: 0 6px; }
.email-link{
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.email-link:hover{ opacity: .85; }

.badge{
  font-size:12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
}

.grid{
  display:block;
  width:100%;
}

@media (max-width: 1000px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  width:100%;
  padding: 18px;
}

.card h1{ font-size: 18px; margin:0 0 6px; }
.card h2{ font-size: 15px; margin:16px 0 6px; }
.muted{ color: var(--muted); font-size: 13px; }

.fields{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 900px){
  .fields{ grid-template-columns: 1fr; }
}

.field span{ display:block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: #334155; }
.field select{
  width:100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
  outline: none;
  font-size: 14px;
}
.field select:focus{ box-shadow: 0 0 0 4px var(--focus); border-color: rgba(124,110,230,.5); }
.hint{ display:block; margin-top: 6px; font-size: 12px; color: var(--muted); }

.actions{
  display:flex;
  gap:10px;
  margin-top: 14px;
}

.btn{
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  cursor:pointer;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{ box-shadow: 0 10px 26px rgba(15,23,42,.08); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
}
.btn.tiny{ padding: 7px 10px; border-radius: 12px; font-size: 12px; }

.sep{ border:0; border-top: 1px solid rgba(15,23,42,.08); margin: 16px 0; }

.alert{
  border: 1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.06);
  border-radius: 16px;
  padding: 12px 12px;
  margin: 12px 0 0;
}
.alert ul{ margin: 8px 0 0; padding-left: 18px; }
.alert li{ font-size: 13px; color: #7f1d1d; }

.tableWrap{
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

.table thead th{
  text-align:left;
  font-size: 12px;
  letter-spacing: .02em;
  color: #334155;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(248,250,252,.9);
  position: sticky; top: 0;
  backdrop-filter: blur(8px);
}

.table tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  vertical-align: top;
}

.table tbody tr:hover td{
  background: rgba(124,110,230,.04);
}

.cell-muted{ color: #334155; font-size: 13px; }
.cell-right{ text-align: right; }

.csarBadge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: #14532d;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
}
.csarBadge:empty{ display:none; }

.codeInput{
  width: 100%;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  outline: none;
  font-size: 16px;
}
.codeInput:focus{ box-shadow: 0 0 0 4px var(--focus); border-color: rgba(124,110,230,.5); }

.codeCell{ display:flex; flex-direction:column; gap: 6px; }
.codeExample{
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.1;
  opacity: .9;
}
.codeExample strong{ font-weight: 800; color: #334155; }

.footerActions{ margin-top: 12px; display:flex; justify-content:flex-end; }


.note{
  margin-top: 12px;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(105,209,197,.25);
  background: rgba(105,209,197,.08);
}

.footer{
  margin-top: 16px;
  padding: 10px 18px;
  display:flex;
  justify-content:center;
  gap: 18px;
  flex-wrap: wrap;
}


/* Mobile tweaks */
@media (max-width: 520px){
  .topbar{ flex-wrap: wrap; }
  .header-right{ align-items:flex-start; }
  .right-meta{ white-space: normal; }
}

@media (max-width: 520px){
  .btn{ min-height: 44px; }
  .btn.tiny{ min-height: 40px; font-size: 13px; padding: 8px 12px; }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-right {
    width: 100%;
  }

  .right-meta {
    word-break: break-word;
  }

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

  .fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card {
    padding: 14px;
  }

  .actions,
  .footerActions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .actions .btn,
  .footerActions .btn {
    width: 100%;
  }

  .tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 900px;
  }

  .codeInput,
  select,
  textarea {
    font-size: 16px;
  }

  .hub-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-tab {
    text-align: center;
  }
}