/* Usami CRA - System Design & Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #5c17e6;
    --primary-hover: #4b10c5;
    --primary-light: #f4effd;
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    
    /* Badges */
    --badge-green-bg: #d1fae5;
    --badge-green-text: #065f46;
    --badge-yellow-bg: #fef3c7;
    --badge-yellow-text: #92400e;
    --badge-red-bg: #fee2e2;
    --badge-red-text: #991b1b;
    --badge-gray-bg: #f1f5f9;
    --badge-gray-text: #475569;
    --badge-blue-bg: #dbeafe;
    --badge-blue-text: #1e40af;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-footer-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-footer-logo {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.sidebar-version {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.05em;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-logout svg {
    width: 16px;
    height: 16px;
}

.sidebar-logout:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 2px;
    margin-top: 2px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    border-left: 4px solid var(--primary);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
}

.sidebar-submenu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0.25rem 0 0.25rem 1.9rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-sublink {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-sublink:hover, .sidebar-sublink.active {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-sublink.active {
    color: var(--primary);
    font-weight: 700;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

/* Header */
.topbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-status-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .header-status-badges {
        display: none;
    }
}

/* Demo Tenant Switcher */
.tenant-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-light);
    border: 1px solid rgba(92, 23, 230, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

.tenant-switcher label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.tenant-switcher select {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Demo Role/Profile Switcher */
.role-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff7ed;
    border: 1px solid rgba(217, 119, 6, 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

.role-switcher label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #b45309;
}

.role-switcher select {
    background: transparent;
    border: none;
    color: #b45309;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Container */
.content-container {
    padding: 2rem;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Prevent unsized SVGs inside page content from blowing up the layout.
   Sidebar and credential SVGs are explicitly sized via their own rules. */
.content-container svg:not([width]):not([height]):not(.search-icon-svg) {
    max-width: 100%;
    height: auto;
}

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-details h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-icon.warning {
    background-color: var(--badge-yellow-bg);
    color: var(--badge-yellow-text);
}

.stat-icon.danger {
    background-color: var(--badge-red-bg);
    color: var(--badge-red-text);
}

/* Tab System (Reference Screenshots) */
.tab-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tab-header-wrapper {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem 0 1.5rem;
}

.tab-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tab-headers {
    display: flex;
    gap: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 8px 8px 0 0;
    transition: color 0.15s, background-color 0.15s;
}

.tab-button:hover {
    color: var(--text-main);
    background-color: var(--bg-app);
}

.tab-button.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

.tab-icon {
    flex-shrink: 0;
}

/* Separador vertical entre los grupos de pestañas principales */
.tab-separator {
    width: 2px;
    align-self: stretch;
    margin: 0.5rem 0.5rem 0.75rem;
    background-color: var(--border-color);
    border-radius: 1px;
}

.tab-body {
    padding: 1.5rem;
}

/* Search Bar & Action Header */
.action-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92, 23, 230, 0.15);
}

.search-icon-svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-action:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Dropdown Trigger Button */
.btn-dropdown {
    position: relative;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-green {
    background-color: var(--badge-green-bg);
    color: var(--badge-green-text);
}

.badge-yellow {
    background-color: var(--badge-yellow-bg);
    color: var(--badge-yellow-text);
}

.badge-red {
    background-color: var(--badge-red-bg);
    color: var(--badge-red-text);
}

.badge-gray {
    background-color: var(--badge-gray-bg);
    color: var(--badge-gray-text);
}

.badge-blue {
    background-color: var(--badge-blue-bg);
    color: var(--badge-blue-text);
}

/* Three-dot action menu */
.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu-toggle {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-menu-toggle:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.action-menu-dropdown {
    display: none;
    position: fixed;
    min-width: 170px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(15, 23, 42, 0.12));
    z-index: 9999;
    overflow: hidden;
}

.action-menu-dropdown.show {
    display: block;
}

.action-menu-dropdown a,
.action-menu-dropdown button,
.action-menu-dropdown .action-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    background: none;
    border: none;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease;
}

.action-menu-dropdown a:hover,
.action-menu-dropdown button:hover,
.action-menu-dropdown .action-menu-item:hover {
    background-color: #f8fafc;
}

.action-menu-dropdown .action-menu-item.danger {
    color: var(--badge-red-text);
}

.action-menu-dropdown .action-menu-item.danger:hover {
    background-color: var(--badge-red-bg);
}

.action-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.25rem 0;
}

/* Table Style (Reference screenshots) */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tr.table-row:hover {
    background-color: #f8fafc;
}

.table-row {
    cursor: pointer;
}

.text-bold {
    font-weight: 700;
    color: var(--text-main);
}

/* Expandable row detail bar */
.detail-row {
    background-color: #f8fafc;
}

.detail-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border-color);
}

.detail-container {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f1f5f9;
    border-left: 4px solid var(--primary);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-info {
    font-size: 0.85rem;
}

.detail-info-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.detail-info-meta {
    color: var(--text-muted);
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.detail-stats {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 1rem;
}

/* Modal styling (Reference Cataloging Sheet) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 1.5rem;
}

.modal-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.2s ease-out;
}

.modal-card #resource-form, .modal-card #reader-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-main);
}

/* Tabs inside Modal */
.modal-tabs {
    display: flex;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem 0 1.5rem;
    gap: 1.5rem;
}

.modal-tab-button {
    background: none;
    border: none;
    padding: 0.75rem 0.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.modal-tab-button.active {
    color: var(--primary);
}

.modal-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #f8fafc;
}

/* Modal Form Fields Layout */
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group-full {
    grid-column: span 3;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92, 23, 230, 0.15);
}

.form-control.highlight-yellow {
    background-color: #fefce8;
    border-color: #fef08a;
}

.form-control.highlight-yellow:focus {
    border-color: #ca8a04;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.15);
}

/* Mandatory fields warning block */
.mandatory-warning-block {
    text-align: center;
    margin-bottom: 1.5rem;
}

.mandatory-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.mandatory-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Layout for Main + Side Image Preview */
.catalog-content-layout {
    display: flex;
    gap: 2rem;
}

.catalog-form-fields {
    flex: 1;
}

.catalog-image-preview-side {
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-placeholder-box {
    width: 140px;
    height: 190px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    text-align: center;
    padding: 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
}

.image-preview-box img {
    width: 140px;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Form section headers */
.form-section-header {
    grid-column: span 3;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
    text-align: center;
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.form-section-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Autocomplete Suggestion Dropdowns */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 250px;
    overflow-y: auto;
    list-style: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Print Styles for Credentials (ID-1/CR80 Standard: 85.6mm x 54mm) */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-credential-container, .print-credential-container * {
        visibility: visible;
    }
    
    .print-credential-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 85.6mm;
        height: 54mm;
        border: 1px solid #000000;
        box-shadow: none !important;
        margin: 0;
        padding: 4mm;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background-color: #ffffff;
        box-sizing: border-box;
        overflow: hidden;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    @page {
        size: 85.6mm 54mm;
        margin: 0;
    }
}

/* Screen Badge Display of Credential */
.screen-credential-preview {
    width: 340px;
    height: 215px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.credential-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 6px;
}

.credential-school-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
}

.credential-school-logo svg {
    height: 20px;
    width: auto;
}

.credential-body {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0;
}

.credential-photo {
    width: 65px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.credential-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.credential-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.credential-meta-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.credential-meta-val {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.credential-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.credential-barcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.credential-barcode svg {
    max-height: 30px;
    width: 100%;
}

.credential-barcode-num {
    font-size: 0.6rem;
    font-family: monospace;
    margin-top: 2px;
}

/* History logs list style */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.history-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    position: relative;
    border-left: 4px solid var(--primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.history-item-states {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.history-item-states span.arrow {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.history-item-notes {
    font-size: 0.8rem;
    color: var(--text-main);
    font-style: italic;
}

/* File Drop Area for CSV Upload */
.file-drop-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.file-drop-area:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.file-drop-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.file-drop-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.file-drop-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Split Loan Modal Layout */
.loan-split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    border-bottom: 1px solid var(--border-color);
}

.loan-left-sidebar {
    background-color: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.loan-right-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==================== Public Landing & Auth Pages ==================== */

.guest-body {
    display: block;
    overflow-x: visible;
    background-color: var(--bg-app);
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 4%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.landing-logo .logo-img {
    height: 64px;
    width: auto;
    display: block;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.landing-nav a.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.landing-nav a.nav-link:hover {
    color: var(--primary);
}

.landing-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero {
    padding: 5rem 4% 4.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-app) 100%);
}

.hero-eyebrow {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: 2.85rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.hero-tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.hero-description {
    max-width: 720px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.section {
    padding: 4.5rem 4%;
    max-width: 1180px;
    margin: 0 auto;
}

.section-alt {
    background-color: var(--bg-card);
}

.section-alt > .section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
}

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 2.75rem;
}

.section-eyebrow {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.benefits-grid,
.features-grid,
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.benefit-card,
.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.benefit-icon,
.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.benefit-icon svg,
.feature-icon svg {
    width: 24px;
    height: 24px;
}

.benefit-title,
.feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.benefit-text,
.feature-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.steps-grid {
    grid-template-columns: repeat(4, 1fr);
}

.step-card {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin: 0 auto 1rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.pricing-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.pricing-card.featured {
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Más Popular';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
}

.pricing-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.pricing-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    min-height: 2.6em;
}

.pricing-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.pricing-price span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pricing-limits {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

.pricing-features li svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.demo-banner {
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    color: #fff;
}

.demo-banner h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.demo-banner p {
    font-size: 1rem;
    opacity: 0.92;
    max-width: 620px;
    margin: 0 auto 1.5rem;
}

.faq-list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question .faq-icon {
    transition: transform 0.2s ease;
    color: var(--primary);
    font-size: 1.2rem;
}

.faq-item[open] .faq-question .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.contact-card {
    text-align: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
}

.contact-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.contact-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.landing-footer {
    text-align: center;
    padding: 2rem 4%;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Auth (login/register) pages */
.guest-wrapper {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.guest-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    width: 100%;
}

.guest-card.guest-card-sm {
    max-width: 440px;
}

.guest-card.guest-card-lg {
    max-width: 880px;
}

.guest-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.guest-card .guest-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.guest-form-section + .guest-form-section {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
}

.guest-form-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.plan-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.plan-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.plan-option:has(input:checked) {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.plan-option input {
    margin-right: 0.5rem;
}

.plan-option .plan-option-name {
    font-weight: 700;
    color: var(--text-main);
}

.plan-option .plan-option-price {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.guest-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.guest-footer-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.field-error {
    color: var(--badge-red-text);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

@media (max-width: 960px) {
    .benefits-grid,
    .features-grid,
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .benefits-grid,
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .landing-nav {
        display: none;
    }
}

/* ==================== Usami CRA Product Landing ==================== */
.library-landing {
    --landing-ink: #172033;
    --landing-muted: #667085;
    --landing-purple: #5c17e6;
    --landing-purple-dark: #3f0ca9;
    --landing-lilac: #f3efff;
    --landing-cyan: #52d6c8;
    background: #fff;
    color: var(--landing-ink);
    overflow: hidden;
}

.library-hero {
    min-height: 720px;
    padding: 6.5rem max(5vw, calc((100vw - 1240px) / 2)) 5rem;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(520px, 1.08fr);
    align-items: center;
    gap: 4rem;
    background:
        radial-gradient(circle at 78% 18%, rgba(82, 214, 200, .19), transparent 24%),
        radial-gradient(circle at 62% 62%, rgba(92, 23, 230, .12), transparent 34%),
        linear-gradient(135deg, #fbfaff 0%, #fff 48%, #f4fbfb 100%);
}

.library-kicker, .library-eyebrow {
    color: var(--landing-purple);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.library-kicker {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1.5rem;
}

.library-kicker span { width: 28px; height: 2px; background: var(--landing-cyan); }

.library-hero h1 {
    max-width: 650px;
    margin: 0 0 1.5rem;
    font-size: clamp(3.2rem, 5.1vw, 5.5rem);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 700;
}

.library-hero-content > p {
    max-width: 620px;
    margin: 0;
    color: var(--landing-muted);
    font-size: 1.12rem;
    line-height: 1.75;
}

.library-hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.3rem; }

.library-button {
    min-height: 52px;
    padding: .8rem 1.3rem;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    color: var(--landing-ink);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.library-button:hover { transform: translateY(-2px); }
.library-button svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.library-button-primary {
    background: var(--landing-purple);
    color: #fff;
    box-shadow: 0 12px 28px rgba(92, 23, 230, .25);
}
.library-button-primary:hover { background: var(--landing-purple-dark); }
.library-button-ghost { border-color: #d7dbe5; background: rgba(255, 255, 255, .76); }

.library-trust {
    margin-top: 3.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e7e8ee;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}
.library-trust div { display: flex; flex-direction: column; gap: .3rem; }
.library-trust strong { font-size: .82rem; }
.library-trust span { color: var(--landing-muted); font-size: .72rem; line-height: 1.4; }

.library-hero-visual {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.library-orbit { position: absolute; border: 1px solid rgba(92, 23, 230, .13); border-radius: 50%; }
.library-orbit-one { width: 580px; height: 580px; }
.library-orbit-two { width: 430px; height: 430px; border-color: rgba(82, 214, 200, .25); }

.library-preview {
    width: min(650px, 100%);
    min-height: 410px;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 66px 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 22px;
    background: #f7f8fc;
    box-shadow: 0 34px 70px rgba(38, 31, 64, .2);
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}

.library-preview-sidebar {
    padding: 1rem .8rem;
    background: #141c2f;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.preview-brand, .preview-avatar { display: grid; place-items: center; border-radius: 10px; font-weight: 800; }
.preview-brand {
    width: 34px; height: 34px; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--landing-purple), var(--landing-cyan));
    color: #fff;
}
.preview-nav { width: 24px; height: 7px; border-radius: 5px; background: #465067; }
.preview-nav.active { width: 34px; background: var(--landing-purple); }
.library-preview-main { min-width: 0; padding: 1.35rem; }
.preview-topbar { display: flex; align-items: center; justify-content: space-between; }
.preview-topbar div { display: flex; flex-direction: column; gap: .2rem; }
.preview-topbar small, .preview-panel-title span, .preview-activity span, .benefit-card-main small {
    color: #8891a4; font-size: .63rem;
}
.preview-topbar strong { font-size: 1rem; }
.preview-avatar { width: 32px; height: 32px; background: #e9e2ff; color: var(--landing-purple); font-size: .75rem; }

.preview-metrics { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.preview-metric {
    min-height: 96px;
    position: relative;
    padding: 1rem;
    overflow: hidden;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.preview-metric span { color: #8891a4; font-size: .62rem; }
.preview-metric strong { font-size: 1.35rem; }
.metric-icon {
    width: 36px; height: 36px; position: absolute; right: -8px; bottom: -8px;
    border-radius: 50%; opacity: .24;
}
.metric-purple { background: var(--landing-purple); }
.metric-blue { background: #3b82f6; }
.metric-green { background: #10b981; }

.preview-panels { margin-top: .75rem; display: grid; grid-template-columns: 1.5fr 1fr; gap: .75rem; }
.preview-chart, .preview-activity {
    min-height: 180px;
    padding: 1rem;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    background: #fff;
}
.preview-panel-title { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; }
.preview-bars {
    height: 112px;
    margin-top: 1rem;
    border-bottom: 1px solid #e6e8ee;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: .5rem;
}
.preview-bars i {
    width: 18px; border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, var(--landing-purple), #9c72f5);
}
.preview-activity { display: flex; flex-direction: column; gap: 1rem; font-size: .72rem; }
.preview-activity span { display: flex; align-items: center; gap: .45rem; }
.preview-activity i { width: 7px; height: 7px; border-radius: 50%; background: var(--landing-cyan); }

.library-floating-card {
    z-index: 3;
    position: absolute;
    padding: .8rem 1rem;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 13px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 35px rgba(33, 29, 50, .16);
    display: flex;
    align-items: center;
    gap: .7rem;
}
.library-floating-card div { display: flex; flex-direction: column; gap: .15rem; }
.library-floating-card strong { font-size: .72rem; }
.library-floating-card small { color: #8b93a5; font-size: .6rem; }
.floating-loan { left: -12px; bottom: 70px; }
.floating-status { right: -4px; top: 64px; }
.floating-icon {
    width: 28px; height: 28px; border-radius: 8px; background: #dcfce7; color: #15803d;
    display: grid; place-items: center; font-weight: 800;
}
.status-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #22c55e;
    box-shadow: 0 0 0 5px #dcfce7;
}

.library-intro {
    padding: 1.8rem max(5vw, calc((100vw - 1240px) / 2));
    border-top: 1px solid #ececf2;
    border-bottom: 1px solid #ececf2;
    background: #fff;
    text-align: center;
}
.library-intro p {
    margin-bottom: 1rem; color: #9aa1af; font-size: .69rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
}
.library-intro div { display: flex; justify-content: center; align-items: center; gap: 2.2rem; }
.library-intro span { color: #3c465a; font-size: .9rem; font-weight: 700; }
.library-intro i { width: 4px; height: 4px; border-radius: 50%; background: var(--landing-cyan); }

.library-problems {
    max-width: 1240px;
    margin: 0 auto;
    padding: 7rem 0 2rem;
}

.library-problems-heading {
    max-width: 780px;
    margin-bottom: 3rem;
}

.library-problems-heading h2 {
    margin: .7rem 0 1rem;
    font-size: clamp(2.3rem, 4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.library-problems-heading p {
    max-width: 660px;
    color: var(--landing-muted);
    line-height: 1.75;
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1rem;
}

.problem-grid article {
    grid-column: span 2;
    min-height: 230px;
    padding: 1.6rem;
    border-top: 3px solid var(--landing-purple);
    border-radius: 0 0 16px 16px;
    background: #f8f7fc;
}

.problem-grid article:nth-child(even) {
    border-top-color: var(--landing-cyan);
}

.problem-grid article > span {
    color: #a1a7b3;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.problem-grid h3 {
    margin: 2rem 0 .7rem;
    font-size: 1.08rem;
}

.problem-grid p {
    color: var(--landing-muted);
    font-size: .82rem;
    line-height: 1.65;
}

.library-section, .library-operation { max-width: 1240px; margin: 0 auto; padding: 7rem 0; }
.library-section-heading {
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-items: end;
    gap: 5rem;
}
.library-section-heading h2, .library-benefit-copy h2, .library-cta h2 {
    margin: .7rem 0 0;
    font-size: clamp(2.3rem, 4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}
.library-section-heading p, .library-benefit-copy > p { color: var(--landing-muted); line-height: 1.75; }

.library-module-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.library-module-card {
    grid-column: span 2;
    min-height: 290px;
    padding: 1.8rem;
    border: 1px solid #e7e8ee;
    border-radius: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.library-module-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(34, 27, 53, .09); }
.library-module-card.module-featured {
    grid-column: span 4;
    background: radial-gradient(circle at 92% 12%, rgba(82, 214, 200, .22), transparent 30%),
                linear-gradient(135deg, #f4f0ff, #fff);
}
.module-icon {
    width: 46px; height: 46px; margin-bottom: 2rem; border-radius: 13px;
    background: var(--landing-lilac); color: var(--landing-purple); display: grid; place-items: center;
}
.module-icon svg {
    width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.library-module-card > span {
    color: var(--landing-purple); font-size: .7rem; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
}
.library-module-card h3 { margin: .45rem 0 .75rem; font-size: 1.35rem; }
.library-module-card p { max-width: 520px; color: var(--landing-muted); font-size: .88rem; line-height: 1.65; }
.module-chips { margin-top: auto; padding-top: 1.5rem; display: flex; gap: .5rem; }
.module-chips i {
    padding: .35rem .65rem; border-radius: 999px; background: #fff; color: #687083;
    font-size: .68rem; font-style: normal; font-weight: 600;
}

.library-benefits {
    padding: 7rem max(5vw, calc((100vw - 1240px) / 2));
    background: #151d30;
    color: #fff;
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    align-items: center;
    gap: 7rem;
}
.library-benefit-copy > p { max-width: 570px; color: #adb6c8; }
.library-benefit-copy ul { margin-top: 2.5rem; list-style: none; display: flex; flex-direction: column; }
.library-benefit-copy li {
    padding: 1.15rem 0; border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex; gap: 1rem;
}
.library-benefit-copy li > span { color: var(--landing-cyan); font-size: .72rem; font-weight: 800; }
.library-benefit-copy li div { display: flex; flex-direction: column; gap: .35rem; }
.library-benefit-copy li small { color: #9da7ba; }

.library-benefit-visual { min-height: 480px; position: relative; display: grid; place-items: center; }
.benefit-book {
    width: 290px; height: 350px; position: absolute; border-radius: 14px 20px 20px 14px;
    transform-origin: bottom center;
}
.book-one { background: #5c17e6; transform: rotate(-18deg) translate(-90px, 8px); }
.book-two { background: #52d6c8; transform: rotate(14deg) translate(85px, -5px); }
.book-three { background: #fff; box-shadow: 0 30px 55px rgba(0, 0, 0, .28); }
.benefit-card-main {
    width: 250px; z-index: 2; padding: 1.5rem; border-radius: 15px; background: #fff;
    color: var(--landing-ink); display: flex; flex-direction: column; gap: .8rem;
}
.benefit-card-main > span { color: #828b9d; font-size: .7rem; }
.benefit-card-main strong { font-size: 1.7rem; }
.benefit-card-main > div { height: 7px; border-radius: 10px; background: #e8e9ee; overflow: hidden; }
.benefit-card-main i {
    height: 100%; display: block; border-radius: inherit;
    background: linear-gradient(90deg, var(--landing-purple), var(--landing-cyan));
}
.benefit-mini-card {
    z-index: 3; position: absolute; right: 5%; bottom: 14%; padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, .16); border-radius: 13px;
    background: rgba(30, 40, 62, .92); display: flex; flex-direction: column; gap: .2rem;
    box-shadow: 0 16px 35px rgba(0, 0, 0, .24);
}
.benefit-mini-card span { color: var(--landing-cyan); font-size: 1.3rem; font-weight: 800; }
.benefit-mini-card small { color: #abb4c6; }

.operation-heading { max-width: 760px; display: block; }
.operation-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.operation-steps::before {
    content: ''; position: absolute; top: 23px; left: 6%; right: 6%; height: 1px; background: #dfe1e8;
}
.operation-steps article { position: relative; padding-top: 4rem; }
.operation-steps article > span {
    width: 46px; height: 46px; position: absolute; top: 0; left: 0;
    border: 1px solid #dddfe7; border-radius: 50%; background: #fff;
    color: var(--landing-purple); display: grid; place-items: center; font-weight: 800;
}
.operation-steps h3 { margin-bottom: .65rem; font-size: 1.15rem; }
.operation-steps p { color: var(--landing-muted); font-size: .86rem; line-height: 1.65; }

.library-cta {
    max-width: 1240px;
    margin: 0 auto 5rem;
    padding: 4rem;
    border-radius: 26px;
    background: radial-gradient(circle at 88% 18%, rgba(82, 214, 200, .42), transparent 25%),
                linear-gradient(135deg, var(--landing-purple-dark), var(--landing-purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}
.library-cta .library-eyebrow { color: #aef4eb; }
.library-cta h2 { max-width: 750px; font-size: clamp(2.2rem, 3.6vw, 3.8rem); }
.library-cta p { margin-top: 1rem; color: #ded3fb; }
.library-button-light {
    flex-shrink: 0; background: #fff; color: var(--landing-purple-dark);
    box-shadow: 0 14px 30px rgba(26, 8, 78, .28);
}

.library-purchase {
    max-width: 1240px;
    margin: 0 auto 5rem;
    padding: 5rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at 10% 90%, rgba(82, 214, 200, .17), transparent 30%),
        #10182a;
    color: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
    align-items: center;
    gap: 6rem;
}

.purchase-intro h2 {
    max-width: 690px;
    margin: .7rem 0 1.2rem;
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.purchase-intro > p {
    max-width: 620px;
    color: #abb5c7;
    line-height: 1.75;
}

.purchase-security {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: .85rem;
}

.purchase-security > span {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(82, 214, 200, .16);
    color: var(--landing-cyan);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.purchase-security div {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.purchase-security small {
    color: #929db0;
}

.purchase-card {
    padding: 2.2rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 28px 60px rgba(0, 0, 0, .25);
    backdrop-filter: blur(10px);
}

.purchase-version {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.purchase-version span {
    color: var(--landing-cyan);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.purchase-version strong {
    padding: .35rem .65rem;
    border-radius: 999px;
    background: rgba(92, 23, 230, .35);
    font-size: .7rem;
}

.purchase-price {
    padding: 1.8rem 0 1.4rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.purchase-price small {
    grid-column: 1 / -1;
    margin-bottom: .4rem;
    color: #9ca7ba;
}

.purchase-price strong {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: -.045em;
}

.purchase-price span {
    color: var(--landing-cyan);
    font-weight: 800;
}

.purchase-breakdown {
    margin: -.45rem 0 1.5rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #9ca7ba;
    font-size: .72rem;
}

.purchase-breakdown span {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.purchase-breakdown strong {
    color: #dce2ed;
}

.purchase-card ul {
    margin-bottom: 1.6rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.purchase-card li {
    display: flex;
    gap: .7rem;
    color: #d9deea;
    font-size: .88rem;
}

.purchase-card li span {
    color: var(--landing-cyan);
    font-weight: 800;
}

.purchase-button {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.purchase-button:disabled {
    background: #596176;
    box-shadow: none;
    cursor: not-allowed;
    opacity: .8;
    transform: none;
}

.purchase-config-notice {
    margin-top: .85rem;
    padding: .75rem;
    border: 1px solid rgba(251, 191, 36, .24);
    border-radius: 9px;
    background: rgba(146, 64, 14, .18);
    color: #fde68a;
    font-size: .72rem;
    line-height: 1.45;
    text-align: center;
}

.purchase-note {
    margin-top: 1rem;
    display: block;
    color: #8994a8;
    text-align: center;
    line-height: 1.45;
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.purchase-form label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.purchase-form label > span {
    color: #cbd3e0;
    font-size: .72rem;
    font-weight: 700;
}

.purchase-form label > span small {
    color: #818ca0;
    font-weight: 500;
}

.purchase-form input {
    width: 100%;
    min-height: 44px;
    padding: .7rem .85rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    outline: none;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-family: inherit;
}

.purchase-form input::placeholder {
    color: #717c90;
}

.purchase-form input:focus {
    border-color: var(--landing-cyan);
    box-shadow: 0 0 0 3px rgba(82, 214, 200, .12);
}

.purchase-form label > small,
.purchase-alert {
    color: #fecaca;
    font-size: .7rem;
}

.purchase-alert {
    margin-bottom: 1rem;
    padding: .8rem;
    border: 1px solid rgba(248, 113, 113, .25);
    border-radius: 9px;
    background: rgba(127, 29, 29, .22);
    line-height: 1.45;
}

.purchase-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.payment-result {
    min-height: calc(100vh - 150px);
    padding: 5rem 1rem;
    background:
        radial-gradient(circle at 50% 20%, rgba(92, 23, 230, .14), transparent 30%),
        #f6f7fb;
    display: grid;
    place-items: center;
}

.payment-result-card {
    width: min(620px, 100%);
    padding: 3rem;
    border: 1px solid #e4e6ec;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 55px rgba(32, 27, 51, .12);
    text-align: center;
}

.payment-result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    font-weight: 800;
}

.payment-result-card.success .payment-result-icon { background: #dcfce7; color: #15803d; }
.payment-result-card.pending .payment-result-icon { background: #fef3c7; color: #a16207; }
.payment-result-card.failure .payment-result-icon { background: #fee2e2; color: #b91c1c; }

.payment-result-card h1 {
    margin: .65rem 0 1rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.payment-result-card > p {
    margin: 0 auto 1.8rem;
    color: #687083;
    line-height: 1.7;
}

.payment-reference {
    margin-bottom: 1.8rem;
    padding: 1rem;
    border-radius: 10px;
    background: #f3f4f7;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .82rem;
}

.payment-reference span { color: #7b8495; }

@media (max-width: 1280px) {
    .library-problems, .library-section, .library-operation, .library-cta, .library-purchase {
        margin-left: 5%;
        margin-right: 5%;
    }
    .library-hero { grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr); gap: 2rem; }
    .library-hero h1 { font-size: clamp(3rem, 5vw, 4.6rem); }
}

@media (max-width: 980px) {
    .landing-header { padding-left: 5%; padding-right: 5%; }
    .library-hero { padding-top: 4.5rem; grid-template-columns: 1fr; }
    .library-hero-content { text-align: center; }
    .library-kicker, .library-hero-actions { justify-content: center; }
    .library-hero-content > p { margin-left: auto; margin-right: auto; }
    .library-hero-visual { min-height: 500px; }
    .library-section-heading, .library-benefits { grid-template-columns: 1fr; gap: 2.5rem; }
    .problem-grid { grid-template-columns: repeat(6, 1fr); }
    .problem-grid article { grid-column: span 2; }
    .problem-grid article:nth-child(4), .problem-grid article:nth-child(5) { grid-column: span 3; }
    .library-module-card, .library-module-card.module-featured { grid-column: span 3; }
    .library-benefit-visual { min-height: 420px; }
    .operation-steps { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
    .operation-steps::before { display: none; }
    .library-cta { align-items: flex-start; flex-direction: column; }
    .library-purchase { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 680px) {
    .landing-header { padding: .75rem 5%; }
    .landing-logo .logo-img { height: 46px; }
    .landing-actions .btn { padding: .65rem .85rem; font-size: .78rem; }
    .library-hero { min-height: auto; padding-top: 3.75rem; padding-bottom: 3.5rem; }
    .library-hero h1 { font-size: clamp(2.6rem, 13vw, 3.7rem); }
    .library-hero-content > p { font-size: 1rem; }
    .library-hero-actions { flex-direction: column; }
    .library-button { width: 100%; }
    .library-trust { grid-template-columns: 1fr; text-align: left; }
    .library-hero-visual { min-height: 360px; margin-top: 1rem; }
    .library-preview { min-height: 300px; grid-template-columns: 44px 1fr; border-radius: 14px; transform: none; }
    .library-preview-sidebar { padding: .65rem .4rem; }
    .preview-brand { width: 28px; height: 28px; }
    .preview-nav { width: 18px; }
    .library-preview-main { padding: .8rem; }
    .preview-metrics { gap: .35rem; }
    .preview-metric { min-height: 72px; padding: .65rem; }
    .preview-metric strong { font-size: 1rem; }
    .preview-panels { grid-template-columns: 1fr; }
    .preview-activity { display: none; }
    .preview-chart { min-height: 130px; }
    .preview-bars { height: 70px; }
    .floating-status, .library-orbit { display: none; }
    .floating-loan { left: -8px; bottom: 18px; }
    .library-intro div { flex-wrap: wrap; gap: .8rem 1.2rem; }
    .library-problems, .library-section, .library-operation { padding-top: 5rem; padding-bottom: 5rem; }
    .problem-grid { display: block; }
    .problem-grid article { min-height: auto; margin-bottom: 1rem; }
    .library-section-heading { display: block; }
    .library-section-heading p { margin-top: 1.25rem; }
    .library-module-grid { display: block; }
    .library-module-card { min-height: auto; margin-bottom: 1rem; }
    .library-benefits { padding-top: 5rem; padding-bottom: 5rem; }
    .benefit-book { width: 210px; height: 280px; }
    .benefit-card-main { width: 210px; }
    .benefit-mini-card { right: 0; }
    .operation-steps { grid-template-columns: 1fr; }
    .library-cta { margin-bottom: 2rem; padding: 2.4rem 1.5rem; border-radius: 20px; }
    .library-purchase { margin-bottom: 2rem; padding: 2.4rem 1.25rem; border-radius: 20px; }
    .purchase-card { padding: 1.4rem; }
    .purchase-price strong { font-size: 2.15rem; }
    .purchase-form-row { grid-template-columns: 1fr; }
    .payment-result-card { padding: 2.2rem 1.3rem; }
}
