:root {
    --mir-blue: #29ddff;
    --bg: #f4f4f4;
    --line: #d7d7d7;
    --danger: #c62828;
    --success: #1b8f3b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
}

.container {
    max-width: 1180px;
    margin: 30px auto;
    padding: 0 16px 40px;
}

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.12);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    background: linear-gradient(135deg, var(--mir-blue) 0%, #61e5ff 100%);
    color: #000;
    padding: 18px 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 20px;
}

.login-box {
    max-width: 420px;
    margin: 90px auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-weight: 700;
    font-size: 14px;
}

.field input {
    height: 44px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
}

.field input[readonly] {
    background: #f1f7fa;
    cursor: not-allowed;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--mir-blue);
    color: #000;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    width:44px;
    height:44px;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.btn-danger svg {
    width: 20px;
    height: 20px;
}

.btn-link {
    display: inline-block;
    text-decoration: none;
    background: #000;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.btn,
.btn-link{
    transition:all .18s ease;
    cursor:pointer;
}

/* hover general */

.btn:hover,
.btn-link:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(0,0,0,.15);
}

/* peligro (borrar) */

.btn-danger:hover{
    transform:scale(1.08);
    background:#e53935;
}

/* enlaces */

.btn-link:hover{
    color:#29ddff;
}

.toast {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 0 12px 12px 0;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    animation: toastFadeIn 0.25s ease;
}

.toast-success {
    background: #e8f7ed;
    color: var(--success);
    border-left: 5px solid var(--success);
}

.toast-error {
    background: #fdeaea;
    color: var(--danger);
    border-left: 5px solid var(--danger);
}

.toast-hide {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-box {
    margin-top: 18px;
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #d8eef3;
    border-radius: 12px;
    background: #f8fdff;
    min-height: 160px;
}

.preview-box img {
    width: 130px;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    border: 3px solid var(--mir-blue);
    background: #fff;
    display: block;
    flex-shrink: 0;
}

.preview-meta {
    font-size: 14px;
    line-height: 1.6;
}

.preview-meta strong {
    display: inline-block;
    min-width: 48px;
}

.table-wrap {
    overflow-x: auto;
}

.total-inscriptions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    margin-bottom: 28px;
    padding: 8px 0 8px;
}

.total-inscriptions .line {
    flex: 1;
    max-width: 380px;
    height: 4px;
    background: rgba(0,0,0,0.82);
}

.total-inscriptions-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 360px;
}

.total-inscriptions .total-label {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #000;
    text-transform: uppercase;
    line-height: 1;
}

.total-inscriptions .total-number {
    margin-top: 0;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    color: var(--bg);
    background: var(--success);
    border-radius: 10px;
    padding: 4px 8px;
}


table {
    width: 100%;
    border-collapse: collapse;
}

.category-row th {
    background: linear-gradient(90deg, #61e5ff 0%, #29ddff 50%, #61e5ff 100%);
    color: #000;
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    padding: 14px 12px;
    letter-spacing: 0.6px;
}

.head-row th {
    background: #000;
    color: #fff;
    font-size: 16px;
    text-transform: uppercase;
    text-align: left;
    padding: 12px;
    border-right: 1px solid #333;
}

.head-row th:last-child {
    border-right: none;
}

td {
    background: #fff;
    padding: 12px;
    border: 1px solid var(--line);
    vertical-align: middle;
}

.pilot-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
}

.pilot-cell img {
    width: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #fff;
    display: block;
}

.pilot-name {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pilot-name:hover {
    color: var(--mir-blue);
    text-decoration: underline;
}

.pilot-image-link {
    display: inline-block;
    line-height: 0;
}

.pilot-image-link img {
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.pilot-image-link:hover img {
    border-color: var(--mir-blue);
    transform: scale(1.02);
}

.cell-center {
    text-align: center;
    font-weight: 700;
    min-width: 120px;
}

.col-action {
    text-align: center;
    vertical-align: middle;
    min-width: 112px;
}

.col-action form {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.btn-dark {
    background: #000;
    color: #fff;
}

.btn-dark.active {
    background: #29ddff;
    color: #000;
}

.wildcard-mode .preview-box {
    display: none;
}

.form-bottom-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.wildcard-btn-inline {
    height: 44px;
    min-width: 140px;
    white-space: nowrap;
}

.btn-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:10px;
}

.btn-icon svg{
    width:18px;
    height:18px;
    fill:white;
}

.btn-edit {
    background: #1b8f3b;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: #22ad49;
    transform:scale(1.08);
}

.btn-edit svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.action-buttons form {
    margin: 0;
}

.pilot-suggestions {
    display: none;
    position: fixed;
    z-index: 99999;
    width: min(760px, calc(100vw - 32px));
    max-height: 60vh;
    overflow-y: auto;
    background: #171717;
    border: 1px solid rgba(41, 221, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 6px;
}

.pilot-suggestion-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
}

.pilot-suggestion-item:hover,
.pilot-suggestion-item:focus {
    background: rgba(41, 221, 255, 0.22);
    outline: none;
}

.btn-excel {
    background: #1D6F42;
    color: #fff;
}

.btn-excel:hover {
    background: #248a52;
    color: #fff;
}

.btn-save {
    background: #1b8f3b;
    color: #fff;
    min-width: 140px;
    height: 44px;
}

.btn-save:hover {
    background: #21a747;
    color: #fff;
}

.btn-wildcard {
    background: var(--mir-blue);
    color: #000;
    min-width: 140px;
    height: 44px;
}

.btn-wildcard:hover {
    background: #61e5ff;
    color: #000;
}

.btn-wildcard.active {
    background: #ffd400;
    color: #000;
}

@media (max-width: 1200px) {
    .wildcard-btn-inline {
        width: 100%;
    }
}

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

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .wildcard-btn-inline {
        width: 100%;
    }
    .form-bottom-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-bottom-left,
    .form-bottom-right {
        width: 100%;
    }

    .form-bottom-left .btn,
    .form-bottom-right .btn {
        width: 100%;
    }
    .total-inscriptions {
    gap: 16px;
    }

    .total-inscriptions .line {
        max-width: 120px;
    }

    .total-inscriptions .total-label {
        font-size: 16px;
    }

    .total-inscriptions .total-number {
        font-size: 38px;
    }
}