:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --surface-border: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.glass-header h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Tiles & Grid */
.main-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5rem;
}

.main-tile {
    width: 500px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.main-tile img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.tile-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

/* Split Column View for OCR */
.split-view {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.split-left, .split-right {
    flex: 1;
    padding: 1.5rem;
}

/* OCR Image Preview */
.ocr-preview {
    width: 100%;
    max-height: 800px;
    height: 600px;
    object-fit: contain;
    border: 1px dashed var(--text-secondary);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}

/* Summary Box */
.summary-box {
    background: rgba(255,255,255,0.02);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
}

.editable-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.editable-cell span.pencil {
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}
.editable-cell span.pencil:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Print Modal Overlay */
.print-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.print-content {
    background: #fff;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-content iframe {
    flex: 1;
    border: none;
    background: white;
    min-height: 0;
}

.print-actions {
    flex-shrink: 0;
    padding: 1rem;
    background: #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid #cbd5e1;
}

.btn-print-close {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #94a3b8;
}

.btn-print-close:hover {
    background: #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    .split-view {
        flex-direction: column;
    }
}
