body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    flex: 1;
}

/* Wizard Styles */
.wizard-progress {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 1.5rem 4rem;
    margin-bottom: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Line between step 1 and 2 */
.wizard-step:nth-child(1)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 100%;
    width: 100px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

/* Line between step 2 and 3 */
.wizard-step:nth-child(2)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 100%;
    width: 100px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.wizard-step-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.wizard-step.active .wizard-step-number {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.wizard-step.active .wizard-step-label {
    color: #1e293b;
    font-weight: 600;
}

.wizard-step.completed .wizard-step-number {
    background: #10b981;
    color: white;
}

.wizard-step.completed .wizard-step-label {
    color: #059669;
}

.wizard-step-content {
    display: none;
}

.wizard-step-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Navbar branding */
.navbar-brand {
    cursor: default;
}

.navbar-brand i {
    color: rgba(255, 255, 255, 0.95);
}

/* Card styling */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
}

.field-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.field-item:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.field-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.text-monospace {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

#progressBar {
    transition: width 0.3s ease;
}

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

.btn-remove-field {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

#noFieldsMessage {
    font-style: italic;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Template selector styling */
.bg-light {
    background-color: #f8f9fa !important;
}

.bg-light h6 {
    color: #495057;
    font-weight: 600;
}

/* Form Controls */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1e293b;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    color: #1e293b;
    background-color: #ffffff;
    border-color: #3b82f6;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-control:disabled {
    background-color: #f1f5f9;
    opacity: 1;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1e293b;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    font-family: inherit;
    box-sizing: border-box;
}

.form-select:focus {
    border-color: #3b82f6;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:disabled {
    background-color: #f1f5f9;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom File Input */
input[type="file"].form-control {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    color: #ffffff;
    background-color: #3b82f6;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="file"].form-control::file-selector-button:hover {
    background-color: #2563eb;
}

input[type="file"].form-control::-webkit-file-upload-button {
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    color: #ffffff;
    background-color: #3b82f6;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="file"].form-control::-webkit-file-upload-button:hover {
    background-color: #2563eb;
}

#loadTemplateBtn:disabled,
#clearFieldsBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle button styling */
#toggleTemplateBtn {
    color: #6c757d;
    padding: 0.25rem 0.5rem;
}

#toggleTemplateBtn:hover {
    color: #495057;
}

#toggleTemplateIcon {
    transition: transform 0.3s ease;
}

/* Smooth collapse transition */
#templateSelectorCollapse {
    transition: height 0.3s ease;
}

/* Field item button styling */
.field-item .btn-outline-primary {
    background: transparent;
    border: 1px solid #0d6efd;
    color: #0d6efd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.field-item .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.field-item .btn-outline-danger {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.field-item .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Batch results styling */
#batchInfoSection {
    border-left: 4px solid #0dcaf0;
}

#resultsTable td[rowspan] {
    vertical-align: middle;
    background-color: #f8f9fa;
    font-weight: 500;
}

.table-danger em {
    color: #842029;
}

/* Full-Screen PDF Comparison Modal */
.pdf-comparison-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fff;
    z-index: 1040;
    flex-direction: column;
}

.pdf-comparison-modal.active {
    display: flex;
}

.pdf-comparison-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.pdf-comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pdf-comparison-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-comparison {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.pdf-comparison-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.pdf-comparison-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

.pdf-comparison-column h3 {
    padding: 1rem 1.5rem;
    margin: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-size: 1.125rem;
    font-weight: 600;
}

.pdf-comparison-column .table-responsive {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
}

.pdf-comparison-column .table th {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.pdf-comparison-column .table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.pdf-comparison-column .table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.pdf-comparison-column .table tbody tr:hover {
    background-color: #f8f9fa;
}

.pdf-comparison-column iframe {
    flex: 1;
}

/* Ensure Bootstrap modals show on top of comparison modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: visible;
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body > div {
    margin-bottom: 1.25rem;
}

.modal-body > div:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.9375rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Quotation Modal Specific Styles */
.quotation-modal-content {
    max-width: 650px;
}

.modal-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 400;
}

.quotation-section {
    margin-bottom: 1rem;
}

.quotation-section:last-child {
    margin-bottom: 0;
}

.quotation-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.375rem 0;
}

.quotation-helper-text {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
    font-style: italic;
}

.quotation-value-box {
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    white-space: pre-wrap;
    font-size: 0.9375rem;
    color: #1e293b;
    min-height: 2.5rem;
}

.quotation-source-box {
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

.quotation-reasoning-box {
    padding: 0.75rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f1f5f9 100%);
    border-radius: 0.375rem;
    border: 1px solid #bae6fd;
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

.ai-icon {
    color: #3b82f6;
    margin-right: 0.25rem;
}

.page-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.page-badge:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.page-badge:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

.page-badge i {
    margin-right: 0.375rem;
}

#quotationPages .badge {
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    display: inline-block;
}

.modal-backdrop {
    z-index: 2040;
}

.modal-header-bar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.modal-split-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #f8f9fa;
}

.modal-split-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #fff;
}

#modalResultsColumn {
    flex: 0 0 50%;
    min-width: 300px;
}

#modalPdfColumn {
    flex: 0 0 50%;
    min-width: 400px;
}

.modal-resize-divider {
    width: 10px;
    background-color: #dee2e6;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, #e9ecef 0%, #dee2e6 50%, #e9ecef 100%);
}

.modal-resize-divider:hover {
    background: linear-gradient(to right, #0d6efd 0%, #0a58ca 50%, #0d6efd 100%);
}

.modal-resize-divider.dragging {
    background: linear-gradient(to right, #0d6efd 0%, #0a58ca 50%, #0d6efd 100%);
}

.modal-resize-divider .resize-handle {
    color: #6c757d;
    font-size: 1.2rem;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.modal-resize-divider:hover .resize-handle,
.modal-resize-divider.dragging .resize-handle {
    color: white;
}

.panel-header {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    flex-shrink: 0;
}

.panel-header h6 {
    color: #495057;
    font-weight: 600;
}

.panel-content {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
}

#modalPdfColumn .panel-content {
    padding: 0;
}

#modalPdfViewer {
    border: none;
    display: block;
}

#modalResultsTable {
    margin-bottom: 0;
}

/* Prevent text selection during resize */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Scrollbar styling for modal panels */
.panel-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* ===============================================
   ADMIN PANEL STYLES
   =============================================== */

/* Login Screen - Full viewport takeover */
.admin-login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 1.25rem;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.login-card h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-header p {
    color: #64748b;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
}

.login-card .form-group {
    margin-bottom: 1.5rem;
}

.login-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
    font-size: 0.875rem;
}

.login-card input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
    font-family: inherit;
}

.login-card input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-card .error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border-left: 4px solid #dc2626;
    font-weight: 500;
}

.login-card .btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Dashboard Screen */
.admin-dashboard-screen {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Admin Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

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

.sidebar-header h2 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-header i {
    margin-right: 0.625rem;
    color: #60a5fa;
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    margin: 0.25rem 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

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

.nav-item.active {
    background-color: rgba(96, 165, 250, 0.15);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3);
}

.nav-item i {
    width: 20px;
    margin-right: 0.875rem;
    font-size: 1.125rem;
    opacity: 0.9;
}

.nav-item.active i {
    opacity: 1;
    color: #60a5fa;
}

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

.user-info {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.user-info strong {
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.btn-logout {
    width: 100%;
    padding: 0.625rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.btn-logout i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8fafc;
}

.main-content .navbar {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.main-content .navbar h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
}

.main-content .container {
    padding: 2rem;
    max-width: none;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Admin Tables */
.admin-table {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.table-controls {
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-controls h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-responsive {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.admin-table table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: auto;
}

.admin-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
}

.admin-table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Column widths for organization table */
.admin-table thead th:nth-child(1) { width: 60px; }  /* ID */
.admin-table thead th:nth-child(2) { width: auto; }  /* Name */
.admin-table thead th:nth-child(3) { width: auto; }  /* Email Domain */
.admin-table thead th:nth-child(4) { width: 80px; }  /* Users */
.admin-table thead th:nth-child(5) { width: 100px; } /* Status */
.admin-table thead th:nth-child(6) { width: 180px; } /* Created */
.admin-table thead th:nth-child(7) { width: 120px; } /* Actions */

.admin-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9375rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

/* First column (typically name or email) should be left-aligned */
.admin-table tbody td:nth-child(2) {
    text-align: left;
}

/* Actions column should be centered */
.admin-table tbody td:last-child {
    text-align: center;
}

.admin-table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 0.875rem;
    color: #64748b;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-buttons button {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

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

#history-page-info {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin: 0 1rem;
}

/* Badge Styles */
.badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Button Styles */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

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

.btn-icon {
    padding: 0.5rem 0.875rem;
}

/* Section Display */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

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

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

.stat-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }
    
    .nav-item {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: #3498db;
    }
    
    .nav-item i {
        margin: 0 0 0.25rem 0;
    }
    
    .admin-container {
        flex-direction: column;
    }
}

/* Admin Modals */
.admin-dashboard-screen .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.admin-dashboard-screen .modal.active {
    display: flex;
}

.admin-dashboard-screen .modal-content {
    background-color: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.admin-dashboard-screen .modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1;
}

.admin-dashboard-screen .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.admin-dashboard-screen .modal-header .close {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.admin-dashboard-screen .modal-header .close:hover {
    background-color: #f8f9fa;
    color: #000;
}

.admin-dashboard-screen .modal form {
    padding: 2rem;
}

.admin-dashboard-screen .modal .form-group {
    margin-bottom: 1.5rem;
}

.admin-dashboard-screen .modal .form-group:last-of-type {
    margin-bottom: 0;
}

.admin-dashboard-screen .modal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.admin-dashboard-screen .modal input[type="text"],
.admin-dashboard-screen .modal input[type="email"],
.admin-dashboard-screen .modal input[type="tel"],
.admin-dashboard-screen .modal input[type="number"],
.admin-dashboard-screen .modal select,
.admin-dashboard-screen .modal textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.admin-dashboard-screen .modal input:focus,
.admin-dashboard-screen .modal select:focus,
.admin-dashboard-screen .modal textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-dashboard-screen .modal small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.admin-dashboard-screen .modal textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-dashboard-screen .modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    background-color: white;
}

.admin-dashboard-screen .modal-footer .btn {
    min-width: 100px;
}

