/* ===================== Palette (BMS jaune/noir — modifiable) ===================== */
:root {
    --bms-primary: #fcb900; /* Jaune principal */
    --bms-primary-600: #d6a000; /* Jaune foncé / hover */
    --bms-primary-50: #fff8e1; /* Jaune très clair */
    --bms-accent: #b71c1c; /* Rouge accent */
    --ink: #1b1b1b; /* Texte */
    --muted: #5f6368; /* Texte secondaire */
    --bg: #fff9e6; /* Fond app */
    --surface: #ffffff; /* Cartes */
    --border: #d6a000; /* Bordures */
    --radius: 10px;
    --fs: 13px;
    --row-h: 34px;
    --row-pad: 5px;
}

*{box-sizing:border-box}
html,body{height:100%;overflow-x:hidden}
body {
    margin: 0;
    background: #fff9e6;
    color: var(--ink);
    font-family: Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,sans-serif
}

/* ===================== NAV ===================== */
.bms-nav{
  position: sticky; top:0; z-index:1000;
  background: var(--bms-primary);
  color:#2b2100; box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.bms-nav .inner{
  margin:0 auto; padding:10px 16px;
  display:flex; align-items:center; gap:14px;
}
.nav-brand{display:flex; align-items:center; gap:10px; font-weight:700}
.nav-logo{
  width:28px; height:28px; border-radius:6px;
  background:radial-gradient(circle at 30% 30%, #fff 0 40%, rgba(255,255,255,.15) 41%), var(--bms-accent);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.08);
}
.nav-title{letter-spacing:.3px}
.nav-links{display:flex; gap:10px; margin-left:auto}
.nav-link{
  padding:8px 10px; border-radius:8px; color:#2b2100; text-decoration:none; font-weight:600;
  transition:background .15s ease, transform .05s ease;
}
.nav-link:hover{background:rgba(0,0,0,.06)}
.nav-link.active{background:#2b2100; color:#fff;}

.nav-burger{display:none; margin-left:auto; background:transparent; border:0; color:#2b2100; cursor:pointer}
.nav-burger svg{width:24px; height:24px; display:block}
@media (max-width:820px){
  .nav-links{display:none}
  .nav-burger{display:block}
}

/* Drawer */
.drawer{display:none; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:900}
.drawer .panel{
  position:absolute; top:0; right:0; width:min(86%,360px); height:100%;
  background:#fff; box-shadow:-6px 0 18px rgba(0,0,0,.18); padding:16px;
}
.drawer .link{display:block; padding:10px 8px; border-radius:8px; color:var(--ink); text-decoration:none}
.drawer .link:hover{background:#f3f6f8}

/* ===================== APP WRAPPER ===================== */
#tkapp{margin:18px auto; padding:0 16px}

/* Toolbar */
.tk-toolbar{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px}
.search{
  flex:1 1 260px; min-width:240px; height:36px; padding:0 12px;
  border:1px solid var(--border); border-radius:999px; background:#fff; color:var(--ink);
}
.tk-select,.tk-btn{
  height:36px; border:1px solid var(--border); border-radius:10px; background:#fff; font:inherit; color:var(--ink);
}
.tk-select{
  padding:0 36px 0 12px; appearance:none; cursor:pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232b2100' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 10px center/12px 12px,#fff;
}
.tk-btn{padding:0 12px; cursor:pointer}
.tk-btn.primary{
  background:var(--bms-primary); color:#2b2100; border-color:transparent; font-weight:700;
}
.tk-btn.primary:hover{filter:brightness(1.05)}

/* Card */
.tk-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:0 6px 18px rgba(0,0,0,.08);
}
.tk-card .hd{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px; border-bottom:1px solid var(--border);
}
.tk-card .hd h2{margin:0; font-size:16px; letter-spacing:.2px}
.tk-card .hd .badge{
  font-size:12px; border:1px solid var(--border); border-radius:999px; padding:3px 8px; background:#fff; color:var(--muted)
}
.tk-card .bd{padding:6px 8px}

/* Scroll */
.tk-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch}

/* Grid */
.tk-head,.tk-row{display:grid; align-items:center; column-gap:10px; font-size:var(--fs); min-width:1280px}
.tk-head,.tk-row{
  grid-template-columns:
    48px
    160px
    minmax(240px,1.2fr)
    minmax(140px,180px)
    minmax(160px,220px)
    minmax(120px,140px)
    minmax(130px,160px)
    minmax(100px,110px)
    minmax(110px,120px)
    minmax(120px,140px)
    minmax(120px,140px);
}

/* Head triable */
.tk-head{padding:6px 0; color:var(--muted); text-transform:uppercase; font-weight:700}
.tk-head .th{position:relative; cursor:pointer; user-select:none; white-space:nowrap; padding-right:14px}
.tk-head .nosort{cursor:default}
.tk-head .th.sort-asc::after,.tk-head .th.sort-desc::after{content:''; position:absolute; right:2px; top:50%; transform:translateY(-50%); border:5px solid transparent}
.tk-head .th.sort-asc::after{border-bottom-color:currentColor}
.tk-head .th.sort-desc::after{border-top-color:currentColor}

/* Rows */
.tk-row{
  min-height:var(--row-h); padding:var(--row-pad) 6px; border-bottom:1px solid var(--border);
  border-radius:8px; transition:background .12s ease;
}
.tk-row:hover{background:#fbfcfd}
.tk-cell{display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tk-row .tk-cell:nth-child(3){
  white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden
}

/* Badges */
.status{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid var(--border); border-radius:999px; padding:2px 8px; font-size:12px; background:#fff;
}
.st-new    { background:#f7eafb; color:#6b2c7a; border-color:#ebd6f3 }
.st-open   { background:#ffecef; color:#a0223a; border-color:#f1c8cf }
.st-pending{ background:#fff6e6; color:#7a6022; border-color:#f0ddb1 }
.st-solved { background:#eaf7f0; color:#0f6a3a; border-color:#bfe5ce }

.cat{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; padding:2px 8px; background:#fff; font-size:12px}
.pri{display:inline-flex; align-items:center; gap:8px; border:1px solid #f3e1a3; border-radius:999px; padding:2px 8px; background:#fffdf0; font-weight:700; font-size:12px}
.dot{width:8px; height:8px; border-radius:999px}
.p1 .dot{background:#bf0f0f}.p2 .dot{background:#e77f00}.p3 .dot{background:#b39b28}.p4 .dot{background:#7c8896}

.ico{width:16px; height:16px; display:inline-flex}
.ico svg{width:16px; height:16px; display:block}

/* Empty state */
.empty{display:none;color:var(--muted);padding:8px}

/* Responsive */
@media (max-width:1100px){
  .tk-head,.tk-row{min-width:980px}
  .tk-head .th:nth-child(5), .tk-row .tk-cell:nth-child(5),  /* Email */
  .tk-head .th:nth-child(6), .tk-row .tk-cell:nth-child(6){  /* Téléphone */
    display:none;
  }
}
@media (max-width:860px){
  .tk-head,.tk-row{min-width:820px}
  .tk-head .th:nth-child(10), .tk-row .tk-cell:nth-child(10){ /* Équipe */
    display:none;
  }
}

/* ===================== Modal ===================== */
.modal-backdrop{position:fixed; inset:0; background:rgba(0,0,0,.35); display:none; z-index:1000}
.modal{position:fixed; inset:0; display:none; z-index:1001; align-items:flex-start; justify-content:center; padding:40px 12px}
.modal .panel{width:min(680px,100%); background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:0 18px 40px rgba(0,0,0,.18)}
.modal .hd{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 14px; border-bottom:1px solid var(--border)}
.modal .bd{padding:14px}
.modal .ft{display:flex; justify-content:flex-end; gap:8px; padding:12px 14px; border-top:1px solid var(--border)}
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.form-grid .full{grid-column:1 / -1}
.fld{display:flex; flex-direction:column; gap:6px}
.fld label{font-size:12px; color:var(--muted)}
.fld input,.fld select,.fld textarea{
  height:38px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; font:inherit;
}
.fld textarea{min-height:96px; resize:vertical}
.btn{height:38px; border:1px solid var(--border); background:#fff; border-radius:10px; padding:0 12px; cursor:pointer}
.btn.primary{background:var(--bms-primary); border-color:transparent; color:#2b2100; font-weight:700}
.btn.ghost{background:#fff}
.m0{margin:0}



/* ===== Attachments / Dropzone ===== */
.attachments { display: grid; gap: 12px; }
.dropzone {
  position: relative; border: 1.5px dashed var(--border); border-radius: 12px;
  background: #fff; min-height: 84px; display: flex; align-items: center; justify-content: center; padding: 12px;
  outline: none;
}
.dropzone:focus { box-shadow: 0 0 0 3px rgba(252,185,0,.25); }
.dropzone.dragover { background: var(--bms-primary-50); border-color: var(--bms-primary); }
.dropzone .file-input {
  position:absolute; inset:0; opacity:0; cursor:pointer;
}
.dz-inner { display:flex; align-items:center; gap:12px; pointer-events:none; }
.dz-ico { font-size:20px }
.dz-text { color: var(--muted); font-size: 13px; }
.dz-text .link { color: #2b2100; font-weight: 700; text-decoration: underline; }
.dz-sub { font-size: 12px; color: var(--muted); }

.file-list { list-style:none; margin:8px 0 0; padding:0; display:grid; gap:6px; }
.file-item {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:1px solid var(--border); border-radius:10px; background:#fff; padding:6px 10px; font-size:12.5px;
}
.file-meta { display:flex; gap:10px; align-items:center; min-width:0; }
.file-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:52ch; }
.file-size { color: var(--muted); }
.file-remove { border:0; background:transparent; cursor:pointer; color:#a0223a; }

.rec { display:flex; align-items:center; gap:8px; }
.rec-status { font-size:12px; color: var(--muted); }
.rec-player { width:100%; margin-top:6px; }

.tk-row {
    cursor: pointer;
}

.tk-row:focus {
    outline: 2px solid #fcb900;
    outline-offset: 2px;
}


