/* Interface du support NXTEO : reprend l'apparence de WP Support Plus (thème Bootstrap 3) */
:root {
  --text: #333;
  --muted: #777;
  --border: #ddd;
  --bg: #fff;
  --bg-soft: #f8f8f8;
  --bg-head: #ddd;
  --primary: #1e73be;
  --info: #5bc0de;
  --danger: #d9534f;
  --success: #5cb85c;
  --radius: 4px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.42857 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1220px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* En-tête */
.site-header { padding: 20px 0 22px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo img { display: block; height: auto; max-width: 220px; width: 100%; }
.header-right { display: flex; align-items: center; gap: 22px; }
.support-title { white-space: nowrap; font-weight: 600; font-size: 17px; padding-bottom: 22px; border-bottom: 1px solid #222; margin-top: 22px; }
#lang-switch { border: 0; background: transparent; font: inherit; cursor: pointer; }

/* Barre de navigation */
.navbar { display: flex; flex-wrap: wrap; background: var(--bg-soft); border: 1px solid #e7e7e7; border-radius: var(--radius); margin-bottom: 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.navbar a { color: #555; padding: 15px 15px; display: block; }
.navbar a:hover { color: #333; text-decoration: none; background: #eee; }
.navbar a.active { background: #e7e7e7; color: #555; }
.navbar .spacer { flex: 1; }

/* Boutons et champs */
.btn { display: inline-block; padding: 6px 12px; font: inherit; font-size: 13px; line-height: 1.4; border: 1px solid #ccc; border-radius: var(--radius); background: #fff; color: #333; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #e6e6e6; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 1px 6px; font-size: 11px; }
.btn-primary { background: var(--primary); border-color: #1a65a6; color: #fff; }
.btn-primary:hover { background: #185f9e; }
.btn-info { background: var(--info); border-color: #46b8da; color: #fff; }
.btn-info:hover { background: #31b0d5; }
.btn-success { background: var(--success); border-color: #4cae4c; color: #fff; }
.btn-success:hover { background: #449d44; }
.btn-danger { background: var(--danger); border-color: #d43f3a; color: #fff; }
.btn-danger:hover { background: #c9302c; }
.btn-link { border-color: transparent; background: transparent; color: var(--primary); }
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 6px 10px; border: 1px solid #ccc; border-radius: var(--radius); background: #fff; color: var(--text);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
}
input:focus, select:focus, textarea:focus, .editor-area:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 6px rgba(102,175,233,.6); }
select[multiple] { min-height: 90px; }
label { font-weight: 700; display: block; margin-bottom: 5px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.form-group { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 3px; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }

/* Liste des tickets */
.list-layout { display: flex; gap: 30px; align-items: flex-start; }
.filter-panel { width: 270px; flex-shrink: 0; border-right: 1px solid #eee; padding-right: 15px; }
.filter-head { background: #ddd; border-radius: var(--radius); padding: 14px 10px; margin-bottom: 20px; }
.filter-head h3 { margin: 0 0 14px; font-weight: 400; font-size: 20px; }
.filter-panel .form-group label { font-size: 14px; }
.list-main { flex: 1; min-width: 0; }
.searchbar { display: flex; align-items: center; border: 1px solid #ccc; border-radius: var(--radius); margin-bottom: 20px; }
.searchbar span { padding: 0 12px; color: #555; }
.searchbar input { border: 0; box-shadow: none; padding: 8px 0; }
.searchbar button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: #555; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.count { color: #555; }
.table-wrap { overflow-x: auto; }
table.tickets { width: 100%; border-collapse: collapse; margin-top: 4px; }
table.tickets th { background: var(--bg-head); text-align: left; padding: 10px 8px; font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap; }
table.tickets th.nosort { cursor: default; }
table.tickets td { padding: 9px 8px; border-top: 1px solid #eee; vertical-align: middle; }
table.tickets tbody tr { cursor: pointer; }
table.tickets tbody tr:hover { background: #f5f5f5; }
table.tickets td.subject { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 2px; background: #ddd; color: #fff; font-size: 11px; font-weight: 700; margin-right: 5px; vertical-align: -4px; }
.pagination { display: flex; gap: 4px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pagination button { min-width: 34px; }
.pagination button.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* Fiche ticket */
.ticket-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.ticket-layout { display: flex; gap: 30px; align-items: flex-start; }
.ticket-main { flex: 1; min-width: 0; }
.ticket-side { width: 300px; flex-shrink: 0; }
.ticket-title { font-size: 18px; font-weight: 500; margin: 0 0 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reply-switch { margin-bottom: 16px; color: var(--muted); }
.reply-switch a { cursor: pointer; }
.reply-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 20px; background: #fafafa; }
.thread { border-top: 1px solid #eee; padding: 14px 0; }
.thread-head { display: flex; justify-content: space-between; gap: 10px; }
.thread-author { font-weight: 700; }
.thread-meta { color: var(--muted); font-size: 12px; }
.thread-body { margin-top: 10px; overflow: hidden; word-wrap: break-word; }
.thread-body.collapsed { max-height: 100px; }
.thread-body img { max-width: 100%; height: auto; }
.thread-body pre { white-space: pre-wrap; background: #f5f5f5; padding: 8px; border-radius: 3px; }
.thread-body table { border-collapse: collapse; max-width: 100%; }
.thread-body td, .thread-body th { border: 1px solid #ddd; padding: 3px 6px; }
.thread.note { background: #fcf8e3; border: 1px solid #faebcc; border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.thread.note .note-tag { color: #8a6d3b; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.thread.log { color: var(--muted); font-size: 12px; padding: 8px 0; font-style: italic; }
.more { font-size: 12px; cursor: pointer; }
.attachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.attachments a { font-size: 12px; background: #f0f0f0; border: 1px solid #ddd; border-radius: 3px; padding: 2px 8px; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid #ccc; border-radius: var(--radius); box-shadow: 0 6px 12px rgba(0,0,0,.175); z-index: 20; min-width: 230px; padding: 5px 0; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 15px; font: inherit; cursor: pointer; }
.menu-list button:hover { background: #f5f5f5; }
.card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.card-head { background: #f5f5f5; border-bottom: 1px solid var(--border); padding: 8px 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 10px 12px; }
.card-body p { margin: 4px 0; }

/* Éditeur */
.editor { border: 1px solid #ccc; border-radius: var(--radius); background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid #ddd; background: #f7f7f7; }
.editor-toolbar button { border: 1px solid transparent; background: none; padding: 3px 8px; cursor: pointer; border-radius: 3px; font: 13px var(--font); min-width: 28px; }
.editor-toolbar button:hover { border-color: #ccc; background: #fff; }
.editor-area { min-height: 160px; max-height: 480px; overflow: auto; padding: 10px; }
.editor-area:empty::before { content: attr(data-placeholder); color: #aaa; }

/* Tableau de bord */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { border-radius: var(--radius); color: #fff; padding: 16px; }
.stat-card .n { font-size: 32px; font-weight: 700; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #eee; text-align: left; }
table.grid th { background: #f5f5f5; }

/* Administration */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.subnav a.active { font-weight: 700; color: #333; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.1); }

/* Connexion */
.login-box { max-width: 360px; margin: 0 auto 60px; }
.login-box h2 { font-weight: 400; font-size: 24px; margin: 0 0 14px; }
.login-box .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 12px; }
.login-box .btn { width: 100%; padding: 9px; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid transparent; }
.alert-danger { background: #f2dede; border-color: #ebccd1; color: #a94442; }
.alert-success { background: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.alert-warning { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }

/* Fenêtre modale et notifications */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 6px; width: 100%; max-width: 560px; box-shadow: 0 5px 15px rgba(0,0,0,.5); }
.modal-head { padding: 14px 16px; border-bottom: 1px solid #e5e5e5; font-size: 18px; }
.modal-body { padding: 16px; max-height: 65vh; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid #e5e5e5; display: flex; justify-content: flex-end; gap: 8px; }
.checklist { display: grid; gap: 6px; }
.autocomplete { position: relative; }
.autocomplete-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #ccc; border-top: 0; z-index: 30; max-height: 240px; overflow: auto; }
.autocomplete-list div { padding: 6px 10px; cursor: pointer; }
.autocomplete-list div:hover { background: #f5f5f5; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 18px; border-radius: var(--radius); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: .95; }
#toast.error { background: var(--danger); }
footer.site-footer { color: var(--muted); font-size: 12px; text-align: center; padding: 30px 0; }

@media (max-width: 900px) {
  .list-layout, .ticket-layout { flex-direction: column; }
  .filter-panel, .ticket-side { width: 100%; border-right: 0; padding-right: 0; }
  .support-title { display: none; }
  .logo img { max-width: 160px; }
}
