:root{--primary: #172554;--primary-hover: #1e3a8a;--primary-soft: #eff6ff;--bg: #f7f8fc;--surface: #ffffff;--surface-soft: #f8fafc;--border: #e5e7eb;--border-strong: #d1d5db;--text: #111827;--text-secondary: #4b5563;--muted: #6b7280;--success: #15803d;--success-soft: #dcfce7;--danger: #dc2626;--danger-soft: #fee2e2;--warning: #b45309;--warning-soft: #fef3c7;--sidebar-width: 248px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html{min-height:100%}body{margin:0;min-height:100vh;background:radial-gradient(circle at top right,rgba(59,130,246,.05),transparent 30%),var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button{border:0}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid rgba(59,130,246,.22);outline-offset:2px}.app-shell{display:flex;min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);min-height:100vh;display:flex;flex-direction:column;padding:24px 16px;background:linear-gradient(180deg,#172554,#172033);color:#fff;box-shadow:8px 0 30px #0f172a14;z-index:20}.brand{display:flex;align-items:center;gap:12px;padding:4px 8px 28px;margin-bottom:12px;border-bottom:1px solid rgba(255,255,255,.1)}.brand-mark{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:11px;background:#ffffff21;border:1px solid rgba(255,255,255,.16);font-size:12px;font-weight:800;letter-spacing:.04em;box-shadow:inset 0 1px #ffffff1a,0 8px 20px #0000001f}.brand-title{font-size:15px;font-weight:700;letter-spacing:-.01em}.brand-subtitle{margin-top:3px;color:#ffffff94;font-size:11px;font-weight:500}.sidebar nav{display:flex;flex-direction:column;gap:5px}.nav-link{position:relative;display:flex;align-items:center;min-height:44px;padding:0 13px;border-radius:10px;color:#ffffffad;text-decoration:none;font-size:13px;font-weight:500;transition:background .16s ease,color .16s ease,transform .16s ease}.nav-link:hover{background:#ffffff13;color:#fff}.nav-link.active{background:#ffffff21;color:#fff;font-weight:650;box-shadow:inset 3px 0 #ffffffe6}.nav-link.active:after{content:"";position:absolute;right:12px;width:5px;height:5px;border-radius:50%;background:#93c5fd}.main-content{width:calc(100% - var(--sidebar-width));min-height:100vh;margin-left:var(--sidebar-width);padding:42px 48px 64px;max-width:1500px}h1{margin:0;color:var(--text);font-size:30px;line-height:1.2;font-weight:750;letter-spacing:-.035em}h2{margin:0;font-size:20px;line-height:1.3;letter-spacing:-.02em}h3{margin:0;font-size:16px;line-height:1.4}.page-subtitle{margin:8px 0 28px;max-width:760px;color:var(--muted);font-size:14px;line-height:1.6}.card{margin-bottom:20px;padding:24px;background:#fffffff5;border:1px solid var(--border);border-radius:16px;box-shadow:0 1px 2px #0f172a08,0 8px 30px #0f172a09}.card:hover{border-color:#dce1e8}label{display:block;margin:18px 0 7px;color:#374151;font-size:12px;line-height:1.4;font-weight:700;letter-spacing:.01em}label:first-child{margin-top:0}input[type=text],input[type=url],input[type=number],input[type=color],textarea,select{width:100%;padding:11px 13px;color:var(--text);background:#fff;border:1px solid var(--border-strong);border-radius:10px;font-size:14px;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}input[type=text]:hover,input[type=url]:hover,input[type=number]:hover,textarea:hover,select:hover{border-color:#b8c0cc}input[type=text]:focus,input[type=url]:focus,input[type=number]:focus,textarea:focus,select:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61c}input::placeholder,textarea::placeholder{color:#9ca3af}textarea{min-height:180px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;line-height:1.6}select{cursor:pointer}.source-type-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:24px}.source-type-tabs button{min-height:52px;padding:10px 14px;background:var(--surface-soft);color:var(--text-secondary);border:1px solid var(--border);border-radius:11px;cursor:pointer;font-size:13px;font-weight:650;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease,box-shadow .15s ease}.source-type-tabs button:hover{background:#fff;border-color:#cbd5e1;transform:translateY(-1px)}.source-type-tabs button.active{background:var(--primary-soft);color:var(--primary);border-color:#93c5fd;box-shadow:0 0 0 1px #3b82f60d,0 6px 18px #1e40af12}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 18px;margin-top:22px;background:var(--primary);color:#fff;border:1px solid var(--primary);border-radius:10px;cursor:pointer;font-size:13px;font-weight:700;box-shadow:0 5px 12px #17255426;transition:background .15s ease,border-color .15s ease,transform .15s ease,box-shadow .15s ease}.btn:hover{background:var(--primary-hover);border-color:var(--primary-hover);transform:translateY(-1px);box-shadow:0 8px 18px #17255433}.btn:active{transform:translateY(0)}.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}.btn-secondary{background:#fff;color:var(--primary);border:1px solid #cbd5e1;box-shadow:none}.btn-secondary:hover{background:#f8fafc;border-color:#94a3b8;color:var(--primary);box-shadow:none}.btn-danger{background:var(--danger);border-color:var(--danger)}.btn-danger:hover{background:#b91c1c;border-color:#b91c1c}.btn-small{min-height:34px;padding:0 12px;margin-top:0;border-radius:8px;font-size:12px;box-shadow:none}.alert{display:flex;align-items:flex-start;gap:10px;margin-bottom:18px;padding:13px 15px;border:1px solid transparent;border-radius:10px;font-size:13px;line-height:1.5}.alert-success{background:var(--success-soft);color:#166534;border-color:#bbf7d0}.alert-error{background:var(--danger-soft);color:#991b1b;border-color:#fecaca}.badge{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:0 9px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.badge.queued{background:#f1f5f9;color:#64748b}.badge.active{background:var(--warning-soft);color:var(--warning)}.badge.completed{background:var(--success-soft);color:var(--success)}.badge.failed{background:var(--danger-soft);color:var(--danger)}table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;font-size:13px}thead th{padding:11px 12px;color:#6b7280;background:#f8fafc;border-top:1px solid var(--border);border-bottom:1px solid var(--border);font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase}thead th:first-child{border-left:1px solid var(--border);border-top-left-radius:10px}thead th:last-child{border-right:1px solid var(--border);border-top-right-radius:10px}tbody td{padding:13px 12px;color:var(--text-secondary);border-bottom:1px solid var(--border);vertical-align:middle}tbody tr{background:#fff;transition:background .12s ease}tbody tr:hover{background:#f8fafc}tbody tr:last-child td{border-bottom:1px solid var(--border)}td strong{color:var(--text)}.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;margin-bottom:24px}.stat-box{position:relative;min-height:118px;padding:19px;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 1px 2px #0f172a06,0 6px 20px #0f172a06}.stat-box .value{margin-top:7px;color:var(--primary);font-size:28px;line-height:1;font-weight:750;letter-spacing:-.04em}.stat-box .label{margin-top:11px;color:var(--muted);font-size:11px;font-weight:650;text-transform:uppercase;letter-spacing:.05em}.template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:18px}.template-card{overflow:hidden;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 2px 5px #0f172a06,0 10px 25px #0f172a09;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.template-card:hover{transform:translateY(-2px);border-color:#cbd5e1;box-shadow:0 5px 12px #0f172a0d,0 16px 30px #0f172a0f}.template-swatch{height:74px}.template-body{padding:16px}.template-name{color:var(--text);font-size:14px;font-weight:700}.template-kind{margin-top:4px;color:var(--muted);font-size:11px;font-weight:600;text-transform:capitalize}.empty-state{padding:54px 24px;color:var(--muted);text-align:center;font-size:13px;line-height:1.6;background:#fafbfc;border:1px dashed #d7dde6;border-radius:12px}a{color:var(--primary)}@media (max-width: 1000px){:root{--sidebar-width: 210px}.main-content{padding:34px 28px 50px}.stat-grid{grid-template-columns:repeat(2,1fr)}}@media (max-width: 760px){.app-shell{display:block}.sidebar{position:relative;width:100%;min-height:auto;padding:14px;box-shadow:0 5px 20px #0f172a1a}.brand{margin-bottom:12px;padding-bottom:14px}.sidebar nav{flex-direction:row;overflow-x:auto}.nav-link{flex:1 0 auto;justify-content:center}.nav-link.active:after{display:none}.main-content{width:100%;margin-left:0;padding:28px 18px 40px}h1{font-size:25px}.source-type-tabs{grid-template-columns:1fr}.stat-grid{grid-template-columns:1fr 1fr}.card{padding:18px}table{min-width:700px}.card:has(table){overflow-x:auto}}@media (max-width: 480px){.stat-grid{grid-template-columns:1fr}h1{font-size:23px}.main-content{padding:24px 14px 36px}}.generate-page{max-width:1080px}.page-header{margin-bottom:30px}.eyebrow{margin-bottom:8px;color:#3b82f6;font-size:10px;font-weight:800;letter-spacing:.12em}.workspace-section{margin-bottom:22px;padding:25px;background:#fffffff5;border:1px solid var(--border);border-radius:16px;box-shadow:0 1px 2px #0f172a06,0 8px 28px #0f172a08}.section-heading{display:flex;align-items:flex-start;gap:13px;margin-bottom:20px}.section-heading-row{align-items:center;justify-content:space-between}.section-heading-left{display:flex;align-items:flex-start;gap:13px}.section-number{display:flex;align-items:center;justify-content:center;width:31px;height:31px;flex-shrink:0;border-radius:9px;background:var(--primary-soft);color:#2563eb;font-size:10px;font-weight:800;letter-spacing:.04em}.section-heading h2{font-size:16px}.section-heading p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.source-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.source-card{position:relative;display:flex;align-items:center;gap:13px;min-height:82px;padding:14px;text-align:left;background:#f8fafc;border:1px solid var(--border);border-radius:12px;cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease}.source-card:hover{background:#fff;border-color:#cbd5e1;transform:translateY(-1px)}.source-card.selected{background:#eff6ff;border-color:#60a5fa;box-shadow:0 0 0 2px #3b82f60f}.source-icon{display:flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:10px;background:#fff;color:var(--primary);border:1px solid var(--border);font-size:16px;font-weight:700}.source-card-content{display:flex;flex-direction:column;gap:4px}.source-card-content strong{color:var(--text);font-size:13px}.source-card-content small{color:var(--muted);font-size:10px;line-height:1.4}.source-check{position:absolute;top:10px;right:10px;display:flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:50%;background:#2563eb;color:#fff;font-size:10px;font-weight:800}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.field{min-width:0}.field label{margin-top:0}.field-hint{display:block;margin-top:6px;color:#9ca3af;font-size:10px;line-height:1.5}.character-count{color:#9ca3af;font-size:10px}.editor-shell{overflow:hidden;border:1px solid var(--border-strong);border-radius:12px;background:#fff}.editor-toolbar{display:flex;align-items:center;justify-content:space-between;padding:9px 13px;background:#f8fafc;border-bottom:1px solid var(--border);color:#9ca3af;font-size:10px}.editor-language{color:#475569;font-size:9px;font-weight:800;letter-spacing:.08em}.document-editor{display:block;width:100%;min-height:300px;padding:18px;border:0;border-radius:0;resize:vertical;color:#1e293b;background:#fff;font-size:13px;line-height:1.7}.document-editor:focus{box-shadow:none;outline:none}.input-panel{display:flex;align-items:flex-start;gap:16px;padding:18px;background:#f8fafc;border:1px solid var(--border);border-radius:12px}.large-input-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex-shrink:0;border-radius:11px;background:#fff;border:1px solid var(--border);color:var(--primary);font-size:17px;font-weight:700}.input-panel .field{flex:1}.template-selector{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.template-option{position:relative;display:flex;align-items:center;gap:12px;padding:12px;text-align:left;background:#f8fafc;border:1px solid var(--border);border-radius:11px;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .15s ease}.template-option:hover{background:#fff;border-color:#cbd5e1;transform:translateY(-1px)}.template-option.selected{background:#eff6ff;border-color:#60a5fa}.template-preview{display:flex;align-items:center;justify-content:center;width:43px;height:52px;flex-shrink:0;border-radius:5px;color:#fff;font-family:Georgia,serif;font-size:16px;font-weight:700;box-shadow:0 2px 5px #0f172a1f}.default-preview{background:#334155}.template-option>div:nth-child(2){display:flex;flex-direction:column;gap:4px}.template-option strong{color:var(--text);font-size:12px}.template-option span:not(.template-check){color:var(--muted);font-size:10px}.template-check{position:absolute;top:10px;right:10px;color:#2563eb;font-size:13px;font-weight:800}.generate-action{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:26px 0;padding:18px 20px;background:linear-gradient(135deg,#172554,#1e3a8a);border-radius:15px;box-shadow:0 12px 30px #1725542e}.generate-action-info{display:flex;align-items:center;gap:13px;color:#fff}.generate-action-info>div:last-child{display:flex;flex-direction:column;gap:4px}.generate-action-info strong{font-size:13px}.generate-action-info span{color:#ffffffa6;font-size:10px}.generate-action-icon{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:10px;background:#ffffff1f;border:1px solid rgba(255,255,255,.14);font-size:9px;font-weight:800;letter-spacing:.05em}.generate-button{min-width:155px;margin-top:0;background:#fff;color:var(--primary);border-color:#fff;box-shadow:none}.generate-button:hover{background:#f8fafc;color:var(--primary);border-color:#f8fafc}.button-spinner{width:13px;height:13px;border:2px solid rgba(23,37,84,.2);border-top-color:var(--primary);border-radius:50%;animation:button-spin .7s linear infinite}@keyframes button-spin{to{transform:rotate(360deg)}}.generation-result{margin-top:24px;padding:24px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 8px 30px #0f172a0d}.generation-result.completed{border-color:#bbf7d0}.generation-result.failed{border-color:#fecaca}.result-header{display:flex;align-items:flex-start;gap:14px}.result-icon{display:flex;align-items:center;justify-content:center;width:42px;height:42px;flex-shrink:0;border-radius:12px;background:#f1f5f9;color:#64748b;font-size:18px;font-weight:800}.generation-result.completed .result-icon{background:var(--success-soft);color:var(--success)}.generation-result.failed .result-icon{background:var(--danger-soft);color:var(--danger)}.result-label{margin-bottom:3px;color:#64748b;font-size:9px;font-weight:800;letter-spacing:.1em}.result-header h2{margin:0;font-size:17px}.result-header p{max-width:650px;margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.6}.generation-steps{display:flex;align-items:center;max-width:600px;margin:25px 0}.generation-step{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:70px}.generation-step span{display:flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:50%;background:#f1f5f9;color:#94a3b8;font-size:10px;font-weight:800}.generation-step.complete span{background:#dcfce7;color:#15803d}.generation-step.current span{background:#dbeafe;color:#2563eb}.generation-step small{color:#94a3b8;font-size:9px;font-weight:650}.generation-step.complete small,.generation-step.current small{color:#475569}.generation-line{height:2px;flex:1;background:#e5e7eb;margin:0 5px 18px}.generation-line.complete{background:#86efac}.result-actions{display:flex;gap:10px;padding-top:18px;border-top:1px solid var(--border)}.result-actions .btn{margin-top:0}.alert-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;border-radius:50%;font-size:10px;font-weight:800}@media (max-width: 800px){.source-cards,.form-grid,.template-selector{grid-template-columns:1fr}.generate-action{align-items:stretch;flex-direction:column}.generate-button{width:100%}}@media (max-width: 520px){.workspace-section{padding:18px}.section-heading-row{align-items:flex-start;flex-direction:column}.input-panel,.result-actions{flex-direction:column}.result-actions .btn{width:100%}}.source-card{min-height:96px;padding:17px;background:linear-gradient(145deg,#fff,#f8fafc)}.source-card:hover{transform:translateY(-2px);border-color:#93c5fd;box-shadow:0 8px 22px #0f172a0f}.source-card.selected{background:linear-gradient(145deg,#eff6ff,#f8fbff);border-color:#60a5fa;box-shadow:0 0 0 3px #3b82f614,0 10px 24px #1e40af14}.source-icon{width:44px;height:44px;border-radius:12px;color:#2563eb;background:#eff6ff;border-color:#dbeafe}.source-icon svg{width:21px;height:21px}.source-card.selected .source-icon{background:#2563eb;color:#fff;border-color:#2563eb}.source-card-content strong{font-size:13px;font-weight:750}.source-card-content small{font-size:11px;line-height:1.5}.source-check{width:20px;height:20px;background:#2563eb;box-shadow:0 2px 6px #2563eb40}.editor-shell{border-color:#d5dbe5;box-shadow:0 2px 5px #0f172a06,0 10px 25px #0f172a09}.editor-toolbar{min-height:42px;padding:0 14px;background:#f8fafc}.editor-language{display:inline-flex;align-items:center;gap:7px}.editor-language:before{content:"";width:7px;height:7px;border-radius:50%;background:#3b82f6}.document-editor{min-height:330px;padding:20px;background:linear-gradient(to bottom,#fff 0,#fff 31px,#f8fafc 32px);font-size:13px;line-height:1.8}.document-editor::selection{background:#dbeafe}.template-selector{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.template-option{min-height:78px;padding:13px;background:#fff;box-shadow:0 1px 2px #0f172a06;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease}.template-option:hover{transform:translateY(-2px);border-color:#93c5fd;box-shadow:0 8px 20px #0f172a0f}.template-option.selected{background:#f8fbff;border-color:#60a5fa;box-shadow:0 0 0 3px #3b82f612,0 8px 20px #1e40af0d}.template-preview{width:47px;height:57px;border-radius:6px;position:relative;overflow:hidden;box-shadow:0 3px 8px #0f172a21}.template-preview:after{content:"Aa";position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#fff;font-family:Georgia,serif;font-size:17px;font-weight:700}.template-preview{font-size:0}.default-preview{background:linear-gradient(135deg,#334155,#0f172a)}.template-option strong{font-size:13px}.template-option span:not(.template-check){font-size:10px}.template-check{width:21px;height:21px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#2563eb;color:#fff!important;font-size:10px!important;box-shadow:0 2px 6px #2563eb40}.generate-action{position:relative;overflow:hidden;margin-top:30px;padding:20px 22px;background:radial-gradient(circle at 15% 50%,rgba(96,165,250,.16),transparent 35%),linear-gradient(135deg,#111c3d,#172554 55%,#1e3a8a);border:1px solid rgba(255,255,255,.08);box-shadow:0 18px 40px #0f172a2e}.generate-action:after{content:"";position:absolute;width:220px;height:220px;right:-100px;top:-130px;border-radius:50%;background:#93c5fd14}.generate-action-info{position:relative;z-index:1}.generate-action-icon{width:46px;height:46px;background:#ffffff1a;border:1px solid rgba(255,255,255,.15);box-shadow:inset 0 1px #ffffff14}.generate-button{position:relative;z-index:2;min-width:165px;min-height:44px;font-size:13px;box-shadow:0 6px 18px #00000024}.generation-result{position:relative;overflow:hidden;padding:26px;box-shadow:0 12px 35px #0f172a0f}.generation-result.completed{background:linear-gradient(135deg,#fff,#f7fff9);border-color:#bbf7d0}.generation-result.completed:before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:#22c55e}.generation-result.completed .result-icon{width:46px;height:46px;box-shadow:0 4px 12px #22c55e1f}.result-actions .btn{min-height:42px}.generation-result.completed .result-actions .btn:first-child{min-width:145px}
