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

:root {
    --bg: #0b1020;
    --bg-2: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #111827;
    --panel-soft: #172036;
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.22);

    --text: #f8fafc;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;

    --primary: #6366f1;
    --primary-hover: #5558e6;
    --primary-soft: rgba(99, 102, 241, 0.14);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.15);

    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);

    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);

    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, 0.14);

    --shadow-lg: 0 24px 80px rgba(2, 6, 23, 0.45);
    --shadow-md: 0 10px 30px rgba(2, 6, 23, 0.28);

    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --container: 1480px;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 26%),
        linear-gradient(180deg, #07101f 0%, #0b1020 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.45;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.dashboard {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 460px;
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 32px;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.topbar h1 {
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.topbar-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.card {
    background: var(--panel);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 24px;
    line-height: 1.15;
    margin-bottom: 22px;
    letter-spacing: -0.02em;
}

.card h3 {
    font-size: 18px;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-soft);
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.35fr);
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), transparent 45%);
    pointer-events: none;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
}

.form-group input,
.form-group textarea,
.custom-select,
input[type="date"] {
    width: 100%;
    min-height: 50px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #7f8ba1;
}

.form-group input:focus,
.form-group textarea:focus,
.custom-select:focus,
input[type="date"]:focus {
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.btn-primary,
.btn-logout,
.nav-btn,
.btn-danger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn-logout {
    background: rgba(15, 23, 42, 0.78);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-logout:hover {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(20, 30, 54, 0.9);
}

.nav-btn {
    background: rgba(15, 23, 42, 0.72);
    border-color: var(--border);
    color: var(--text-soft);
}

.nav-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(22, 33, 60, 0.92);
    color: white;
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.26);
    color: #fecaca;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.34);
}

.alert-error,
.alert-success {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
}

.alert-error {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.22);
    color: #fecaca;
}

.alert-success {
    background: var(--success-soft);
    border-color: rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
}

.clients-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
}

.clients-table thead th {
    text-align: left;
    padding: 0 18px 16px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
}

.clients-table tbody td {
    padding: 18px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    vertical-align: middle;
    white-space: nowrap;
}

.clients-table tbody tr {
    transition: var(--transition);
}

.clients-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

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

.planning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.planning-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-danger {
    background: var(--danger-soft);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.24);
}

.badge-warning {
    background: var(--warning-soft);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.26);
}

.badge-info {
    background: var(--info-soft);
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.24);
}

.badge-success {
    background: var(--success-soft);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.24);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: #dbe4f0;
    border-color: rgba(148, 163, 184, 0.12);
}

/* KANBAN STYLE V2 */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 20px;
    align-items: start;
}

.kanban-column {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    min-height: 420px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.kanban-column-header h3 {
    font-size: 18px;
    letter-spacing: -0.02em;
}

.kanban-count {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #dbe4ff;
    font-weight: 700;
}

.kanban-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.18);
    transition: var(--transition);
}

.task-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.26);
}

.task-card h4 {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.task-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 12px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.task-type,
.task-deadline,
.task-project {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #dbe4f0;
}

.task-project {
    margin-bottom: 14px;
    white-space: normal;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-kanban {
    color: var(--text-muted);
    font-size: 14px;
    padding: 10px 4px 4px;
}

/* SMALL HELPERS */
.spacer-24 {
    height: 24px;
}

.spacer-16 {
    height: 16px;
}

.text-muted {
    color: var(--text-muted);
}

.text-soft {
    color: var(--text-soft);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kanban-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard {
        padding: 24px 18px 40px;
    }

    .clients-table {
        min-width: 980px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 18px 14px 32px;
    }

    .login-page {
        padding: 16px;
    }

    .login-box {
        padding: 24px;
        border-radius: 22px;
    }

    .login-box h1 {
        font-size: 28px;
    }

    .card {
        padding: 20px;
        border-radius: 22px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 26px;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .planning-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .clients-table {
        min-width: 860px;
    }

    .task-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .task-actions .nav-btn,
    .task-actions .btn-danger {
        width: 100%;
    }
}
.trello-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 20px;
    align-items: start;
}

.trello-column {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    padding: 16px;
    min-height: 500px;
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24);
}

.trello-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.trello-column-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trello-column-title-wrap h3 {
    font-size: 18px;
    letter-spacing: -0.02em;
}

.trello-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.trello-dot-todo {
    background: #f59e0b;
}

.trello-dot-doing {
    background: #38bdf8;
}

.trello-dot-done {
    background: #22c55e;
}

.trello-count {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.24);
    color: #dbe4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.trello-column-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.trello-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
    transition: 0.2s ease;
}

.trello-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.28);
}

.trello-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.trello-card h4 {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 10px;
    color: #f8fafc;
}

.trello-card p {
    font-size: 14px;
    line-height: 1.55;
    color: #94a3b8;
    margin-bottom: 12px;
}

.trello-date {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbe4f0;
}

.trello-project {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbe4f0;
    margin-bottom: 14px;
    white-space: normal;
}

.trello-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.task-chip-devis {
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.24);
}

.task-chip-facture {
    background: rgba(99, 102, 241, 0.14);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.24);
}

.task-chip-production {
    background: rgba(56, 189, 248, 0.14);
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.24);
}

.task-chip-autre {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.14);
}

@media (max-width: 1100px) {
    .trello-board {
        grid-template-columns: 1fr;
    }
}
.trello-card.is-dragging {
    opacity: 0.45;
    transform: rotate(1deg);
}

.trello-column.is-drop-target {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.trello-card.is-dragging {
    opacity: 0.45;
    transform: rotate(1deg);
}

.trello-column.is-drop-target {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.empty-kanban {
    color: #94a3b8;
    font-size: 14px;
    padding: 10px 4px 4px;
}