/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --sidebar-active: #4f46e5;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.app-title {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-weight: 500;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
}

.logo-shape {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-diamond {
    width: 24px;
    height: 24px;
    background: white;
    transform: rotate(45deg);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-diamond:first-child {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.logo-diamond:last-child {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    margin-left: -8px;
}

.company-name {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-align: center;
    letter-spacing: 1px;
}

.sidebar-header .sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary-light);
}

.nav-link.active {
    background: var(--sidebar-active);
    color: white;
    border-left-color: white;
}

.nav-link-exit {
    color: rgba(255, 255, 255, 0.7);
}

.nav-link-exit:hover {
    background: rgba(220, 38, 38, 0.2);
    color: white;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.user-info {
    text-align: center;
}

.user-name {
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-weight: 500;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 0;
}

/* Top Header */
.top-header {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    background: var(--bg-color);
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s;
}

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

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 2rem;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 2rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

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

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

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.flash-close:hover {
    opacity: 1;
}

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

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

.stat-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

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

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.stat-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-success {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-warning {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Dashboard Actions */
.dashboard-actions {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-wrapper {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

/* Dashboard Section */
.dashboard-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.section-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-icon {
    font-size: 2.5rem;
}

.document-actions-mini {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

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

.document-body {
    flex: 1;
}

.document-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.document-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.document-description {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.document-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.document-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.document-actions-full {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Categories */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-badge {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
}

.category-badge:hover {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.category-name {
    font-weight: 500;
    color: var(--text-color);
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Form Section */
.form-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h1 {
    margin-top: 1rem;
}

.upload-form,
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--danger-color);
}

.form-input,
.form-textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-file {
    padding: 0.5rem;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.form-file:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.form-help {
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-info {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.form-info p {
    margin: 0.5rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* View Section */
.view-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h1 {
    margin-top: 1rem;
}

.document-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.detail-card,
.action-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

.detail-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.detail-content h3,
.action-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-table td:first-child {
    width: 150px;
    font-weight: 500;
    color: var(--text-light);
}

.info-table tr:last-child td {
    border-bottom: none;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* Placeholder Content */
.placeholder-content {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.placeholder-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.section-description {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.support-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.quick-action-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.quick-action-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action-icon {
    font-size: 3rem;
}

.quick-action-text {
    font-weight: 600;
    font-size: 1.125rem;
}

/* Sidebar + dashboard đều dùng biến nên tự hưởng theme light/dark từ :root/body.theme-dark */

.filter-section {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* About Section */
.about-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.about-section h1 {
    margin-bottom: 2rem;
    text-align: center;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
}

.info-card h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-card li:last-child {
    border-bottom: none;
}

/* Table Styles (QTableWidget-like) */
.table-container {
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.table-filter {
    flex: 1;
}

.table-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.3s;
}

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

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.data-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.data-table th.sortable:hover {
    background: var(--border-color);
}

.data-table th.sortable span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-indicator {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.data-table th.sortable:hover .sort-indicator {
    opacity: 1;
}

.data-table th.sort-asc .sort-indicator::after {
    content: " ↑";
    opacity: 1;
    color: var(--primary-color);
}

.data-table th.sort-desc .sort-indicator::after {
    content: " ↓";
    opacity: 1;
    color: var(--primary-color);
}

.data-table th.sort-asc .sort-indicator,
.data-table th.sort-desc .sort-indicator {
    opacity: 0;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--bg-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    vertical-align: middle;
}

.text-center {
    text-align: center;
}

.text-bold {
    font-weight: 600;
}

.text-muted {
    color: var(--text-light);
}

.table-cell-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-icon {
    font-size: 1.25rem;
}

.table-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.table-text-muted {
    color: var(--text-light);
    font-style: italic;
}

.table-actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.table-action-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.table-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.table-action-danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.table-footer {
    padding: 1rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-info {
    font-size: 0.875rem;
    color: var(--text-light);
}

.table-row-hidden {
    display: none;
}

/* Highlight từ khóa tìm trong bảng (quản lý hồ sơ / văn bản) */
mark.search-hit,
.search-hit {
    background-color: #ffeb3b;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: inherit;
}

/* Search transition component (magnifier -> spinner) */
.search-action-btn {
    position: relative;
    min-width: 118px;
}

.search-action-btn .search-btn-icon {
    display: inline-block;
    width: 1.1rem;
    text-align: center;
    transform: scale(1);
    opacity: 1;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.search-action-btn .search-btn-label {
    transition: opacity 0.3s ease-in-out;
}

.search-action-btn.is-loading .search-btn-icon {
    color: transparent;
    transform: scale(0.65);
    opacity: 0;
}

.search-action-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 15px;
    top: 50%;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: search-btn-spin 0.8s linear infinite;
}

.table-search-input.search-input-loading {
    opacity: 0.5;
    transition: opacity 0.3s ease-in-out;
}

@keyframes search-btn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 14px;
}

.form-hint a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.excel-structure {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.excel-structure ul {
    margin: 10px 0;
    padding-left: 20px;
}

.excel-structure li {
    margin: 5px 0;
    color: var(--text-light);
}

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

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-actions {
        width: 100%;
    }
    
    .document-details {
        grid-template-columns: 1fr;
    }
    
    .search-wrapper {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .top-header {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }

    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}

/* Thêm styles cho flash messages */
.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.excel-structure ol {
    margin: 10px 0;
    padding-left: 20px;
}

.excel-structure code {
    background-color: #f1f1f1;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}
/* Import Progress Styles */
.import-progress {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.progress-section {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-color);
}

.progress-details {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

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

.detail-label {
    font-weight: 500;
    color: var(--text-color);
}

.current-status {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    text-align: center;
    padding: 10px;
    background-color: #e8f4f8;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.btn-text, .btn-loading {
    display: inline;
}

.btn-loading {
    color: var(--warning-color);
}

/* Responsive */
@media (max-width: 768px) {
    .progress-details {
        padding: 10px;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-text {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}

/* Logo máy tính cho phần mềm lưu trữ */
.computer-logo, .laptop-logo {
    width: 48px;
    height: 48px;
    color: var(--primary-color, #2c3e50);
    margin: 10px 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.computer-logo:hover, .laptop-logo:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Hoặc style cho emoji */
.computer-icon, .laptop-icon {
    font-size: 48px;
    margin: 10px 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
/* Digitization Styles */
.digitization-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #007bff;
    color: white;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active:hover {
    background: #0056b3;
}

.tab-panel {
    display: none;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 0 5px 5px 5px;
}

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

/* Camera Scan Styles */
.camera-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.camera-preview-container {
    position: relative;
    width: 640px;
    height: 480px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    overflow: hidden;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
}

.camera-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camera-controls button {
    padding: 10px 15px;
    min-width: 120px;
}

/* Image Gallery */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.image-item {
    position: relative;
    width: 150px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-info {
    padding: 5px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.remove-image-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

.gallery-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* OCR Styles */
.upload-area {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: #0056b3;
    background: #f0f8ff;
}

.upload-icon {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 15px;
}

.ocr-output {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.ocr-output pre {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Convert Styles */
.convert-settings {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.format-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.convert-options {
    display: flex;
    gap: 15px;
    align-items: center;
}

.convert-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

/* Processing Styles */
.processing-status {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

/* File List */
.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 5px;
    background: #f8f9fa;
}

.file-item.converted {
    background: #d4edda;
    border-color: #c3e6cb;
}

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

.file-name {
    font-weight: 500;
}

.file-size {
    color: #6c757d;
    font-size: 14px;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.download-btn:hover {
    background: #218838;
}

/* Responsive */
@media (max-width: 768px) {
    .camera-section {
        flex-direction: column;
    }
    
    .camera-preview-container {
        width: 100%;
        height: 300px;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .convert-settings {
        flex-direction: column;
        align-items: stretch;
    }
}
/* PDF Analysis Styles */
.analyze-container {
    max-width: 100%;
}

.analyze-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.analyze-upload {
    margin: 20px 0;
}

.selected-folder {
    margin-top: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#folder-name {
    font-weight: 500;
}

#file-count {
    color: #6c757d;
    font-size: 14px;
}

.analyze-options {
    margin: 15px 0;
}

.analyze-options label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-icon {
    font-size: 32px;
    color: #007bff;
}

.card-content {
    flex: 1;
}

.card-number {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.card-label {
    color: #6c757d;
    font-size: 14px;
}

/* Size Distribution */
.size-distribution {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.size-chart {
    display: flex;
    height: 200px;
    align-items: end;
    gap: 10px;
    margin: 20px 0;
    padding: 0 20px;
}

.size-bar {
    flex: 1;
    background: linear-gradient(to top, #007bff, #0056b3);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20px;
    transition: all 0.3s ease;
}

.size-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.size-bar-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.size-bar-value {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #666;
}

.size-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.size-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.size-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

/* Results Table */
.results-table-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.results-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.current-file {
    margin-top: 10px;
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .size-chart {
        height: 150px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .size-bar {
        height: 30px;
        margin-bottom: 5px;
    }
    
    .results-table {
        font-size: 14px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px;
    }
}
/* Audit Logs Styles */
.activity-timeline {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.timeline-container {
    position: relative;
    padding-left: 30px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.timeline-item.timeline-error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.timeline-item.timeline-warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-error .timeline-marker {
    border-color: #dc3545;
}

.timeline-warning .timeline-marker {
    border-color: #ffc107;
}

.timeline-icon {
    font-size: 14px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.timeline-user {
    font-weight: 600;
    color: #007bff;
}

.timeline-action {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.timeline-resource {
    color: #6c757d;
    font-size: 14px;
}

.timeline-time {
    color: #6c757d;
    font-size: 12px;
    margin-left: auto;
}

.timeline-details p {
    margin: 5px 0;
    color: #495057;
}

.timeline-meta {
    color: #6c757d;
    font-size: 12px;
}

.timeline-changes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.change-item {
    margin-bottom: 5px;
}

.change-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.change-item code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Action badges */
.action-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.action-login { background: #d4edda; color: #155724; }
.action-logout { background: #f8f9fa; color: #6c757d; }
.action-create { background: #d1ecf1; color: #0c5460; }
.action-update { background: #fff3cd; color: #856404; }
.action-delete { background: #f8d7da; color: #721c24; }
.action-view { background: #e2e3e5; color: #383d41; }
.action-export { background: #d6d8db; color: #6c757d; }

/* Table view toggle */
.table-view-toggle {
    margin: 20px 0;
    text-align: right;
}

/* Detailed table */
.detailed-table .table-container {
    margin-top: 20px;
}

.details-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.page-link {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-link:hover,
.page-link.active {
    background: #007bff;
    color: white;
}

.page-ellipsis {
    padding: 8px 12px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .timeline-time {
        margin-left: 0;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}
/* Role and Status Badges */
.role-badge, .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.role-admin {
    background: #ffeaa7;
    color: #d63031;
}

.role-user {
    background: #fdcb6e;
    color: #6c5ce7;
}

.status-active {
    background: #55a3ff;
    color: white;
}

.status-inactive {
    background: #ff7675;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

/* Responsive */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
/* Role and Status Badges */
.role-badge, .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.role-admin {
    background: #ffeaa7;
    color: #d63031;
}

.role-user {
    background: #fdcb6e;
    color: #6c5ce7;
}

.status-active {
    background: #55a3ff;
    color: white;
}

.status-inactive {
    background: #ff7675;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

/* Responsive */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
/* Data Management Styles */
.data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.management-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.card-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.card-header p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.9em;
}

.card-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-body button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.card-body button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.card-body .icon {
    font-size: 1.2em;
}

/* Operation Status */
.operation-status {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-header {
    margin-bottom: 15px;
}

.status-header h4 {
    margin: 0 0 10px 0;
    color: #333;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: width 0.3s ease;
}

.status-details {
    color: #666;
    margin-bottom:
/* AI Info Extraction Styles */
.extract-container {
    max-width: none;
}

.extract-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ai-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.input-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.input-tab-btn.active {
    border-bottom-color: #007bff;
    color: #007bff;
    font-weight: 500;
}

.input-panel {
    display: none;
}

.input-panel.active {
    display: block;
}

.document-textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.text-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    color: #666;
}

.extract-controls {
    text-align: center;
    margin: 20px 0;
}

.extract-processing {
    text-align: center;
    margin: 20px 0;
}

.extracted-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.info-card.filled {
    border-color: #28a745;
    background: #f8fff9;
}

.info-card.empty {
    border-color: #dee2e6;
    background: #f8f9fa;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.info-icon {
    font-size: 1.2em;
}

.info-label {
    font-weight: 500;
    color: #333;
}

.info-value {
    color: #555;
    line-height: 1.4;
    word-break: break-word;
}

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