/* users.css - Consolidated Styles for Users Section */

/* ===== GLOBAL & LAYOUT ===== */
html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.app-content {
    flex: 1;
    width: 100%;
    padding-top: 0;
}

.page-wrapper {
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ===== HEADER (from header.php) ===== */
.app-header {
    background: #0f172a;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.header-logo img {
    display: block;
    height: 56px;
    width: auto;
    max-width: min(220px, 28vw);
    object-fit: contain;
}

.header-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 600;
    margin-right: 16px;
}

.header-nav a:hover {
    color: #fff;
}

.app-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ced4da;
    font-size: 0.9em;
}

.app-switch-label {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f8f9fa;
}

.app-switch-link,
.app-switch-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.app-switch-link {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.app-switch-link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.app-switch-current {
    color: #0f172a !important;
    background: #f8fafc;
    border-color: #f8fafc;
    font-weight: 700;
}

.user-info {
    color: #e5e7eb;
    font-size: 0.9em;
}

.btn-pass {
    color: #adb5bd;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.btn-pass:hover {
    color: white;
    text-decoration: underline;
}

.emoji-icon-inline {
    height: 1.1em;
    width: auto;
    vertical-align: text-bottom;
    margin-right: 5px;
    display: inline-block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-info .username {
    font-weight: 700;
    font-size: 14px;
}

.logout-btn {
    background: #ef4444;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

.logout-btn:hover {
    background: #dc2626;
}

/* ===== FOOTER (from footer.php) ===== */
.app-footer {
    margin-top: auto;
    background: #0f172a;
    color: #fff;
    padding: 16px 20px;
    text-align: center;
    font-size: 13px;
}

.footer-inner {
    max-width: 920px;
    margin: 0 auto;
}

.footer-copy {
    font-weight: 600;
}

.footer-details {
    margin-top: 6px;
    opacity: 0.85;
    font-size: 12px;
    line-height: 1.4;
}

.footer-summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.footer-summary span:first-child {
    text-decoration: underline;
}

.footer-links {
    margin-top: 6px;
    opacity: 0.85;
}

.footer-links a {
    color: inherit;
    text-decoration: underline;
}

/* ===== MODERN TABLE (Standardized) ===== */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.modern-table thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.modern-table th {
    padding: 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000000 !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc !important;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    vertical-align: middle;
}

.modern-table tr:hover {
    background-color: #f8fafc;
}

/* Center utility */
.table-center th,
.table-center td {
    text-align: center !important;
}

/* ===== INFO BOX ===== */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0 20px;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-box::before {
    content: "ℹ";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

/* ===== COMPONENTS ===== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

input:focus,
select:focus {
    border-color: #007cba;
    outline: none;
}

/* Labels */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
}

/* Filters (Index) */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

/* ===== STATUS BADGES ===== */
.pilot-status,
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    display: inline-block;
    text-align: center;
}

.pilot-unassigned,
.status-unassigned {
    background: #6c757d;
}

.pilot-accepted,
.status-accepted {
    background: #007cba;
}

.pilot-completed,
.status-completed {
    background: #16a34a;
}

.pilot-cancelled,
.status-cancelled {
    background: #dc3545;
}

.pilot-pending-approval {
    background: #fd7e14;
}

.pilot-pending-quote {
    background: #fd7e14;
}

/* ===== PROGRESS BARS ===== */
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    height: 16px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 20px;
    transition: width 0.3s ease;
}

.progress-low {
    background: #dc3545;
}

.progress-mid {
    background: #fd7e14;
}

.progress-high {
    background: #28a745;
}

/* ===== LOGIN PAGE (login.php) ===== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    background: white;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    width: min(100%, 240px);
    height: auto;
    margin-bottom: 20px;
}

.login-title {
    margin-top: 0;
    color: #007cba;
    margin-bottom: 25px;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin: 15px 0;
    text-align: left;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ===== PROFILE PAGE (profile.php) ===== */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.section-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f9fafb;
}

.section-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.form-group {
    margin-bottom: 15px;
}

/* ===== PAGINATION ===== */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.page-btn {
    padding: 10px 15px;
    margin: 0 3px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
}

.page-btn.active,
.page-btn:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* ===== ACTION BUTTONS ===== */
.btn-exp {
    background: #007cba;
    color: #fff;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-exp:hover {
    background: #005a87;
}

.accept-btn {
    background: #28a745;
    color: #fff;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.accept-btn:hover {
    background: #218838;
}

.accept-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 10px 0 20px;
    text-align: center;
    font-weight: 600;
}

.waiting-admin {
    color: #155724;
    font-weight: 600;
    font-size: 12px;
}

/* ===== REQUEST DETAILS (req.php) ===== */
.details-wrapper {
    max-width: 900px;
    margin: 30px auto;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.details-header h1 {
    margin: 0;
    font-size: 24px;
    color: #0f172a;
}

.details-back {
    text-decoration: none;
    color: #007cba;
    font-weight: 600;
}

.details-empty {
    padding: 40px;
    text-align: center;
    color: #64748b;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ===== SORT LINKS (Index) ===== */
.sort-link {
    color: #000000 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.sort-link:hover {
    color: #1e40af;
    text-decoration: none;
}

.sort-arrow {
    font-size: 12px;
}

/* Col specifics */
.col-reg {
    white-space: normal;
    word-break: break-word;
}

/* ===== VIEW EXPENSES (view_expenses.php) ===== */
.progress-info {
    background: #eff6ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007cba;
}

.total-expenses {
    margin-top: 20px;
    font-weight: bold;
    font-size: 18px;
    text-align: right;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    color: #28a745;
}

.no-expenses {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: 14px 18px;
    }

    .header-logo img {
        height: 46px;
        max-width: 180px;
    }

    .page-wrapper {
        padding: 10px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: left;
    }

    /* Table Responsive Scroll */
    .table-wrapper {
        overflow-x: auto;
    }

    .modern-table th,
    .modern-table td {
        font-size: 12px;
        padding: 10px;
    }
}

/* ===== BLINKING ROW (Waiting Downpayment) ===== */
.waiting-payment-row td {
    border-top: 2px solid #dc3545 !important;
    border-bottom: 2px solid #dc3545 !important;
    animation: blinkRowRed 1.5s infinite;
}

.waiting-payment-row td:first-child {
    border-left: 2px solid #dc3545 !important;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.waiting-payment-row td:last-child {
    border-right: 2px solid #dc3545 !important;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

@keyframes blinkRowRed {

    0%,
    100% {
        border-color: #dc3545;
        background-color: rgba(220, 53, 69, 0.08);
        /* Fondo rojo muy suave */
    }

    50% {
        border-color: transparent;
        background-color: transparent;
    }
}

/* Global Alert Banner */
.global-alert-banner {
    position: fixed;
    top: calc(var(--orion-topbar-height, 62px) + 8px);
    left: 0;
    right: 0;
    z-index: 1101;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.global-alert-banner + .app-content {
    padding-top: calc(var(--orion-topbar-height, 62px) + 8px + 80px) !important;
}

.global-alert-header {
    padding: 6px 20px;
    font-size: 0.75em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.global-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 12px;
}

.global-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.global-alert-icon {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.global-alert-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.global-alert-text strong {
    font-size: 0.95em;
    color: #ffffff;
}

.global-alert-body {
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.global-alert-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.global-alert-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}
