/**
 * LIMSys Frontend Styles
 *
 * @package LIMSys
 * @since 1.0.0
 */

/* Document Library */
.limsys-document-library {
    margin: 20px 0;
}

/* Header with Login/Logout */
.limsys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.limsys-header-title h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.limsys-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.limsys-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.limsys-welcome {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.limsys-btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    background: transparent;
}

.limsys-btn-secondary {
    background: #6c757d;
    color: white;
}

.limsys-btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.limsys-view-doc-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.limsys-view-doc-link:hover {
    color: #0073aa;
    text-decoration: none;
}

/* Override link color when inside a button */
.limsys-btn-secondary.limsys-view-doc-link,
.limsys-btn-secondary .limsys-view-doc-link {
    color: white !important;
}

.limsys-btn-secondary.limsys-view-doc-link:hover,
.limsys-btn-secondary .limsys-view-doc-link:hover {
    color: white !important;
}

.limsys-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.limsys-btn-login {
    background: #0073aa;
    color: white !important;
    text-decoration: none;
}

.limsys-btn-login:hover {
    background: #005a87;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.limsys-btn-create-account {
    background: #28a745;
    color: white !important;
    text-decoration: none;
}

.limsys-btn-create-account:hover {
    background: #218838;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.limsys-btn-logout {
    background: #dc3545;
    color: white;
}

.limsys-btn-logout:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Responsive Header */
@media (max-width: 768px) {
    .limsys-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .limsys-header-title h2 {
        font-size: 20px;
    }
    
    .limsys-user-info {
        flex-direction: column;
        gap: 10px;
    }
}

.limsys-filters {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.limsys-search {
    margin-bottom: 15px;
}

.limsys-search input[type="text"] {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.limsys-search button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.limsys-search button:hover {
    background: #005a87;
}

.limsys-filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.limsys-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.limsys-author-filter {
    background: #e3f2fd;
    border-color: #2196f3;
    font-weight: 500;
}

/* Document Library - Row Layout */
.limsys-document-library .limsys-documents-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
    margin-bottom: 24px;
    background: white;
}

/* Legacy grid override */
.limsys-documents-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
    margin-bottom: 24px;
    background: white;
}

.limsys-document-card {
    background: #f8f9fb;
    border: none;
    border-bottom: 3px solid white;
    border-radius: 0;
    padding: 32px 40px;
    box-shadow: none;
    transition: background 0.2s ease;
    overflow: visible;
    margin-bottom: 0;
}

.limsys-document-card:last-child {
    border-bottom: none;
}

.limsys-document-card:hover {
    background: #f0f2f5;
}

/* Row layout - ID on left, content on right */
.limsys-document-card-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
}

/* ID Box on the left */
.limsys-document-id-box {
    background: #2563eb;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Content wrapper */
.limsys-document-content-wrapper {
    flex: 1;
    min-width: 0;
}

.limsys-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.limsys-preview-container img,
.limsys-preview-container iframe,
.limsys-preview-container embed,
.limsys-preview-container object {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.limsys-preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,115,170,0.9) 0%, rgba(0,115,170,0) 100%);
    padding: 20px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.limsys-document-card:hover .limsys-preview-overlay {
    opacity: 1;
}

.limsys-preview-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limsys-preview-link:hover {
    color: #fff !important;
    transform: scale(1.05);
}

.limsys-preview-link .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.limsys-document-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 400;
    color: #2563eb;
}

.limsys-document-title a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.limsys-document-title a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.limsys-document-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.limsys-status-draft {
    background: #f0f0f0;
    color: #666;
}

.limsys-status-review {
    background: #fff3cd;
    color: #856404;
}

.limsys-status-approved {
    background: #d4edda;
    color: #155724;
}

.limsys-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.limsys-status-published {
    background: #d1ecf1;
    color: #0c5460;
}

.limsys-status-archived {
    background: #e2e3e5;
    color: #383d41;
}

/* Document details list */
.limsys-document-details {
    margin: 0;
    padding: 0;
}

.limsys-detail-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.limsys-detail-row:last-child {
    border-bottom: none;
}

.limsys-detail-row dt {
    min-width: 150px;
    font-weight: 400;
    color: #1f2937;
    font-size: 15px;
    margin: 0;
    padding-right: 16px;
}

.limsys-detail-row dd {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    flex: 1;
}

.limsys-detail-row dd strong {
    color: #1f2937;
    font-weight: 600;
}

.limsys-document-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
}

.limsys-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1;
}

.limsys-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.limsys-btn-primary {
    background: #0073aa;
    color: white !important;
    box-shadow: 0 2px 6px rgba(0,115,170,0.25);
}

.limsys-btn-primary:hover {
    background: #005a87;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,115,170,0.35);
}

/* Ensure Download button link text stays white */
a.limsys-btn-primary,
.limsys-btn-primary a {
    color: white !important;
}

a.limsys-btn-primary:hover,
.limsys-btn-primary a:hover {
    color: white !important;
}

.limsys-btn-secondary {
    background: #6c757d;
    color: white !important;
    border: none;
    box-shadow: 0 2px 4px rgba(108,117,125,0.25);
}

.limsys-btn-secondary:hover {
    background: #5a6268 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108,117,125,0.35);
}

/* Ensure View button link text stays white */
.limsys-btn-secondary.limsys-view-doc-link,
a.limsys-btn-secondary.limsys-view-doc-link {
    color: white !important;
}

.limsys-btn-secondary.limsys-view-doc-link:hover,
a.limsys-btn-secondary.limsys-view-doc-link:hover {
    background: #5a6268 !important;
    color: white !important;
}

.limsys-btn-edit {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
}

.limsys-btn-edit:hover {
    background: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.4);
}

/* Thumbnail styles for document library cards */
.limsys-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: white;
}

.limsys-thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.limsys-document-card:hover .limsys-thumbnail-image img {
    transform: scale(1.05);
}

.limsys-thumbnail-pdf {
    background: #f5f5f5;
}

.limsys-thumbnail-pdf iframe {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.limsys-thumbnail-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
    backdrop-filter: blur(4px);
}

.limsys-file-type-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.limsys-thumbnail-text {
    background: #f8f9fa;
    padding: 15px;
    position: relative;
}

.limsys-thumbnail-content {
    font-size: 11px;
    line-height: 1.6;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    line-clamp: 10;
    -webkit-box-orient: vertical;
    font-family: 'Courier New', Courier, monospace;
}

.limsys-thumbnail-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-direction: column;
}

.limsys-thumbnail-placeholder .limsys-thumbnail-icon {
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 20px;
}

/* Responsive layout for document cards */
@media (max-width: 768px) {
    .limsys-document-card {
        padding: 24px 20px;
    }
    
    .limsys-document-card-inner {
        flex-direction: column;
        gap: 20px;
    }
    
    .limsys-document-id-box {
        align-self: flex-start;
    }
    
    .limsys-detail-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .limsys-detail-row dt {
        min-width: auto;
        padding-right: 0;
        margin-bottom: 4px;
        font-weight: 600;
    }
}

@media (max-width: 576px) {
    .limsys-document-card {
        padding: 20px 16px;
    }
    
    .limsys-document-card-inner {
        gap: 16px;
    }
    
    .limsys-document-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .limsys-detail-row dt,
    .limsys-detail-row dd {
        font-size: 14px;
    }
    
    .limsys-document-id-box {
        font-size: 14px;
        padding: 6px 16px;
    }
}

.limsys-btn-success {
    background: #28a745;
    color: white;
}

.limsys-btn-success:hover {
    background: #218838;
    color: white;
}

.limsys-btn-danger {
    background: #8B0000;
    color: white;
}

.limsys-btn-danger:hover {
    background: #6B0000;
    color: white;
}

/* Upload Form */
.limsys-upload-form {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
}

.limsys-form-group {
    margin-bottom: 20px;
}

.limsys-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.limsys-form-group input,
.limsys-form-group textarea,
.limsys-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.limsys-form-group input:focus,
.limsys-form-group textarea:focus,
.limsys-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.limsys-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.limsys-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.limsys-progress {
    margin-top: 20px;
    display: none;
}

.limsys-progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.limsys-progress-bar::after {
    content: '';
    display: block;
    width: 0%;
    height: 100%;
    background: #0073aa;
    transition: width 0.3s ease;
}

.limsys-progress-text {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: #666;
}

/* Document Viewer */
.limsys-document-viewer {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
}

.limsys-document-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.limsys-document-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.limsys-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.limsys-document-content {
    margin-bottom: 30px;
}

.limsys-document-file {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

.limsys-document-file h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.limsys-file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.limsys-file-name {
    font-weight: bold;
    color: #333;
}

.limsys-file-size {
    color: #666;
    font-size: 14px;
}

/* Version History */
.limsys-document-versions {
    margin-bottom: 30px;
}

.limsys-document-versions h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.limsys-versions-list {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.limsys-version-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.limsys-version-item:last-child {
    border-bottom: none;
}

.limsys-version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.limsys-version-number {
    font-weight: bold;
    color: #0073aa;
}

.limsys-version-date,
.limsys-version-author {
    color: #666;
    font-size: 14px;
}

.limsys-version-changelog {
    color: #333;
    font-style: italic;
}

/* Workflow History */
.limsys-document-workflow {
    margin-bottom: 30px;
}

.limsys-document-workflow h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.limsys-workflow-timeline {
    border-left: 2px solid #eee;
    padding-left: 20px;
}

.limsys-workflow-entry {
    margin-bottom: 20px;
    position: relative;
}

.limsys-workflow-entry::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #0073aa;
    border-radius: 50%;
}

.limsys-workflow-status {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.limsys-workflow-details {
    color: #666;
    font-size: 14px;
}

.limsys-workflow-comments {
    margin-top: 5px;
    font-style: italic;
}

/* Workflow Dashboard */
.limsys-workflow-dashboard {
    margin: 20px 0;
}

.limsys-dashboard-stats {
    margin-bottom: 30px;
}

.limsys-dashboard-stats h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.limsys-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.limsys-stat-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.limsys-stat-count {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.limsys-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limsys-stat-draft .limsys-stat-count {
    color: #666;
}

.limsys-stat-review .limsys-stat-count {
    color: #856404;
}

.limsys-stat-approved .limsys-stat-count {
    color: #155724;
}

.limsys-stat-rejected .limsys-stat-count {
    color: #721c24;
}

.limsys-stat-published .limsys-stat-count {
    color: #0c5460;
}

.limsys-stat-archived .limsys-stat-count {
    color: #383d41;
}

.limsys-dashboard-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.limsys-dashboard-column h2 {
    margin: 0 0 20px 0;
    color: #333;
}

.limsys-pending-list,
.limsys-activity-list {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.limsys-pending-item,
.limsys-activity-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.limsys-pending-item:last-child,
.limsys-activity-item:last-child {
    border-bottom: none;
}

.limsys-pending-item h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.limsys-pending-actions {
    margin-top: 10px;
}

.limsys-pending-actions button {
    margin-right: 10px;
}

/* Search Results */
.limsys-search-form {
    margin: 20px 0;
}

.limsys-search-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.limsys-search-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-search-input button {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.limsys-search-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.limsys-search-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-search-results {
    margin-top: 20px;
}

/* Categories */
.limsys-categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.limsys-category-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.limsys-category-name {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.limsys-category-count {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.limsys-category-description {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Recent Documents */
.limsys-recent-documents {
    margin: 20px 0;
}

.limsys-recent-documents h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.limsys-documents-list {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.limsys-document-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.limsys-document-item:last-child {
    border-bottom: none;
}

.limsys-document-item h4 {
    margin: 0 0 10px 0;
}

.limsys-document-item h4 a {
    color: #333;
    text-decoration: none;
}

.limsys-document-item h4 a:hover {
    color: #0073aa;
}

.limsys-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

/* Pagination */
.limsys-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.limsys-pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
}

.limsys-pagination button:hover {
    background: #f0f0f0;
}

.limsys-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.limsys-pagination .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .limsys-documents-grid {
        grid-template-columns: 1fr;
    }
    
    .limsys-dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .limsys-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .limsys-search-input {
        flex-direction: column;
    }
    
    .limsys-file-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .limsys-document-actions {
        flex-direction: column;
    }
    
    .limsys-form-actions {
        flex-direction: column;
    }
}

/* Loading States */
.limsys-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.limsys-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: limsys-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes limsys-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.limsys-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.limsys-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* No Results */
.limsys-no-documents {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Frontend Workflow Dashboard */
.limsys-frontend-workflow {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.limsys-workflow-title {
    margin: 0 0 30px 0;
    padding: 0;
    font-size: 28px;
    color: #333;
}

.limsys-workflow-stats {
    margin-bottom: 30px;
}

.limsys-workflow-stats h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.limsys-workflow-stats .limsys-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.limsys-workflow-stats .limsys-stat-item {
    background: white;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.limsys-workflow-stats .limsys-stat-count {
    display: block;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.limsys-workflow-stats .limsys-stat-label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limsys-workflow-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.limsys-workflow-column {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.limsys-workflow-column h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.limsys-pending-list .limsys-pending-item {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
}

.limsys-pending-list .limsys-pending-item:last-child {
    margin-bottom: 0;
}

.limsys-pending-list .limsys-pending-item h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.limsys-pending-list .limsys-document-meta {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
}

.limsys-pending-list .limsys-meta-item {
    display: inline-block;
    margin-right: 15px;
    color: #666;
}

.limsys-pending-list .limsys-meta-item strong {
    color: #333;
}

.limsys-pending-list p {
    margin: 10px 0;
    color: #666;
    font-size: 14px;
}

.limsys-pending-list .limsys-view-document {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.limsys-pending-list .limsys-view-document:hover {
    background: #005a87;
}

.limsys-pending-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.limsys-pending-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid;
}

.limsys-pending-actions .button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.limsys-pending-actions .button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.limsys-pending-actions .button-secondary {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.limsys-pending-actions .button-secondary:hover {
    background: #c82333;
    border-color: #c82333;
}

.limsys-activity-list {
    max-height: 500px;
    overflow-y: auto;
}

.limsys-activity-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.limsys-activity-item:last-child {
    border-bottom: none;
}

.limsys-activity-document {
    font-weight: 500;
    color: #333;
}

.limsys-activity-status {
    color: #0073aa;
    font-weight: 500;
}

.limsys-activity-user {
    color: #666;
}

.limsys-activity-date {
    color: #999;
    font-size: 12px;
}

.limsys-error-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

.limsys-error-message p {
    margin: 0;
    color: #856404;
}

/* Responsive Design for Workflow */
@media (max-width: 768px) {
    .limsys-workflow-content {
        grid-template-columns: 1fr;
    }
    
    .limsys-workflow-stats .limsys-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .limsys-activity-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .limsys-pending-actions {
        flex-direction: column;
    }
}

/* Document Preview Modal */
.limsys-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.limsys-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.limsys-modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.limsys-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.limsys-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
}

.limsys-modal-close:hover,
.limsys-modal-close:focus {
    color: #000;
}

.limsys-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.limsys-document-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.limsys-document-details p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.limsys-document-details strong {
    color: #333;
    font-weight: 600;
    display: inline-block;
    min-width: 100px;
}

#limsys-modal-document-preview {
    margin-top: 20px;
}

#limsys-modal-document-preview iframe {
    border: 1px solid #ddd;
    border-radius: 4px;
}

#limsys-modal-document-preview img {
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.limsys-modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    text-align: right;
}

.limsys-modal-footer .button {
    min-width: 100px;
    padding: 8px 20px;
}

.limsys-modal-close-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.limsys-modal-close-btn:hover {
    background: #005a87;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .limsys-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .limsys-modal-header h2 {
        font-size: 18px;
    }
    
    .limsys-document-details strong {
        min-width: 80px;
        font-size: 13px;
    }
}

/* Document Preview Styling */
.limsys-document-preview {
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.limsys-document-preview iframe {
    display: block;
    border: 0;
}

.limsys-document-preview video,
.limsys-document-preview audio {
    display: block;
    margin: 0 auto;
}

.limsys-document-preview img {
    display: block;
    margin: 0 auto;
}

/* Ensure modals with previews have adequate height */
.limsys-modal-large .limsys-modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

/* User Profile Shortcode Styles */
.limsys-user-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.limsys-profile-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
}

.limsys-profile-header h2 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.limsys-profile-subtitle {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.limsys-profile-message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid;
}

.limsys-profile-message.limsys-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.limsys-profile-message.limsys-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.limsys-profile-section {
    background: #fff;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-profile-section h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.limsys-section-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-style: italic;
}

.limsys-avatar-container {
    text-align: center;
    padding: 20px;
}

.limsys-avatar {
    border-radius: 50%;
    border: 4px solid #0073aa;
    display: block;
    margin: 0 auto 15px;
}

.limsys-avatar-upload {
    margin: 15px 0;
}

.limsys-btn-upload-avatar,
.limsys-btn-remove-avatar {
    display: inline-block;
    margin: 5px;
}

.limsys-btn-remove {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.limsys-btn-remove:hover {
    background: #c82333;
}

.limsys-btn-remove:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.limsys-avatar-note {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.limsys-avatar-note a {
    color: #0073aa;
    text-decoration: none;
}

.limsys-avatar-note a:hover {
    text-decoration: underline;
}

.limsys-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.limsys-form-group {
    margin-bottom: 20px;
}

.limsys-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.limsys-required {
    color: #dc3545;
    font-weight: bold;
}

.limsys-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.limsys-form-control:focus {
    outline: none;
    border-color: #0073aa;
}

.limsys-form-group {
    margin-bottom: 18px;
}

.limsys-form-control::placeholder {
    color: #999;
}

.limsys-form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.limsys-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.limsys-info-item {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-info-item label {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.limsys-info-value {
    font-size: 15px;
    color: #333;
}

.limsys-info-value code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: monospace;
    border: 1px solid #ddd;
}

.limsys-info-value small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.limsys-profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.limsys-profile-logout {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.limsys-btn-logout-link {
    display: inline-block;
    padding: 8px 20px;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.limsys-btn-logout-link:hover {
    background: #dc3545;
    color: white;
    text-decoration: none;
}

.limsys-btn-primary {
    background: #0073aa;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.limsys-btn-primary:hover {
    background: #005a87;
}

.limsys-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.limsys-btn-cancel {
    background: #fff;
    color: #666;
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.limsys-btn-cancel:hover {
    background: #f5f5f5;
    border-color: #999;
}

.limsys-profile-login-required {
    text-align: center;
    padding: 60px 40px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 2px dashed #ccc;
}

.limsys-profile-login-required p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Responsive Design for Profile */
@media (max-width: 768px) {
    .limsys-form-row {
        grid-template-columns: 1fr;
    }
    
    .limsys-info-grid {
        grid-template-columns: 1fr;
    }
    
    .limsys-profile-actions {
        flex-direction: column;
    }
    
    .limsys-profile-actions .limsys-btn {
        width: 100%;
    }
    
    .limsys-user-profile {
        padding: 10px;
    }
    
    .limsys-profile-section {
        padding: 15px;
    }
}

/* ====================================
   Document Editor Styles
   ==================================== */

.limsys-document-editor {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.limsys-editor-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.limsys-editor-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.limsys-editor-title h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.limsys-editor-status {
    display: inline-block;
    padding: 4px 12px;
    background: #28a745;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.limsys-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.limsys-editor-toolbar .limsys-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.limsys-toolbar-separator {
    color: #ccc;
    font-size: 18px;
    margin: 0 5px;
}

.limsys-editor-content {
    display: flex;
    position: relative;
    min-height: 600px;
}

.limsys-editor-main {
    flex: 1;
    width: 100%;
    position: relative;
}

.limsys-editor-textarea {
    width: 100%;
    min-height: 600px;
    padding: 20px;
    border: none;
    outline: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fff;
    color: #333;
}

.limsys-editor-textarea:focus {
    background: #fafafa;
}

.limsys-editor-preview {
    flex: 1;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    background: #fff;
}

.limsys-preview-content {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.limsys-editor-non-editable {
    width: 100%;
    padding: 40px;
    text-align: center;
}

.limsys-editor-message {
    max-width: 600px;
    margin: 0 auto 30px;
}

.limsys-editor-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.limsys-editor-file-preview {
    margin-top: 30px;
}

.limsys-editor-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.limsys-editor-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    color: #666;
    font-size: 13px;
}

.limsys-editor-file-info,
.limsys-editor-file-size,
.limsys-editor-last-saved {
    display: inline-block;
}

.limsys-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Editor Modal */
.limsys-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.limsys-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

.limsys-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.limsys-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.limsys-modal-close:hover {
    color: #333;
}

.limsys-modal-body {
    padding: 20px;
}

.limsys-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.limsys-modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.limsys-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Fullscreen mode */
.limsys-editor-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
}

.limsys-editor-fullscreen .limsys-editor-content {
    height: calc(100vh - 180px);
}

.limsys-editor-fullscreen .limsys-editor-textarea {
    height: calc(100vh - 180px);
}

/* File Preview Enhancement */
.limsys-inline-preview {
    padding: 20px;
    background: #fafafa;
    border-radius: 4px;
}

.limsys-inline-preview-pdf iframe {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-inline-preview-image img {
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.limsys-inline-preview-text {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.limsys-text-content {
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.limsys-preview-error,
.limsys-preview-unavailable {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

/* Buttons Enhancement */
.limsys-btn-primary {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.limsys-btn-primary:hover {
    background: #0056b3;
}

.limsys-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.limsys-btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.limsys-btn-secondary:hover {
    background: #5a6268;
}

/* Edit Button in Document Cards */
.limsys-document-actions .limsys-btn-edit {
    display: inline-block !important;
    background: #ffc107 !important;
    background-color: #ffc107 !important;
    color: #000 !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.limsys-document-actions .limsys-btn-edit:hover {
    background: #e0a800 !important;
    background-color: #e0a800 !important;
    color: #000 !important;
    text-decoration: none !important;
}

/* File Actions in Document Viewer */
.limsys-file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.limsys-file-actions .limsys-btn-edit {
    display: inline-block !important;
    background: #ffc107 !important;
    background-color: #ffc107 !important;
    color: #000 !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.limsys-file-actions .limsys-btn-edit:hover {
    background: #e0a800 !important;
    background-color: #e0a800 !important;
}

.limsys-file-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.limsys-file-name,
.limsys-file-size {
    display: block;
    color: #666;
    font-size: 14px;
}

/* Responsive Editor */
@media (max-width: 1024px) {
    .limsys-editor-content {
        flex-direction: column;
    }
    
    .limsys-editor-main,
    .limsys-editor-preview {
        width: 100% !important;
    }
    
    .limsys-editor-preview {
        border-left: none;
        border-top: 1px solid #ddd;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .limsys-editor-header {
        padding: 10px 15px;
    }
    
    .limsys-editor-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .limsys-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .limsys-editor-toolbar .limsys-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .limsys-editor-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .limsys-editor-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .limsys-editor-actions {
        flex-direction: column;
    }
    
    .limsys-editor-actions .limsys-btn {
        width: 100%;
    }
    
    .limsys-modal-content {
        width: 95%;
    }
}

/* ====================================
   Document Viewer Improvements
   ==================================== */

/* Edit Instructions Box */
.limsys-edit-instructions {
    margin: 20px 0;
}

.limsys-info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 20px;
    border-radius: 4px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.limsys-info-icon {
    font-size: 24px;
    line-height: 1;
}

.limsys-info-content {
    flex: 1;
}

.limsys-info-content strong {
    display: block;
    font-size: 16px;
    color: #1976D2;
    margin-bottom: 10px;
}

.limsys-info-content p {
    margin: 8px 0;
    color: #555;
}

.limsys-info-content ol {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: #555;
}

.limsys-info-content li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Large Buttons with Icons */
.limsys-btn-large {
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.limsys-btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* Download Button */
.limsys-btn-download {
    background: #28a745 !important;
    background-color: #28a745 !important;
    color: #fff !important;
}

.limsys-btn-download:hover {
    background: #218838 !important;
    background-color: #218838 !important;
}

/* Upload Button */
.limsys-btn-upload {
    background: #17a2b8 !important;
    background-color: #17a2b8 !important;
    color: #fff !important;
}

.limsys-btn-upload:hover {
    background: #138496 !important;
    background-color: #138496 !important;
}

/* File Actions Layout */
.limsys-file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Version Upload Modal */
.limsys-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.limsys-modal-large {
    max-width: 700px;
    width: 90%;
}

.limsys-file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s;
}

.limsys-file-input:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.limsys-help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

/* Upload Progress */
.limsys-upload-progress {
    margin: 20px 0;
}

.limsys-progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.limsys-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    width: 0%;
}

.limsys-progress-text {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #555;
}

/* Success/Error Messages */
.limsys-message {
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.limsys-message.limsys-success,
.limsys-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.limsys-message.limsys-error,
.limsys-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Version Preview */
.limsys-version-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.limsys-version-preview h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.limsys-preview-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.limsys-preview-name {
    font-weight: 600;
}

/* Fullscreen PDF Modal */
.limsys-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.limsys-fullscreen-content {
    width: 95%;
    height: 95%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.limsys-fullscreen-header {
    background: #333;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.limsys-fullscreen-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
    transition: color 0.2s;
}

.limsys-fullscreen-close:hover {
    color: #f44336;
}

.limsys-fullscreen-content iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* Form Enhancements */
.limsys-form-group {
    margin-bottom: 20px;
}

.limsys-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.limsys-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.limsys-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Modal Footer Improvements */
.limsys-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .limsys-info-box {
        flex-direction: column;
    }
    
    .limsys-btn-large {
        width: 100%;
        justify-content: center;
    }
    
    .limsys-file-actions {
        flex-direction: column;
    }
    
    .limsys-file-actions .limsys-btn {
        width: 100%;
    }
    
    .limsys-modal-large {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .limsys-fullscreen-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .limsys-preview-info {
        flex-direction: column;
        gap: 5px;
    }
}

/* ====================================
   Simple Row Layout Styling
   ==================================== */

/* Row-based document layout */
.limsys-document-row {
    background: white;
    border: 1px solid #dee2e6;
    margin-bottom: 16px;
    overflow: hidden;
}

.limsys-document-row:hover {
    border-color: #adb5bd;
}

/* Base style - ALWAYS HORIZONTAL - NO EXCEPTIONS */
.limsys-document-row-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: transparent !important;
}

/* Force horizontal - override everything */
body .limsys-document-row-inner,
body .limsys-document-library .limsys-document-row-inner,
div.limsys-document-row-inner,
.limsys-document-library .limsys-document-row-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

/* Document Identifier Box (Far Left) - Blue */
.limsys-document-identifier {
    background: #3498db;
    color: white;
    font-weight: 700;
    font-size: 18px;
    padding: 24px 20px;
    min-width: 120px;
    width: 120px;
    text-align: center;
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    box-sizing: border-box;
}

/* Document Content (Left Side) - Simple */
.limsys-document-row-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    width: auto;
    flex-shrink: 1;
    background: #f8f9fa;
}

/* Document Title - Blue */
.limsys-document-row-title {
    margin-bottom: 16px;
}

.limsys-document-row-title a {
    color: #007bff;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.5;
    text-decoration: none;
    display: block;
}

.limsys-document-row-title a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Document Details - Simple */
.limsys-document-row-details {
    margin-bottom: 16px;
    flex: 1;
}

.limsys-detail-item {
    margin-bottom: 10px;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
}

.limsys-detail-item:last-child {
    margin-bottom: 0;
}

.limsys-detail-item strong {
    color: #333;
    margin-right: 8px;
    font-weight: 700;
}

/* Document Description - Simple */
.limsys-document-row-description {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.limsys-document-row-description p {
    margin: 0 0 8px 0;
}

.limsys-document-row-description p:last-child {
    margin-bottom: 0;
}

/* Action Buttons - Simple */
.limsys-document-row-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
}

.limsys-document-row-actions .limsys-btn {
    padding: 8px 16px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.limsys-document-row-actions .limsys-btn-primary {
    background: #0073aa;
    color: white;
}

.limsys-document-row-actions .limsys-btn-primary:hover {
    background: #005a87;
    color: white;
}

.limsys-document-row-actions .limsys-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.limsys-document-row-actions .limsys-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* File Preview (Right Side) - Simple */
.limsys-document-row-preview {
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    min-height: 150px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
}

.limsys-document-row-preview .limsys-preview {
    width: 100% !important;
    height: auto !important;
    max-width: 180px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    background: white;
}

.limsys-document-row-preview .limsys-preview[style*="width"] {
    width: 100% !important;
    max-width: 200px !important;
}

.limsys-document-row-preview .limsys-preview[style*="height"] {
    height: auto !important;
    min-height: 150px;
    max-height: 250px;
}

.limsys-document-row-preview .limsys-preview img {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.limsys-document-row-preview .limsys-preview iframe {
    width: 100% !important;
    height: 250px !important;
    border: none;
}

.limsys-document-row-preview .limsys-preview-pdf {
    width: 100% !important;
    height: 250px !important;
}

.limsys-document-row-preview .limsys-preview-pdf iframe {
    width: 100% !important;
    height: 250px !important;
}

/* Status Badge Simple Styling */
.limsys-document-row-details .limsys-status-published {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
}

.limsys-document-row-details .limsys-status-draft {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
}

/* Responsive styles for row layout - ONLY on very small mobile */
@media screen and (max-width: 480px) {
    .limsys-document-row-inner {
        flex-direction: column !important;
        padding: 15px;
    }
    
    .limsys-document-identifier {
        align-self: flex-start;
        margin-bottom: 15px;
        min-width: 60px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .limsys-document-row-title a {
        font-size: 14px;
    }
    
    .limsys-detail-item {
        font-size: 13px;
    }
    
    .limsys-document-row-preview {
        width: 100%;
        max-width: 100%;
        margin-top: 15px;
    }
}