:root {
    --bg: #020617;
    --surface: #0f172a;
    --surface-alt: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: #334155;
    --brand: #0047bb;
    --brand-strong: #003a9c;
    --ok: #10b981;
    --bad: #ef4444;
    --accent: #ff8200;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -10%, rgba(0, 71, 187, 0.24), transparent 35%),
        radial-gradient(circle at 90% 0%, rgba(255, 130, 0, 0.14), transparent 28%),
        linear-gradient(180deg, #020617 0%, #0b1224 55%, #0f172a 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

.app-shell {
    width: min(1200px, 94vw);
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.brand {
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    font-weight: 800;
    text-transform: uppercase;
    color: #e2e8f0;
}

.grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.45);
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
}

h1 {
    font-size: 1.4rem;
}

h2 {
    font-size: 1.1rem;
}

.small {
    font-size: 0.85rem;
    color: var(--muted);
}

label {
    font-size: 0.82rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.25rem;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #334155;
    background: #020617;
    color: #f8fafc;
    border-radius: 10px;
    padding: 0.58rem 0.62rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 130, 0, 0.2);
}

textarea {
    min-height: 95px;
    resize: vertical;
}

button,
.button {
    border: 0;
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
}

button:hover,
.button:hover {
    background: linear-gradient(180deg, #0a57d0 0%, var(--brand) 100%);
}

.button-secondary {
    background: #1e293b;
    border: 1px solid #334155;
}

.button-small {
    padding: 0.34rem 0.52rem;
    font-size: 0.74rem;
    border-radius: 8px;
    line-height: 1.1;
}

/* Accordion conventions */
.convention-accordion-item {
    border: 1px solid #1e293b;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    overflow: hidden;
}

.convention-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    background: #0f172a;
    gap: 0.6rem;
    user-select: none;
}

.convention-accordion-header:hover {
    background: #1e293b;
}

.convention-accordion-body {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid #1e293b;
}

.convention-accordion-item.open > .convention-accordion-header .convention-accordion-toggle {
    transform: rotate(180deg);
}

.flash {
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.flash.ok {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.flash.err {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

@media (min-width: 700px) {
    .kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.kpi {
    background: #020617;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.75rem;
}

.kpi .v {
    font-size: 1.2rem;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.55rem 0.4rem;
    vertical-align: top;
}

thead th {
    color: #94a3b8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge {
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge.ok {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

.badge.bad {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.inline-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

@media (min-width: 640px) {
    .inline-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.actions {
    display: flex;
    gap: 0.45rem;
    /*flex-wrap: wrap;*/
}

.money {
    white-space: nowrap;
}

.icon-button {
    min-width: 2.1rem;
    text-align: center;
    padding: 0.45rem 0.55rem;
    line-height: 1;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-link {
    padding: 0.5rem 0.85rem;
    border: 1px solid #334155;
    border-radius: 999px;
    background: #0b1224;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
}

.tab-link:hover {
    color: #e2e8f0;
    border-color: #475569;
}

.tab-link.active {
    color: #ffffff;
    border-color: #1d4ed8;
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
}

.subtabs {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.subtab-link {
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: #111827;
    color: #94a3b8;
    border: 1px solid #334155;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

.subtab-link.active {
    color: #fff;
    background: rgba(255, 130, 0, 0.14);
    border-color: rgba(255, 130, 0, 0.45);
}

.charge-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    border-left: 3px solid #334155;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
}

.charge-label-input {
    width: 90%;
}

.meal-checkbox {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    padding: 0;
    margin: 0;
    border-radius: 3px;
}

@media (min-width: 640px) {
    .charge-row {
        grid-template-columns: 3fr 1fr 1fr 0fr 0.1fr;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem;
        margin-bottom: 0.2rem;
    }
}

.charges-header-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.charges-header-actions h3 {
    margin: 0;
    font-size: 1rem;
    flex: 1;
}

.charges-header-actions .btn-add-charge {
    margin: 0;
}

.csv-import-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #0047bb;
    background: transparent;
    color: #0047bb;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s;
    text-align: center;
}

.csv-import-btn:hover {
    background: #0047bb;
    color: #fff;
    border-color: #0047bb;
}

.hidden-csv-form {
    display: none;
}

.btn-add-charge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #1d4ed8;
    background: #1d4ed8;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s;
}

.btn-add-charge:hover {
    background: #1e40af;
    border-color: #1e40af;
}

.btn-remove-charge {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ef4444;
    background: transparent;
    color: #fca5a5;
    font-size: 1.4rem;
    font-weight: 300;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-remove-charge:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* Form sections with colored backgrounds */
.form-section {
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid #1e293b;
}

.form-section-info {
    background: rgba(15, 23, 42, 0.6);
    border-color: #1e293b;
}

.form-section-sellers {
    background: rgba(30, 27, 17, 0.5);
    border-color: #3d3420;
}

.form-section-artists {
    background: rgba(17, 24, 39, 0.8);
    border-color: #1e293b;
}

.form-section-charges {
    background: rgba(15, 23, 42, 0.7);
    border-color: #1e293b;
}

.form-section > h2 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
    font-weight: 600;
}

.collapse-section {
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    overflow: hidden;
}

.collapse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    user-select: none;
    background: rgba(30, 41, 59, 0.5);
    gap: 0.5rem;
}

.collapse-header:hover {
    background: rgba(30, 41, 59, 0.7);
}

.collapse-header h3 {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collapse-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.collapse-section.open .collapse-toggle {
    transform: rotate(180deg);
}

.collapse-content {
    display: none;
    padding: 0.6rem 0.7rem;
}

.collapse-section.open .collapse-content {
    display: block;
}



.mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.72rem;
}

.role-name-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.role-map-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.role-name {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    border: 1px solid #334155;
    padding: 0.16rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.role-name-value {
    font-weight: 700;
}

.role-name.role-artist {
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.55);
    color: #c4b5fd;
}

.role-name.role-seller {
    border-radius: 0.55rem;
    background: rgba(0, 71, 187, 0.2);
    border-color: rgba(59, 130, 246, 0.55);
    color: #bfdbfe;
}

.color-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.18);
}

.login-box {
    width: min(450px, 92vw);
    margin: 10vh auto 0;
}

.warning {
    border-left: 4px solid var(--accent);
    background: rgba(255, 130, 0, 0.14);
    color: #fdba74;
    padding: 0.7rem;
    border-radius: 8px;
}

.convention-layout {
    display: grid;
    gap: 0.6rem;
}

.convention-main {
    min-width: 0;
}

.convention-side {
    min-width: 0;
}

.sticky-card {
    position: sticky;
    top: 1rem;
}

.panel-detail {
    line-height: 1.45;
}

.result-ca-card {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
}

.result-ca-card .v {
    font-size: 1.5rem;
    font-weight: 800;
    color: #6ee7b7;
}

.result-positive {
    color: #6ee7b7 !important;
}

.result-negative {
    color: #fca5a5 !important;
}

.rentable-badge {
    display: block;
    text-align: center;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
    margin-top: 0.45rem;
}

.rentable-badge.ok {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rentable-badge.bad {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.charges-group {
    margin-bottom: 0.5rem;
}

.charges-group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.charges-group .kpi {
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.3rem;
}

.kpi-charges-total {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-final-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    margin-top: 0.6rem;
}

@media (min-width: 1080px) {
    .convention-layout {
        grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
        align-items: start;
    }
}

.calendar-table td,
.calendar-table th {
    min-width: 120px;
}

.calendar-cell {
    height: 120px;
    vertical-align: top;
    background: rgba(2, 6, 23, 0.45);
}

.calendar-empty {
    background: rgba(15, 23, 42, 0.2);
}

.calendar-day {
    font-size: 0.78rem;
    color: #cbd5e1;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.calendar-event {
    border-width: 1px;
    border-style: solid;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.calendar-event .calendar-event-status {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.calendar-event.status-vise {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(51, 65, 85, 0.38);
}

.calendar-event.status-vise .calendar-event-status {
    color: #cbd5e1;
}

.calendar-event.status-contacte {
    border-color: rgba(14, 165, 233, 0.52);
    background: rgba(8, 47, 73, 0.42);
}

.calendar-event.status-contacte .calendar-event-status {
    color: #7dd3fc;
}

.calendar-event.status-candidate {
    border-color: rgba(249, 115, 22, 0.55);
    background: rgba(67, 20, 7, 0.42);
}

.calendar-event.status-candidate .calendar-event-status {
    color: #fdba74;
}

.calendar-event.status-valide {
    border-color: rgba(16, 185, 129, 0.58);
    background: rgba(6, 46, 37, 0.45);
}

.calendar-event.status-valide .calendar-event-status {
    color: #6ee7b7;
}

.calendar-event.status-refuse {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(69, 10, 10, 0.44);
}

.calendar-event.status-refuse .calendar-event-status {
    color: #fca5a5;
}

.event-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.72);
    z-index: 1000;
}

.event-modal.is-open {
    display: flex;
}

.event-modal-card {
    width: min(560px, 94vw);
    max-height: 85vh;
    overflow: auto;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.6);
}

.event-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.event-modal-row {
    border: 1px solid #334155;
    background: #020617;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.event-modal-label {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.event-modal-value {
    color: #f8fafc;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .custom-field-row,
    .future-custom-field-row {
        grid-template-columns: 1fr !important;
    }
}
