﻿/* == MANTENIMIENTOS == */

.mant-page {
    width: 100%;
    max-width: 100%;
}

.mant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.mant-header-text {
    flex: 1;
    min-width: 0;
}

.mant-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
}

.mant-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    max-width: 700px;
}

.mant-actions-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mant-btn-export {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mant-btn-export:hover {
    background: #f3f4f6;
}

.mant-btn-primary {
    background-color: #e02020;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    text-decoration: none;
}

.mant-btn-primary:hover {
    background-color: #c01a1a;
    color: #fff;
}

/* Tabs */
.mant-tabs {
    display: inline-flex;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.mant-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
}

.mant-tab:hover {
    color: #1a1a1a;
}

.mant-tab.active {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* Cards */
.mant-cards {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.mant-cards-4 {
    grid-template-columns: repeat(4, 1fr);
}

.mant-cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

.mant-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mant-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.mant-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
}

.mant-card-icon {
    font-size: 1.25rem;
    color: #9ca3af;
}

.mant-card-icon-red {
    color: #e02020;
}

.mant-card-icon-yellow {
    color: #f59e0b;
}

.mant-card-icon-blue {
    color: #3b82f6;
}

.mant-card-icon-green {
    color: #10b981;
}

/* Filters */
.mant-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.mant-btn-clear {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mant-btn-clear:hover {
    background: #f3f4f6;
}

.mant-filter {
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    color: #374151;
}

.mant-filter-text {
    cursor: text;
    min-width: 220px;
}

.mant-sort {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    color: #374151;
    margin-bottom: 1rem;
}

/* Table */
.mant-table-wrapper {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: auto;
}

.mant-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: auto;
}

.mant-table thead tr {
    border-bottom: 1px solid #e5e7eb;
}

.mant-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.mant-table td {
    padding: 1rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    white-space: nowrap;
}

.mant-table tbody tr:last-child td {
    border-bottom: none;
}

.mant-table tbody tr {
    transition: background-color 0.15s ease;
    cursor: pointer !important;
}

.mant-table tbody td {
    cursor: pointer !important;
}

.mant-table tbody tr:hover {
    background-color: #f9fafb;
}

.mant-icon-wrapper {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.1rem;
}

.matricula-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f3f4f6;
    color: #1a1a1a;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.mant-marca-modelo {
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}

.mant-mobile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.mant-mobile-clickable {
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mant-mobile-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.mant-mobile-content {
    padding: 0.9rem 1rem;
}

.mant-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.26rem 0;
}

.mant-mobile-label {
    font-size: 0.95rem;
    color: #6b7280;
    flex: 0 0 auto;
}

.mant-mobile-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
    min-width: 0;
    max-width: 68%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .mant-cards-4,
    .mant-cards-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mant-header {
        flex-direction: column;
        gap: 1rem;
    }

    .mant-actions-top {
        width: 100%;
    }

    .mant-btn-export,
    .mant-btn-primary {
        flex: 1;
        justify-content: center;
    }

    .mant-cards-4,
    .mant-cards-3 {
        grid-template-columns: 1fr;
    }

    .mant-filters {
        flex-direction: column;
    }

    .mant-filter,
    .mant-filter-text {
        width: 100%;
        box-sizing: border-box;
    }

    .mant-table-wrapper {
        display: none;
    }

    .mant-table {
        display: none;
    }

    .mant-mobile-list {
        display: block;
        width: 100%;
    }
}

/* == PROGRAMAR MANTENIMIENTO == */

.pm-page {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pm-page .EditForm,
.pm-page form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pm-section {
    flex: 1;
    min-width: 0;
}

.pm-actions {
    margin-top: auto;
}

@media (max-width: 768px) {
    .pm-page {
        gap: 0.75rem;
    }

    .nt-row-2 {
        grid-template-columns: 1fr;
    }

    .nt-field-full {
        margin-top: 0.5rem;
    }

    .pm-actions {
        flex-direction: column-reverse;
        justify-content: stretch;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .pm-actions .nt-btn-cancel,
    .pm-actions .nt-btn-save {
        width: 100%;
        justify-content: center;
    }
}
