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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a252f 0%, #2c3e50 100%);
    color: #ecf0f1;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.logo-image {
    height: 32px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: #ecf0f1;
}

.nav {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #fff;
    border-left-color: #3498db;
}

.nav-link.active {
    background-color: rgba(52, 152, 219, 0.15);
    color: #fff;
    border-left-color: #3498db;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
}

.nav-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link-logout {
    color: #e74c3c;
}

.nav-link-logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
    color: #ff6b6b;
}

.nav-link-logout .nav-icon {
    stroke: currentColor;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.content-wrapper {
    padding: 30px;
    max-width: 1400px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header > div:first-child {
    flex: 1;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.page-header p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background-color: #2c3e50;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.15s ease;
    letter-spacing: 0.3px;
}

.btn:hover {
    background-color: #1a252f;
}

.btn-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.btn-icon-sm {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

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

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

.btn-danger {
    background-color: #dc3545;
}

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

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

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

.btn-primary {
    background-color: #2c3e50;
}

.btn-primary:hover {
    background-color: #1a252f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Cards */
.card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 20px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

th {
    background-color: #ecf0f1;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #bdc3c7;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

input[type="text"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

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

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

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-icon {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

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

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

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

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

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.alert-success {
    background-color: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.alert-danger {
    background-color: #fadbd8;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.alert-info {
    background-color: #d6eaf8;
    color: #3498db;
    border: 1px solid #3498db;
}

.alert-warning {
    background-color: #fcf3cf;
    color: #f39c12;
    border: 1px solid #f39c12;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: #2c3e50;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #95a5a6;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    stroke: #bdc3c7;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #7f8c8d;
}

.empty-state-description {
    font-size: 14px;
    color: #95a5a6;
    margin-bottom: 0;
}

/* Code Block */
pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

code {
    background-color: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Utility Classes */
.text-muted {
    color: #95a5a6;
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.hidden {
    display: none;
}

/* Additional Styles for New Admin Pages */

/* Enhanced Button Styles */
.btn-info {
    background-color: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0069d9;
}

/* Filter Section */
.filter-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.filter-form .btn {
    margin-bottom: 0;
}

/* Form Enhancements */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.form-section-header h4 {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

.form-text a {
    color: #3498db;
    text-decoration: none;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Field Mappings */
#mappings-container {
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 20px;
}

.mapping-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 0.5fr 1.5fr 0.5fr;
    gap: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #ecf0f1;
    font-size: 13px;
}

#mapping-rows {
    background-color: #fff;
}

.mapping-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 0.5fr 1.5fr 0.5fr;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    align-items: center;
}

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

.mapping-row input[type="text"] {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.mapping-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.empty-mappings {
    padding: 40px;
    text-align: center;
    color: #95a5a6;
    background-color: #f8f9fa;
}

/* Extraction Status */
#extraction-status {
    margin: 20px 0;
}

#extraction-message {
    font-weight: 500;
}

/* Validation Results */
#validation-results {
    margin-top: 20px;
}

#validation-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

#validation-content li {
    margin-bottom: 10px;
}

/* Entity Info */
.entity-info {
    line-height: 1.8;
}

.entity-info .badge {
    margin-bottom: 5px;
}

/* Details Text */
.details-text {
    color: #7f8c8d;
    font-size: 13px;
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    opacity: 0.9;
}

/* Audit Log Table */
.audit-log-table tbody td {
    vertical-align: top;
}

.audit-log-table tbody tr.log-error {
    background-color: #fff5f5;
}

.nowrap {
    white-space: nowrap;
}

/* Pagination */
.pagination-info {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
    background-color: #f8f9fa;
}

/* Test Results */
.test-result {
    padding: 15px;
    border-left: 4px solid #17a2b8;
    background-color: #f8f9fa;
    margin-bottom: 15px;
    border-radius: 4px;
}

.test-result h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 16px;
}

.test-result p {
    margin-top: 5px;
    color: #7f8c8d;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

/* Badge Enhancements */
.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Button Group Small */
.btn-group-sm {
    display: flex;
    gap: 5px;
}

.btn-group-sm .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* Enhanced Card Header */
.card-header {
    background-color: #f8f9fa;
    color: #212529;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: #212529;
    margin: 0;
}

.card-header .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .mapping-header,
    .mapping-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-form .form-group {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .modern-table {
        font-size: 13px;
    }

    .modern-table th,
    .modern-table td {
        padding: 12px;
    }

    .integration-urls {
        font-size: 12px;
    }

    .url-label {
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .nav {
        padding: 10px 0;
        overflow-y: visible;
    }

    .nav-section {
        margin-bottom: 16px;
    }

    .nav-section-title {
        padding: 6px 16px;
        font-size: 10px;
    }

    .nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .nav-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .logo {
        padding: 16px 20px;
    }

    .logo-image {
        height: 26px;
        max-width: 130px;
    }

    .main-content {
        width: 100%;
    }

    .content-wrapper {
        padding: 15px;
    }

    .page-header h2 {
        font-size: 24px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .btn-group {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-summary {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card-sm {
        padding: 16px;
    }

    .stat-value-sm {
        font-size: 24px;
    }

    .modern-table {
        font-size: 12px;
    }

    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
    }

    .practice-name {
        font-size: 14px;
        gap: 8px;
    }

    .practice-icon {
        width: 16px;
        height: 16px;
    }

    .integration-urls {
        font-size: 11px;
    }

    .url-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .url-label {
        min-width: auto;
        font-size: 11px;
    }

    .url-code {
        width: 100%;
        word-break: break-all;
        font-size: 10px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions-container {
        flex-direction: column;
    }

    .form-actions-container .btn {
        width: 100%;
        justify-content: center;
    }

    .section-header-content {
        gap: 8px;
    }

    .section-icon {
        width: 18px;
        height: 18px;
    }

    .page-header-actions {
        flex-direction: column;
        width: 100%;
    }

    .page-header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .filter-form-horizontal {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .field-count {
        font-size: 13px;
    }
}

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

.stat-card-sm {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: border-color 0.2s ease;
}

.stat-card-sm:hover {
    border-color: #c1c9d0;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

.stat-icon-primary {
    background-color: #2c3e50;
}

.stat-icon-success {
    background-color: #27ae60;
}

.stat-icon-danger {
    background-color: #95a5a6;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value-sm {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

/* Modern Table */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table thead tr {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modern-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #dee2e6;
}

.modern-table tbody tr {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #e9ecef;
}

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

.modern-table tbody tr.row-inactive {
    opacity: 0.5;
}

.modern-table tbody tr.row-inactive:hover {
    opacity: 0.7;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    color: #212529;
}

.practice-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.practice-icon {
    width: 18px;
    height: 18px;
    stroke: #6c757d;
    flex-shrink: 0;
}

.integration-urls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.url-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.url-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 80px;
}

.url-code {
    background-color: #f4f4f4;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 12px;
    color: #495057;
    font-family: 'Courier New', monospace;
    border: 1px solid #d1d5db;
}

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

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Organization Group Headers */
.org-group-header {
    background-color: #f8f9fa;
    font-weight: 600;
    border-left: 4px solid #2c3e50;
}

.org-group-header td {
    padding: 14px 16px !important;
    font-size: 14px;
    color: #2c3e50;
}

.org-group-header:hover {
    background-color: #f8f9fa !important;
}

.org-group-header .badge {
    margin-left: 12px;
    font-weight: 600;
}

/* Page Header Actions */
.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Filter Card & Form */
.filter-card {
    margin-bottom: 24px;
}

.filter-form-horizontal {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 250px;
    flex: 1;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-icon {
    width: 16px;
    height: 16px;
    stroke: #6c757d;
}

/* Field Count Display */
.field-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.field-icon {
    width: 16px;
    height: 16px;
    stroke: #6c757d;
}

/* Document Configuration Form */
.section-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 20px;
    height: 20px;
    stroke: #6c757d;
    flex-shrink: 0;
}

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

.form-label-required::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

.code-textarea {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    background-color: #f8f9fa;
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #dee2e6;
    padding: 20px 0;
    margin-top: 30px;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.form-actions-container {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.alert-heading {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: inherit;
}

.alert.alert-warning .alert-icon {
    stroke: #856404;
}

.alert.alert-info .alert-icon {
    stroke: #0c5460;
}

/* Formstack Folder Organization */
.folder-card {
    margin-bottom: 24px;
}

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

.folder-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.folder-icon {
    width: 20px;
    height: 20px;
    stroke: #6c757d;
    flex-shrink: 0;
}

.document-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.document-icon {
    width: 18px;
    height: 18px;
    stroke: #6c757d;
    flex-shrink: 0;
}

.document-ids {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.id-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.id-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 35px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.id-code {
    background-color: #f4f4f4;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 12px;
    color: #495057;
    font-family: 'Courier New', monospace;
    border: 1px solid #d1d5db;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease;
}

.stats-summary {
    animation: fadeIn 0.5s ease;
}

.folder-card {
    animation: fadeIn 0.4s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar scrollbar */
.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Dashboard Styles */
.dashboard-container {
    animation: fadeIn 0.4s ease;
}

.dashboard-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
}

.time-icon {
    width: 16px;
    height: 16px;
    stroke: #6c757d;
}

.stats-grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-stat-card {
    background: white;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e1e8ed;
    transition: all 0.2s ease;
}

.dashboard-stat-card:hover {
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.stat-card-icon-small {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon-small svg {
    width: 20px;
    height: 20px;
    stroke: #2c3e50;
}

.stat-card-info {
    flex: 1;
    min-width: 0;
}

.stat-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.stat-card-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #f1f3f5;
}

.stat-detail {
    font-size: 12px;
    font-weight: 600;
}

.success-text {
    color: #27ae60;
}

.muted-text {
    color: #95a5a6;
}

.info-text {
    color: #3498db;
}

.warning-text {
    color: #f39c12;
}

.danger-text {
    color: #e74c3c;
}

/* Quick Actions Compact */
.quick-actions-card {
    grid-column: span 1;
}

.quick-actions-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
}

.quick-action-link:hover {
    background: #2c3e50;
    border-color: #2c3e50;
    color: white;
}

.quick-action-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Dashboard Two Column Layout */
.dashboard-two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.15s ease;
}

.activity-item:hover {
    background: #f8f9fa;
}

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

.activity-icon-wrapper {
    flex-shrink: 0;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-icon svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.activity-icon.success {
    background: #27ae60;
}

.activity-icon.error {
    background: #e74c3c;
}

.activity-icon.pending {
    background: #f39c12;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    flex-wrap: wrap;
}

.activity-title strong {
    color: #2c3e50;
}

.activity-details {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6c757d;
}

.activity-details .separator {
    color: #dee2e6;
}

.time-ago {
    color: #95a5a6;
    font-size: 12px;
}

/* Job Item Specific Styles */
.job-item {
    position: relative;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading span {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .stats-grid-dashboard {
        grid-template-columns: 1fr;
    }

    .dashboard-two-column {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 28px;
    }

    .dashboard-stat-card {
        padding: 16px;
    }

    .dashboard-time {
        font-size: 12px;
    }

    .time-icon {
        width: 14px;
        height: 14px;
    }

    .quick-actions-compact {
        grid-template-columns: 1fr;
    }

    .quick-action-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px;
    }
}
