/* Korso Maritime — Feuille de style principale */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:    #0a1628;
    --navy2:   #0f2040;
    --accent:  #1e7fcb;
    --accent2: #2a9fd6;
    --green:   #27ae60;
    --amber:   #e8a020;
    --red:     #c0392b;
    --font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius:  8px;
    --radius-lg: 12px;
}

body {
    font-family: var(--font);
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Layout ── */
.app-wrapper { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }

/* ── Topbar ── */
.topbar {
    background: var(--navy);
    color: #e8eef4;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.topbar .logo { font-size: 16px; font-weight: 500; letter-spacing: .04em; }
.topbar .logo span { color: var(--accent2); }
.topbar .date { font-size: 11px; color: rgba(180,200,220,.55); }

/* ── Tabs ── */
.tabs {
    display: flex;
    background: var(--navy2);
    border-left: 1px solid rgba(30,127,203,.25);
    border-right: 1px solid rgba(30,127,203,.25);
}
.tab {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(180,200,220,.55);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .2s;
    user-select: none;
}
.tab:hover:not(.active) { color: #a0c4e0; }
.tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }

/* ── Content panel ── */
.content {
    background: #fff;
    border: 1px solid #dde2ea;
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 18px;
}
.section { display: none; }
.section.active { display: block; }

/* ── Cards ── */
.card {
    background: #f7f9fc;
    border: 1px solid #e4e8ef;
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
}
.card-title {
    font-size: 11px;
    font-weight: 600;
    color: #7a8599;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.card-title::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── Inputs ── */
input[type=text], textarea, select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d7e3;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color .15s;
}
input[type=text]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,127,203,.1);
}
.imo-input { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 15px; }
label { font-size: 12px; font-weight: 600; color: #7a8599; display: block; margin-bottom: 4px; }
.input-group { margin-bottom: 12px; }
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: rgba(30,127,203,.08); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: #2ecc71; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; }
.badge-relancer { background: rgba(192,57,43,.1); color: var(--red); border: 1px solid rgba(192,57,43,.25); }
.badge-actif    { background: rgba(39,174,96,.1);  color: var(--green); border: 1px solid rgba(39,174,96,.25); }
.badge-froid    { background: rgba(120,120,120,.1); color: #888; border: 1px solid rgba(120,120,120,.25); }
.badge-alerte   { background: rgba(232,160,32,.1); color: var(--amber); border: 1px solid rgba(232,160,32,.25); }

/* ── Result box ── */
.result-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dde2ea;
    border-radius: var(--radius);
    background: #fff;
}
.bureau-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 10px; }
.bureau-name { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.bureau-sub  { font-size: 11px; color: #7a8599; margin-top: 2px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #7a8599; margin-bottom: 10px; }
.meta-row strong { color: #3a4560; }
.cycle-tip {
    padding: 8px 12px;
    background: rgba(30,127,203,.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 12px;
    color: #3a5070;
    margin-bottom: 12px;
}
.cycle-tip.warn { border-color: var(--amber); background: rgba(232,160,32,.06); color: #7a5010; }

/* ── History ── */
.history-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.history-item {
    display: flex;
    gap: 10px;
    padding: 6px 10px;
    background: #f7f9fc;
    border-radius: var(--radius);
    font-size: 12px;
}
.h-date  { color: #9aa5b8; min-width: 70px; flex-shrink: 0; }
.h-cycle { color: var(--accent); min-width: 46px; flex-shrink: 0; font-family: monospace; font-size: 11px; }
.h-note  { color: #4a5568; }
.history-empty { font-size: 12px; color: #9aa5b8; padding: 6px 0; }

/* ── Validation block ── */
.validation-block { border: 1px solid #dde2ea; border-radius: var(--radius); overflow: hidden; }
.validation-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f7f9fc;
    cursor: pointer;
    transition: background .15s;
}
.validation-trigger:hover { background: #eef1f7; }
.validation-trigger input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.validation-trigger label { font-size: 13px; font-weight: 500; color: #1a1a2e; cursor: pointer; margin: 0; }
.validation-expand { display: none; padding: 14px; border-top: 1px solid #dde2ea; background: #fff; }
.validation-expand.open { display: block; }
.note-section-label { font-size: 11px; font-weight: 600; color: #7a8599; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #d0d7e3;
    background: #f7f9fc;
    color: #4a5568;
    cursor: pointer;
    transition: all .15s;
}
.chip:hover, .chip.selected { background: rgba(30,127,203,.1); border-color: var(--accent); color: var(--accent); }
.note-textarea { min-height: 64px; resize: none; line-height: 1.5; font-size: 12px; }
.note-hint { font-size: 11px; color: #9aa5b8; margin-top: 5px; margin-bottom: 12px; }
.validation-actions { display: flex; gap: 8px; }
.validated-ok {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(39,174,96,.06);
    border-top: 1px solid rgba(39,174,96,.2);
}
.v-icon { width: 20px; height: 20px; border-radius: 50%; background: var(--green); display: flex; align-items:center; justify-content:center; color:#fff; font-size: 11px; flex-shrink:0; }
.v-text { font-size: 12px; font-weight: 600; color: var(--green); }
.v-note { font-size: 11px; color: #7a8599; margin-top: 1px; }

/* ── Dashboard stats ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: #f7f9fc; border: 1px solid #e4e8ef; border-radius: var(--radius); padding: 12px; }
.stat-num { font-size: 22px; font-weight: 600; color: #1a1a2e; }
.stat-lbl { font-size: 10px; color: #9aa5b8; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ── Motivation bar ── */
.motiv-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.motiv-label { font-size: 11px; font-weight: 600; color: #7a8599; text-transform: uppercase; letter-spacing: .08em; }
.motiv-count { font-size: 24px; font-weight: 600; color: #1a1a2e; }
.motiv-status { font-size: 11px; color: #9aa5b8; }
.bar-track { height: 22px; background: #e4e8ef; border-radius: 11px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 11px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.bar-markers { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: #9aa5b8; }

/* ── Monthly comparison ── */
.monthly-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.month-card { background: #f7f9fc; border: 1px solid #e4e8ef; border-radius: var(--radius); padding: 12px; }
.month-label { font-size: 10px; font-weight: 600; color: #9aa5b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.month-bar-track { height: 8px; background: #e4e8ef; border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.month-bar-fill { height: 100%; border-radius: 4px; transition: width .6s; }
.month-num { font-size: 20px; font-weight: 600; color: #1a1a2e; }
.month-detail { font-size: 10px; color: #9aa5b8; margin-top: 2px; }

/* ── Prospect list ── */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar select { width: auto; }
.prospect-count { font-size: 12px; color: #9aa5b8; margin-left: auto; }
.prospect-list { display: flex; flex-direction: column; gap: 8px; }
.prospect-row {
    background: #f7f9fc;
    border: 1px solid #e4e8ef;
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color .15s;
}
.prospect-row:hover { border-color: #b0bcd0; }
.prospect-row.blink { animation: blink 1.6s infinite; }
@keyframes blink { 0%,100%{border-color: rgba(192,57,43,.2)} 50%{border-color: rgba(192,57,43,.7)} }
.p-name { flex: 1; font-size: 13px; font-weight: 600; color: #1a1a2e; }
.p-sub  { font-size: 11px; color: #9aa5b8; font-weight: 400; margin-top: 1px; }
.p-cycle { font-size: 11px; color: #9aa5b8; width: 56px; text-align: center; }
.p-days  { font-size: 11px; color: #9aa5b8; width: 72px; text-align: center; }
.p-badge { width: 120px; text-align: right; }

/* ── Suggest dropdown ── */
.suggest-list {
    background: #fff;
    border: 1px solid #c0cbdb;
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: -8px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.suggest-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #eef0f5; color: #1a1a2e; }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: #f2f5fb; }

/* ── Messages ── */
.msg { padding: 10px 12px; border-radius: var(--radius); font-size: 12px; margin-bottom: 10px; }
.msg-success { background: rgba(39,174,96,.08); color: var(--green); border: 1px solid rgba(39,174,96,.25); }
.msg-error   { background: rgba(192,57,43,.08); color: var(--red);   border: 1px solid rgba(192,57,43,.25); }

/* ── Divider ── */
.divider { height: 1px; background: #e4e8ef; margin: 14px 0; }

/* ── Section sub-title ── */
.section-title { font-size: 11px; font-weight: 600; color: #9aa5b8; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

/* ── Loader ── */
.loader { text-align: center; padding: 20px; font-size: 12px; color: #9aa5b8; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .stats-row { grid-template-columns: repeat(2,1fr); }
    .form-two-col { grid-template-columns: 1fr; }
    .p-cycle, .p-days { display: none; }
}

/* ── Actions prospect (édition / suppression) ── */
.p-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.btn-delete { background: rgba(192,57,43,.08); color: var(--red); border-color: rgba(192,57,43,.3); }
.btn-delete:hover { background: rgba(192,57,43,.18); }

/* ── Modal édition ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,22,40,.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 24px 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:none; } }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.modal-title { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #9aa5b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.modal-close:hover { background: #eef0f5; color: #3a4560; }

@media (max-width: 600px) {
    .p-actions { display: none; }
}