/* JP Traducciones — Modern Professional UI */

:root {
    --sidebar-width: 260px;
    --primary: #1e3a5f;
    --primary-light: #2a5f9e;
    --primary-soft: #e8f0fe;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --bg: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 10px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ──────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255,255,255,0.05);
    position: relative;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.sidebar-header h5 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h5 i {
    font-size: 1.3rem;
    color: var(--accent);
}

.sidebar-header small {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#sidebar .nav {
    padding: 0.75rem 0.75rem;
    flex-grow: 1;
}

#sidebar .nav-item {
    margin-bottom: 2px;
}

#sidebar .nav-link {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 450;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

#sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(2px);
}

#sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

#sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}

#sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.1);
}

.sidebar-footer .text-muted {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.8rem;
}

.sidebar-footer .btn-outline-light {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-footer .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

#sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* ── Signing Path Cards ──────────────────────────────── */
.signing-path-card {
    transition: box-shadow 0.25s, transform 0.25s;
}
.signing-path-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* ── Top Navigation Bar ──────────────────────────────── */
#page-content {
    min-height: 100vh;
    background: var(--bg);
    flex-grow: 1;
}

#page-content > .navbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 1.25rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#page-content > .navbar .navbar-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

#sidebarToggle {
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    transition: var(--transition);
}

#sidebarToggle:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header h5 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards (Dashboard) */
.stat-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    opacity: 0;
    transition: opacity 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .fs-3 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-card .text-muted {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Status Badges ────────────────────────────────────── */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

.bg-orange { background-color: #fb923c !important; }
.bg-purple { background-color: #8b5cf6 !important; }
.bg-teal { background-color: #14b8a6 !important; }

/* ── Tables ───────────────────────────────────────────── */
.table {
    font-size: 0.9rem;
}

.table th {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 0.85rem 1rem;
    background: var(--surface-hover);
}

.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr {
    transition: background-color 0.15s;
}

.table-hover tbody tr:hover {
    background-color: var(--primary-soft) !important;
}

.table a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.table a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ── Forms ────────────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--surface);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-text, .form-control-plaintext {
    font-size: 0.825rem;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.15rem;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(59,130,246,0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(16,185,129,0.25);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16,185,129,0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    border: none;
    color: #fff;
}

.btn-warning:hover {
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    padding: 0.85rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border-left: 4px solid var(--info);
}

/* ── Login Page ───────────────────────────────────────── */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #2a5f9e 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(6,182,212,0.1) 0%, transparent 50%);
    animation: loginShimmer 15s ease-in-out infinite alternate;
}

@keyframes loginShimmer {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, 2%) rotate(1deg); }
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card h3 {
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.5rem;
}

.login-card h3 i {
    color: var(--accent);
}

.login-card .text-muted {
    font-size: 0.9rem;
}

.login-card .form-control {
    padding: 0.7rem 1rem;
}

.login-card .btn-primary {
    padding: 0.75rem;
    font-size: 1rem;
}

/* ── Workflow Timeline ────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 35px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--border) 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.25rem;
    padding-left: 18px;
    padding-bottom: 0.25rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item:last-child::before {
    background: var(--border);
    box-shadow: 0 0 0 2px var(--border);
}

/* ── File Version List ────────────────────────────────── */
.version-item {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--surface-hover);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: var(--transition);
}

.version-item:hover {
    background: var(--primary-soft);
    border-left-color: var(--accent-hover);
}

/* ── Modals ────────────────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
    padding: 1.15rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background: var(--surface-hover);
}

.modal-backdrop.show {
    opacity: 0.4;
    backdrop-filter: blur(4px);
}

/* ── Toast Notifications ──────────────────────────────── */
#toast-container {
    z-index: 10000 !important;
}

#toast-container .toast {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: none;
    font-size: 0.875rem;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── List Groups ──────────────────────────────────────── */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.85rem 1.25rem;
    transition: background 0.15s;
}

.list-group-item:hover {
    background: var(--surface-hover);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ── Nav Tabs (request detail) ────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--accent);
    border-bottom-color: rgba(59,130,246,0.3);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* ── Page Headings ────────────────────────────────────── */
h1, h2, h3 {
    letter-spacing: -0.02em;
}

h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

h5 {
    font-weight: 700;
}

/* ── Scrollbar (Webkit) ───────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Verification Page ────────────────────────────────── */
.verify-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.verify-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.verify-header {
    background: linear-gradient(135deg, #0f172a 0%, var(--primary) 40%, var(--primary-light) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.verify-header h1 {
    color: white;
    font-size: 1.8rem;
}

.verify-body {
    padding: 2rem;
}

.verify-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.verify-label {
    width: 40%;
    font-weight: 600;
    color: var(--text-muted);
}

.verify-value {
    width: 60%;
}

/* ── Utility ──────────────────────────────────────────── */
.text-accent { color: var(--accent) !important; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 0 2px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.pagination .page-link:hover {
    background: var(--primary-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 1000;
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.show {
        margin-left: 0;
        box-shadow: var(--shadow-xl);
    }

    .stat-card .card-body {
        padding: 0.85rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .verify-container {
        margin: 20px auto;
    }

    h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .verify-row {
        flex-direction: column;
    }
    .verify-label, .verify-value {
        width: 100%;
    }
}
