/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    min-height: 100vh;
}

/* ===== Header ===== */
header {
    background-color: #E30614;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    color: white;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-logout {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: white;
    color: #E30614;
}

/* ===== Main Layout ===== */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* ===== Page Title ===== */
.page-title {
    font-size: 28px;
    color: #333;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.stat-icon.motos {
    background-color: rgba(227, 6, 20, 0.1);
}

.stat-icon.carros {
    background-color: rgba(255, 205, 28, 0.15);
}

.stat-icon.ingresos {
    background-color: rgba(46, 184, 92, 0.1);
}

.stat-icon.activas {
    background-color: rgba(0, 123, 255, 0.1);
}

.stat-info h3 {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-info .stat-change {
    font-size: 12px;
    color: #2eb85c;
    font-weight: 600;
    margin-top: 2px;
}

.stat-info .stat-change.negative {
    color: #E30614;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    color: #333;
    font-weight: 700;
    position: relative;
    padding-left: 14px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #E30614, #FFCD1C);
    border-radius: 2px;
}

/* ===== Panel Cards ===== */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-body {
    padding: 0;
}

/* ===== Search/Filter Bar ===== */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #E30614;
    box-shadow: 0 0 0 3px rgba(227, 6, 20, 0.1);
}

.btn-search {
    background-color: #E30614;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-search:hover {
    background-color: #c20410;
    transform: translateY(-1px);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    font-family: inherit;
    color: #555;
}

.filter-select:focus {
    outline: none;
    border-color: #E30614;
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background-color: #f8f9fa;
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #f0f0f0;
}

.data-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #fafbfc;
}

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

.data-table tbody td {
    padding: 14px 20px;
    font-size: 14px;
    color: #444;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background-color: rgba(46, 184, 92, 0.12);
    color: #1e8449;
}

.badge-expired {
    background-color: rgba(227, 6, 20, 0.1);
    color: #E30614;
}

.badge-pending {
    background-color: rgba(255, 205, 28, 0.2);
    color: #b8860b;
}

/* ===== Vehicle Type Badge ===== */
.vehicle-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.vehicle-type .icon {
    font-size: 18px;
}

/* ===== Action Buttons ===== */
.btn-action {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: all 0.15s ease;
}

.btn-action:hover {
    background-color: #E30614;
    color: white;
    border-color: #E30614;
}

.btn-action.btn-view {
    color: #E30614;
    border-color: #E30614;
}

.btn-action.btn-view:hover {
    background-color: #E30614;
    color: white;
}

/* ===== Two Column Layout ===== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ===== Subscription Lookup Section ===== */
.lookup-form {
    padding: 24px;
}

.lookup-form .form-group {
    margin-bottom: 16px;
}

.lookup-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lookup-form input,
.lookup-form select {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lookup-form input:focus,
.lookup-form select:focus {
    outline: none;
    border-color: #E30614;
    box-shadow: 0 0 0 3px rgba(227, 6, 20, 0.1);
}

.btn-lookup {
    background-color: #FFCD1C;
    color: #333;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 8px;
}

.btn-lookup:hover {
    background-color: #FFB300;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
}

/* ===== Lookup Result (placeholder) ===== */
.lookup-result {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.lookup-result .result-placeholder {
    text-align: center;
    color: #bbb;
}

.lookup-result .result-placeholder .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.lookup-result .result-placeholder p {
    font-size: 14px;
    color: #aaa;
}

/* Result Card (shown when a result is found) */
.result-card {
    width: 100%;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #E30614;
}

.result-card .result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.result-card .result-row:last-child {
    border-bottom: none;
}

.result-card .result-label {
    color: #888;
    font-weight: 500;
}

.result-card .result-value {
    color: #333;
    font-weight: 600;
}

/* ===== Quick Stats (mini) ===== */
.quick-stats {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
}

.quick-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.quick-stat .qs-number {
    font-size: 22px;
    font-weight: 700;
    color: #E30614;
}

.quick-stat .qs-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

/* ===== Date Indicator ===== */
.date-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.date-indicator .date-icon {
    font-size: 16px;
}

/* ===== Pie Chart ===== */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 40px 30px;
}

.pie-chart-wrapper {
    flex-shrink: 0;
}

.pie-chart {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: background 0.4s ease;
}

.pie-center {
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

.pie-total-number {
    font-size: 32px;
    font-weight: 800;
    color: #333;
    line-height: 1;
}

.pie-total-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.diario {
    background-color: #E30614;
}

.legend-color.semanal {
    background-color: #FFCD1C;
}

.legend-color.mensual {
    background-color: #333333;
}

.legend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-label {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.legend-value {
    font-size: 13px;
    color: #888;
}

.legend-percent {
    font-size: 13px;
    font-weight: 600;
    color: #E30614;
}

/* ===== Registro Manual Form ===== */
.registro-manual-form {
    padding: 24px;
}

.registro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.registro-manual-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.registro-manual-form .form-group input,
.registro-manual-form .form-group select {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.registro-manual-form .form-group input:focus,
.registro-manual-form .form-group select:focus {
    outline: none;
    border-color: #E30614;
    box-shadow: 0 0 0 3px rgba(227, 6, 20, 0.1);
}

.btn-registrar {
    background-color: #2eb85c;
    color: white;
    border: none;
    padding: 13px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    width: 100%;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-registrar:hover {
    background-color: #249a4d;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(46, 184, 92, 0.3);
}

.btn-registrar:disabled {
    background-color: #a0d8b0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.registro-exito {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(46, 184, 92, 0.1);
    border-radius: 8px;
    border-left: 4px solid #2eb85c;
    animation: slideIn 0.3s ease;
}

.registro-exito.hidden {
    display: none;
}

.exito-icon {
    font-size: 20px;
}

.exito-msg {
    font-size: 14px;
    color: #1e8449;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Footer ===== */
footer {
    background-color: #f9f9f9;
    color: #666;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    margin-top: 40px;
}

footer p {
    font-size: 13px;
}

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

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

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
    }

    .header-content {
        padding: 0 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo-img {
        height: 40px;
    }

    .logo-text {
        font-size: 14px;
    }

    .header-nav {
        gap: 8px;
    }

    .admin-badge {
        display: none;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .admin-container {
        padding: 20px 16px;
    }

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

    .search-bar {
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .panel-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        font-size: 13px;
        min-width: 700px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .page-title {
        font-size: 22px;
    }

    .chart-container {
        flex-direction: column;
        gap: 30px;
    }

    .pie-chart {
        width: 180px;
        height: 180px;
    }

    .pie-center {
        width: 105px;
        height: 105px;
    }

    .pie-total-number {
        font-size: 26px;
    }

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

    .quick-stats {
        flex-wrap: wrap;
    }
}