* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d1117;
    color: #e6edf3;
    min-height: 100vh;
}

header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #58a6ff;
}

header h1 span {
    color: #e6edf3;
    font-weight: 300;
}

.soldes {
    text-align: right;
    font-size: 14px;
}

.soldes .cash {
    color: #7ee787;
    font-weight: 600;
}

.soldes .total {
    color: #58a6ff;
    font-weight: 600;
}

nav {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0 32px;
    display: flex;
    gap: 0;
}

nav button {
    background: none;
    border: none;
    color: #8b949e;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

nav button:hover {
    color: #e6edf3;
}

nav button.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

main {
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.cartes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.carte {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
}

.carte h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.carte .valeur {
    font-size: 28px;
    font-weight: 700;
}

.carte .valeur.positif {
    color: #7ee787;
}

.carte .valeur.negatif {
    color: #f85149;
}

.panel-recherche {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-recherche input {
    flex: 1;
    padding: 10px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
}

.panel-recherche input:focus {
    outline: none;
    border-color: #58a6ff;
}

.panel-recherche button {
    padding: 10px 20px;
    background: #238636;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-recherche button:hover {
    background: #2ea043;
}

.grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.cours-infos {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

.cours-infos .symbol {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cours-infos .name {
    color: #8b949e;
    font-size: 14px;
    margin-bottom: 16px;
}

.cours-infos .price {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cours-infos .change {
    font-size: 16px;
    margin-bottom: 16px;
}

.change.positif {
    color: #7ee787;
}

.change.negatif {
    color: #f85149;
}

.details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.details .item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #21262d;
    font-size: 13px;
}

.details .item .label {
    color: #8b949e;
}

.form-ordre {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
}

.form-ordre h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 12px;
    color: #8b949e;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row input, .form-row select {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #58a6ff;
}

.form-row .quantite-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-row .quantite-group input {
    flex: 1;
}

.form-row .quantite-group button {
    padding: 8px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    cursor: pointer;
    font-size: 13px;
}

.form-row .quantite-group button:hover {
    background: #30363d;
}

.gain-indicator {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.gain-indicator.positif {
    background: #1a3a1a;
    border: 1px solid #238636;
    color: #7ee787;
}

.gain-indicator.negatif {
    background: #3a1a1a;
    border: 1px solid #da3633;
    color: #f85149;
}

.btn-ordre {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}

.btn-ordre:hover {
    opacity: 0.9;
}

.btn-ordre.achat {
    background: #238636;
    color: #fff;
}

.btn-ordre.vente {
    background: #da3633;
    color: #fff;
}

.btn-ordre.conditionnel {
    background: #1f6feb;
    color: #fff;
}

.btn-ordre.secondary {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    margin-top: 4px;
}

.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.message.success {
    display: block;
    background: #1a3a1a;
    border: 1px solid #238636;
    color: #7ee787;
}

.message.error {
    display: block;
    background: #3a1a1a;
    border: 1px solid #da3633;
    color: #f85149;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

table th {
    background: #21262d;
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #30363d;
}

table td {
    padding: 10px 16px;
    border-bottom: 1px solid #21262d;
    font-size: 14px;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: #1c2128;
}

.symbole-lien {
    color: #58a6ff;
    cursor: pointer;
    font-weight: 600;
}

.symbole-lien:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge.achat {
    background: #1a3a1a;
    color: #7ee787;
}

.badge.vente {
    background: #3a1a1a;
    color: #f85149;
}

.badge.en_attente {
    background: #1a2d4a;
    color: #58a6ff;
}

.badge.execute {
    background: #1a3a1a;
    color: #7ee787;
}

.badge.annule {
    background: #3a1a1a;
    color: #f85149;
}

.text-right {
    text-align: right;
}

.btn-annuler {
    padding: 4px 12px;
    background: none;
    border: 1px solid #da3633;
    border-radius: 4px;
    color: #f85149;
    cursor: pointer;
    font-size: 12px;
}

.btn-annuler:hover {
    background: #da3633;
    color: #fff;
}

.btn-reset {
    padding: 6px 14px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f85149;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
}

.btn-reset:hover {
    background: #da3633;
    color: #fff;
}

.resultats-recherche {
    background: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.resultats-recherche .item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #21262d;
}

.resultats-recherche .item:last-child {
    border-bottom: none;
}

.resultats-recherche .item:hover {
    background: #1c2128;
}

.resultats-recherche .item .sym {
    font-weight: 600;
}

.resultats-recherche .item .nom {
    color: #8b949e;
    font-size: 13px;
}

.chart-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #21262d;
}

.chart-periodes {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.periode-btn {
    padding: 4px 12px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #8b949e;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.periode-btn:hover {
    background: #30363d;
    color: #e6edf3;
}

.periode-btn.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

#coursChart {
    max-height: 220px;
    max-width: 100%;
}

@media (max-width: 900px) {
    .grille {
        grid-template-columns: 1fr;
    }
    header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .soldes {
        text-align: center;
    }
    nav {
        padding: 0 16px;
        overflow-x: auto;
    }
    main {
        padding: 16px;
    }
}
