/* =====================================================================
   Tatérapi LASER – Webmail  ·  thème inspiré de la messagerie Hostinger
   ===================================================================== */
:root {
    --rail: #2b3640;
    --rail-hover: #34414c;
    --rail-active: #3d4b57;
    --rail-text: #e9edf1;
    --accent: #673de6;
    --accent-2: #3a8ee6;
    --accent-soft: #eef3fd;
    --text: #1d1e20;
    --muted: #727586;
    --line: #e5e7eb;
    --line-2: #f1f2f4;
    --bg: #ffffff;
    --bg-2: #f7f8fa;
    --unread: #1d1e20;
    --danger: #d63163;
    --ok: #00b090;
    --warn: #ffcd35;
    --radius: 8px;
    --shadow: 0 8px 28px rgba(29, 30, 32, .14);
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { color: var(--text); background: var(--bg); font-size: 14px; display: flex; overflow: hidden; }
a { color: var(--accent-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
code.block { display: block; margin-top: 6px; padding: 8px 10px; user-select: all; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; margin: 0 2px; background: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ----------------------------- Rail gauche ----------------------------- */
.rail { width: 78px; flex: 0 0 78px; background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; align-items: stretch; padding-bottom: 8px; z-index: 5; }
.rail-logo { height: 64px; display: grid; place-items: center; }
.rail-logo span { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #8c6cf0); display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .5px; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; color: var(--rail-text); font-size: 12.5px; transition: background .15s; }
.rail-item i { font-size: 19px; }
.rail-item:hover { background: var(--rail-hover); }
.rail-item.active { background: var(--rail-active); }
.rail-compose i, .rail-compose span { color: #6fb2ff; }
.rail-item.small { padding: 10px 4px; font-size: 11px; }
.rail-item.logout i { color: #ff5d7d; }
.rail-spacer { flex: 1; }

/* ------------------------------ Structure ------------------------------ */
.app { flex: 1; display: flex; min-width: 0; height: 100vh; }
.folders { width: 250px; flex: 0 0 250px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; min-height: 0; }
.list-pane { width: 380px; flex: 0 0 380px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.read-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.page-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.page-inner { flex: 1; overflow: auto; padding: 22px 28px 40px; }
.page-inner h1 { font-size: 22px; margin: 0 0 16px; }

/* ------------------------------ Dossiers ------------------------------- */
.acc-switch { position: relative; border-bottom: 1px solid var(--line); }
.acc-current { width: 100%; height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 18px; background: none; border: 0; cursor: pointer; text-align: left; }
.acc-current strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.acc-current > i { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot.lg { width: 14px; height: 14px; }
.acc-menu { left: 8px; right: 8px; top: 58px; }
.acc-menu a { display: flex; align-items: center; gap: 10px; }
.acc-menu a.current { background: var(--accent-soft); }
.acc-mail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.acc-mail small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.badge:not(:empty) { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }

.folder-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.folder-list li a { display: flex; align-items: center; gap: 12px; padding: 13px 16px 13px calc(18px + var(--depth, 0) * 16px); color: var(--text); border-bottom: 1px solid var(--line-2); font-size: 15px; }
.folder-list li a i { width: 20px; text-align: center; color: #3b3d4a; font-size: 16px; }
.folder-list li a:hover { background: var(--bg-2); }
.folder-list li.active a { background: var(--accent-soft); }
.folder-list li.active a i { color: var(--accent-2); }
.folder-list li.has-unread .fname { font-weight: 700; }
.folder-list li.drop-over a { background: #e1ebff; outline: 2px dashed var(--accent-2); outline-offset: -2px; }
.folder-list li.sep { padding: 14px 18px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 12px; font-weight: 700; color: var(--accent-2); }
.count.muted { color: var(--muted); font-weight: 400; }
.new-folder { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.new-folder input { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; min-width: 0; }
.new-folder button { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 32px; cursor: pointer; }

/* ------------------------------ Barres d'outils ------------------------- */
.toolbar { height: 64px; flex: 0 0 64px; display: flex; align-items: stretch; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; background: #fff; }
.msg-toolbar { justify-content: flex-end; padding-right: 22px; }
.compose-toolbar, .page-pane > .toolbar { justify-content: flex-start; padding-left: 16px; }
.tb-btn { position: relative; display: flex; }
.tb-btn > button, a.tb-btn, label.tb-btn, form.tb-btn > button, button.tb-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 64px; padding: 6px 10px;
    background: none; border: 0; cursor: pointer; color: #36344d; font-size: 13px; white-space: nowrap; border-radius: 0; }
.tb-btn i { font-size: 18px; color: #6d7081; }
.tb-btn:hover > button:not(:disabled), a.tb-btn:hover, label.tb-btn:hover, button.tb-btn:hover:not(:disabled) { background: var(--bg-2); }
.tb-btn.on > button { background: var(--accent-soft); }
.tb-btn :disabled, button.tb-btn:disabled { opacity: .45; cursor: default; }
.tb-btn.send i, .tb-btn.send span { color: var(--accent); font-weight: 700; }
.tb-spacer { flex: 1; }

/* ------------------------------- Menus ---------------------------------- */
[data-dropdown] { position: relative; }
.dropdown-menu { display: none; position: absolute; top: calc(100% - 4px); left: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.dropdown-menu.right { left: auto; right: 0; }
[data-dropdown].open > .dropdown-menu { display: block; }
.dropdown-menu > a, .dropdown-menu > button, .dropdown-menu form > button, .dropdown-menu .sub-list button, .submenu > span {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); border-radius: 6px; font-size: 13.5px; }
.dropdown-menu > a:hover, .dropdown-menu > button:hover, .dropdown-menu form > button:hover, .sub-list button:hover, .submenu:hover > span { background: var(--bg-2); }
.dropdown-menu i { width: 16px; color: var(--muted); }
.dropdown-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13.5px; }
.dropdown-menu label input[type=date], .dropdown-menu label input[type=datetime-local], .dropdown-menu label select { margin-left: auto; }
.menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 6px 8px 4px; }
.menu-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 6px 4px; }
.filter-menu { width: 300px; }
.filter-menu .row2 { display: grid; grid-template-columns: 1fr 1fr; }
.filter-menu .row2 label { flex-direction: column; align-items: stretch; gap: 3px; font-size: 12px; }
.filter-menu input[type=date], .filter-menu select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.schedule-menu { width: 270px; }
.schedule-menu label { flex-direction: column; align-items: stretch; }
.schedule-menu input { border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.schedule-menu .btn { width: 100%; margin-top: 4px; justify-content: center; }
.more-menu { min-width: 260px; }
.submenu { position: relative; }
.sub-list { display: none; position: absolute; right: 100%; top: -6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 220px; max-height: 60vh; overflow: auto; }
.submenu:hover .sub-list { display: block; }

/* ------------------------------ Recherche -------------------------------- */
.search { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); position: relative; }
.search > i { color: var(--muted); font-size: 18px; }
.search input[type=search] { flex: 1; border: 0; outline: 0; font-size: 15px; background: transparent; min-width: 0; }
.search .scope { background: none; border: 0; display: flex; gap: 6px; align-items: center; cursor: pointer; color: #3b3d4a; font-size: 15px; }
.search .scope i:last-child { font-size: 11px; }
.scope-menu { left: auto; right: 8px; top: 48px; width: 280px; }
.search.inline { border: 1px solid var(--line); border-radius: var(--radius); height: 44px; margin-bottom: 16px; max-width: 560px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; background: #eceef3; border-radius: 20px; font-size: 12px; color: #3b3d4a; }
.chip.ok { background: #dcf6ef; color: #00775f; }
.chip.err { background: #ffe5ec; color: var(--danger); }
.chip.clear { background: #fff; border: 1px solid var(--line); }

/* -------------------------- Liste des messages --------------------------- */
.msg-list { flex: 1; overflow-y: auto; }
.msg-row { position: relative; padding: 11px 18px 11px 40px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.msg-row:hover { background: var(--bg-2); }
.msg-row.open { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-2); }
.msg-row.checked { background: #e8efff; }
.msg-row .sel { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .1s; }
.msg-row:hover .sel, .msg-list.selecting .sel, .msg-row.checked .sel { opacity: 1; }
.row-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 7px; }
.row-top .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-top .date { flex: 0 0 auto; }
.row-sub { display: flex; align-items: center; gap: 8px; }
.row-sub .state { width: 18px; margin-left: -26px; text-align: center; color: #3b3d4a; font-size: 13px; }
.unread-dot { font-size: 6px !important; vertical-align: middle; }
.row-sub .subject { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.msg-row.unread .subject { font-weight: 700; }
.msg-row.unread .who { color: var(--text); font-weight: 600; }
.prio { color: var(--danger); margin-right: 5px; }
.row-sub .icons { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.flag-btn { border: 0; background: none; cursor: pointer; color: #b5b8c4; padding: 0; opacity: 0; }
.msg-row:hover .flag-btn, .msg-row.flagged .flag-btn { opacity: 1; }
.msg-row.flagged .flag-btn { color: var(--danger); }
.msg-row.dragging { opacity: .5; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty i { font-size: 30px; color: #c8cbd6; }
.empty.err { color: var(--danger); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: #3b3d4a; }
.pages { display: flex; align-items: center; gap: 4px; }
.pages a { width: 30px; height: 30px; display: grid; place-items: center; color: #3b3d4a; border-radius: 6px; }
.pages a:hover { background: var(--bg-2); }
.pages a.disabled { opacity: .3; pointer-events: none; }
.pnum { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; }

/* ------------------------------- Lecture ---------------------------------- */
.reader { flex: 1; overflow-y: auto; }
.reader-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 20px; }
.reader-empty p { margin: 2px; }
.brand-mark { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), #8c6cf0); color: #fff; font-size: 24px; font-weight: 700; display: grid; place-items: center; margin-bottom: 10px; }
.message { padding: 22px 30px 30px; }
.m-subject { font-size: 21px; margin: 0 0 18px; font-weight: 700; }
.m-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.avatar { --h: 250; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: hsl(var(--h) 55% 55%); }
.avatar.sm { width: 26px; height: 26px; display: inline-grid; font-size: 12px; vertical-align: middle; margin-right: 6px; }
.m-meta { flex: 1; min-width: 0; }
.m-from { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.m-to { font-size: 13px; margin-top: 4px; line-height: 1.5; }
.m-date { font-size: 13px; white-space: nowrap; }
.addr { cursor: default; border-bottom: 1px dotted transparent; }
.addr:hover { border-color: var(--muted); }
.m-body { width: 100%; border: 0; min-height: 200px; display: block; margin-top: 4px; }
.attachments { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attachments li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; max-width: 320px; background: var(--bg-2); }
.attachments li > i { color: var(--accent); font-size: 18px; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.att-dl { color: var(--muted); }
.quick-reply { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: #fff8e1; border: 1px solid #ffe7a0; border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; font-size: 13.5px; line-height: 1.5; }
.notice > i { color: #b98a00; margin-top: 3px; }
.notice.err { background: #ffecf1; border-color: #ffc7d6; color: #9b1c42; }
.fatal { margin: auto; text-align: center; max-width: 520px; padding: 30px; }
.fatal > i { font-size: 44px; color: var(--danger); }

/* -------------------------------- Boutons --------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: var(--radius); padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.btn:hover { border-color: #cfd2db; background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #5025d1; }
.btn.danger { color: var(--danger); border-color: #ffc7d6; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: 0; font-size: inherit; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }

/* -------------------------------- Rédaction -------------------------------- */
.compose { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.compose-body { flex: 1; overflow: auto; padding: 18px 30px 30px; max-width: 1100px; width: 100%; }
.compose-body h2 { margin: 0 0 12px; font-size: 20px; }
.field { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); min-height: 46px; }
.field > label { width: 56px; color: var(--muted); flex: 0 0 auto; }
.field > input, .field select, .recipients input { flex: 1; border: 0; outline: 0; padding: 10px 0; font-size: 14.5px; background: transparent; min-width: 0; }
.recipients { flex: 1; position: relative; display: flex; }
.field-links { display: flex; gap: 12px; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; padding: 4px; max-height: 280px; overflow: auto; }
.ac-list div { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; }
.ac-list div small { color: var(--muted); }
.ac-list div.on, .ac-list div:hover { background: var(--accent-soft); }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.att-list:empty { padding: 0; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); font-size: 13px; }
.att-chip small { color: var(--muted); }
.att-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.editor-wrap { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; overflow: hidden; }
.editor-tools { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.editor-tools button, .editor-tools select, .editor-tools .color { border: 0; background: none; height: 30px; min-width: 30px; border-radius: 6px; cursor: pointer; color: #3b3d4a; display: inline-grid; place-items: center; }
.editor-tools select { padding: 0 6px; }
.editor-tools button:hover, .editor-tools .color:hover { background: #e7e9ef; }
.editor-tools .color { position: relative; }
.editor-tools .color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.editor-tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor { min-height: 340px; padding: 16px 18px; outline: 0; line-height: 1.55; overflow-wrap: anywhere; }
.editor-wrap.small .editor { min-height: 110px; }
.editor blockquote { border-left: 3px solid #d5dfff; margin: 8px 0; padding-left: 12px; color: #555; }
.editor img { max-width: 100%; }
body.dragging-files .compose-body { outline: 3px dashed var(--accent); outline-offset: -10px; }

/* ------------------------------ Formulaires ------------------------------- */
.card { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; background: #fff; max-width: 920px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid h3, .form-grid .full { grid-column: 1 / -1; }
.form-grid label, .card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #3b3d4a; font-weight: 500; }
.form-grid input:not([type=checkbox]):not([type=radio]):not([type=color]), .form-grid select, .form-grid textarea,
.inline-form input, .auth-box input { border: 1px solid #d7dae2; border-radius: 6px; padding: 9px 11px; font-size: 14px; font-weight: 400; background: #fff; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .inline-form input:focus, .auth-box input:focus { outline: 2px solid #d9cdfb; border-color: var(--accent); }
.form-grid input[type=color] { width: 60px; height: 38px; border: 1px solid #d7dae2; border-radius: 6px; padding: 2px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
fieldset.server { border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; padding: 10px 14px 14px; }
fieldset.server legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card.inline-form { display: flex; }
.switch { flex-direction: row !important; align-items: center; gap: 12px !important; font-size: 15px !important; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #d7dae2; position: relative; cursor: pointer; transition: .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }
.switch span { display: none; }
.acc-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.acc-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); min-width: 220px; }
.acc-card span { display: flex; flex-direction: column; }
.acc-card small { color: var(--muted); }
.acc-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.acc-card.add { color: var(--accent); justify-content: center; border-style: dashed; }
.acc-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); font-size: 13px; }
.pill.on { background: var(--accent-soft); border-color: var(--accent-2); }

/* -------------------------------- Tableaux --------------------------------- */
.table { width: 100%; border-collapse: collapse; margin-bottom: 18px; max-width: 1100px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: var(--bg-2); }
.table .w1 { width: 1%; }
.table.small td { font-size: 12.5px; }
tr.muted td { color: var(--muted); }

/* --------------------------------- Toasts ---------------------------------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 90vw; }
.toast { display: flex; align-items: center; gap: 10px; background: #1d1e20; color: #fff; border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 14px; animation: pop .2s ease-out; }
.toast.ok i { color: #4be3bf; }
.toast.err { background: #8f1336; }
.toast-x { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 18px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* --------------------------------- Auth ------------------------------------ */
body.auth { display: grid; place-items: center; background: linear-gradient(160deg, #2b3640, #3d2d7a); overflow: auto; }
.auth-box { width: 380px; max-width: 92vw; background: #fff; border-radius: 16px; padding: 34px 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 14px; }
.auth-box .brand-mark { margin: 0 auto; }
.auth-box h1 { text-align: center; margin: 0; font-size: 22px; }
.auth-box > p { text-align: center; margin: 0 0 6px; }
.auth-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }

/* ------------------------------ Responsive ---------------------------------- */
@media (max-width: 1280px) { .folders { width: 210px; flex-basis: 210px; } .list-pane { width: 330px; flex-basis: 330px; } .tb-btn span { font-size: 12px; } }
@media (max-width: 1000px) {
    .msg-toolbar .tb-btn span, .list-pane .tb-btn span { display: none; }
    .tb-btn > button, a.tb-btn, button.tb-btn, label.tb-btn { min-width: 44px; }
    .folders { width: 180px; flex-basis: 180px; }
}
@media (max-width: 760px) {
    body { overflow: auto; }
    .rail { position: fixed; bottom: 0; left: 0; right: 0; height: 58px; width: auto; flex-direction: row; padding: 0; }
    .rail-logo, .rail-spacer, .rail-item.small:not(.logout) { display: none; }
    .rail-item { flex: 1; padding: 8px 2px; font-size: 10.5px; gap: 3px; }
    .app { height: calc(100vh - 58px); flex-direction: column; }
    .folders { width: 100%; flex: 0 0 auto; max-height: 64px; overflow: hidden; }
    .folders.expanded { max-height: none; }
    .view-mail .list-pane { width: 100%; flex: 1; }
    .view-mail .read-pane { display: none; position: fixed; inset: 0 0 58px 0; background: #fff; z-index: 20; }
    .view-mail.reading .read-pane { display: flex; }
    .form-grid, fieldset.server { grid-template-columns: 1fr; }
    .compose-body, .page-inner { padding: 14px; }
    .message { padding: 16px; }
}
@media print {
    .rail, .folders, .list-pane, .toolbar, .quick-reply, .toasts { display: none !important; }
    body, .app { overflow: visible; height: auto; display: block; }
}

/* Connexion : afficher / masquer le mot de passe */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 40px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); width: 34px; height: 34px; }
.center { text-align: center; margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; margin-bottom: 16px; max-width: 920px; }
