/* LOGIN OVERLAY */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: #0a0a0a;
    padding: 3rem;
    border: 1px solid var(--accent);
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.1);
    width: 90%;
    max-width: 400px;
}

input {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 0.8rem;
    margin: 1rem 0;
    width: 100%;
    font-family: inherit;
}

button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
}

/* MAIN LAYOUT */
header {
    padding: 1.5rem 5%;
    background: #000;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    flex: 1;
    padding: 2rem 5%;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.admin-card {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 204, 0.1);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
}

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

h2 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* KPI HEADER - MISSION CONTROL STYLE */
.kpi-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: #000;
    padding: 1.5rem 5%;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

.kpi-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.kpi-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-val {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.btn-kpi {
    background: transparent;
    color: #88ff88;
    padding: 0.3rem 0.8rem;
    border: 1px solid #88ff88;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.btn-kpi:hover {
    background: #88ff88;
    color: #000;
}

/* SUSTAINABILITY METER */
.bio-meter-container {
    width: 100%;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(136, 255, 136, 0.2);
}

.bio-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #004a00, #88ff88);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(136, 255, 136, 0.5);
}

/* TABS */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: #111;
    color: #888;
    border: 1px solid #333;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
}

.tab-btn:hover {
    color: #fff;
    background: #222;
}

.tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: bold;
    box-shadow: 0 -2px 10px rgba(0, 255, 204, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* TICKET CARDS */
.ticket-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-list::-webkit-scrollbar {
    width: 6px;
}

.ticket-list::-webkit-scrollbar-thumb {
    background: #333;
}

.ticket-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid #222;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-left: 4px solid #555;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.ticket-card:hover {
    border-color: var(--accent);
    background: rgba(0, 255, 204, 0.03);
    transform: translateX(5px);
}

.ticket-card.selected {
    border-color: var(--accent);
    background: rgba(0, 255, 204, 0.08);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.1);
}

.ticket-card.falla-forense {
    border-left-color: var(--danger);
}

.ticket-card.mantenimiento {
    border-left-color: #4444ff;
}

.ticket-card.recuperacion {
    border-left-color: #ffaa00;
}

.ticket-card.generico {
    border-left-color: #888;
}

.tc-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: #888;
}

.tc-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.tc-symptoms {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete {
    color: var(--danger);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    display: block;
    width: auto;
    padding: 0;
    text-align: left;
}

/* FORMS */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    opacity: 0.8;
}

/* TERMINAL BITACORA STYLE */
#bitacora-history {
    background: #050505;
    border: 1px solid #222;
    color: #00ff41; /* Classic Matrix/Terminal Green */
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 1.5rem;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.4;
    border-radius: 4px;
    box-shadow: inset 0 0 10px #000;
}

#bitacora-history div {
    margin-bottom: 0.8rem;
    border-left: 2px solid #1a1a1a;
    padding-left: 10px;
}

.log-date {
    color: #008f11;
    font-weight: bold;
    margin-right: 8px;
}

.log-msg {
    color: #88ff88;
}

/* PROGRESS BAR IN CARDS */
.card-progress-bg {
    width: 100%;
    height: 4px;
    background: #222;
    margin-top: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.5s ease;
}

/* PREVIEW CERTIFICADO */
#cert-preview {
    background: #fff;
    color: #000;
    padding: 3rem;
    margin-top: 2rem;
    display: none;
    font-family: 'Times New Roman', serif;
    position: relative;
}

.cert-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.seal-watermark {
    position: absolute;
    opacity: 0.1;
    top: 30%;
    left: 30%;
    width: 40%;
    pointer-events: none;
}

footer {
    padding: 2rem;
    background: #000;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    color: #444;
}

@media (max-width: 1000px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .kpi-header {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .admin-card {
        padding: 1.5rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .tc-title {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    #ticket-modal {
        padding: 1rem;
    }
    
    #ticket-modal > div {
        padding: 1.5rem !important;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #ticket-modal,
    #ticket-modal * {
        visibility: visible;
    }

    #ticket-modal {
        position: absolute;
        left: 0;
        top: 0;
        padding: 0;
        background: none;
    }

    .no-print {
        display: none !important;
    }
}

/* BARRA DE BÚSQUEDA */
.search-container {
    margin-bottom: 1rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 4px;
}

.search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}
