:root{--primary: #1e3a8a;--secondary: #7c3aed;--accent: #10b981;--bg: #f8fafc;--surface: #ffffff;--border: #e2e8f0;--text: #0f172a;--text-muted: #64748b;--green: #10b981;--yellow: #f59e0b;--red: #ef4444;--green-bg: #d1fae5;--yellow-bg: #fef3c7;--red-bg: #fee2e2}*{box-sizing:border-box;margin:0;padding:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:var(--bg);color:var(--text);font-size:14px}button{cursor:pointer;border:none;font-family:inherit;font-size:inherit}input,select,textarea{font-family:inherit;font-size:inherit}.login-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%);padding:20px}.login-box{background:#fff;padding:48px 40px;border-radius:16px;box-shadow:0 25px 50px #00000040;width:100%;max-width:420px}@media(max-width:480px){.login-box{padding:32px 24px}}.login-box h1{font-size:24px;margin-bottom:8px}.login-box p{color:var(--text-muted);margin-bottom:32px}.login-box label{display:block;margin-bottom:6px;font-weight:500;font-size:13px}.login-box input{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:8px;margin-bottom:18px}.login-box input:focus{outline:none;border-color:var(--primary)}.login-box button{width:100%;padding:14px;background:var(--primary);color:#fff;border-radius:8px;font-weight:600;transition:opacity .2s}.login-box button:hover{opacity:.9}.login-box button:disabled{opacity:.5;cursor:not-allowed}.login-error{background:var(--red-bg);color:var(--red);padding:10px 14px;border-radius:8px;margin-bottom:16px;font-size:13px}.login-hint{font-size:12px;color:var(--text-muted);margin-top:16px;text-align:center}.app{min-height:100vh;display:flex;flex-direction:column}.header{background:linear-gradient(135deg,var(--primary) 0%,var(--secondary) 100%);color:#fff;padding:16px 24px;display:flex;align-items:center;gap:24px;box-shadow:0 2px 10px #0000001a}.header-brand{display:flex;align-items:center;gap:12px;flex:1}.header-logo{width:44px;height:44px;border-radius:50%;background:#ffffff26;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;overflow:hidden}.header-logo img{width:100%;height:100%;object-fit:cover}.header-title h1{font-size:18px;font-weight:700}.header-title p{font-size:12px;opacity:.85}.header-stats{display:flex;gap:12px}.stat-chip{background:#ffffff1f;padding:10px 16px;border-radius:10px;text-align:center;min-width:90px}.stat-chip .num{font-size:20px;font-weight:700;line-height:1}.stat-chip .lbl{font-size:10px;opacity:.85;text-transform:uppercase;letter-spacing:.5px;margin-top:4px}.header-actions{display:flex;gap:8px;flex-shrink:0}.icon-btn{background:#ffffff26;color:#fff;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s;flex-shrink:0}.icon-btn:hover{background:#ffffff40}@media(max-width:640px){.header{flex-wrap:wrap;padding:12px 16px;gap:10px}.header-brand{min-width:0}.header-title h1{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title p{display:none}.header-actions{order:2}.header-stats{order:3;flex:1 1 100%;overflow-x:auto;gap:8px}.stat-chip{min-width:0;flex:1;padding:8px 10px}}.layout{display:grid;grid-template-columns:320px 1fr;gap:20px;padding:20px;flex:1}@media(max-width:1024px){.layout{grid-template-columns:1fr}}.sidebar{display:flex;flex-direction:column;gap:16px}.card{background:#fff;border-radius:12px;padding:18px;box-shadow:0 1px 3px #0000000d}.card-title{font-weight:600;font-size:14px;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between}.card-title .badge{background:var(--bg);color:var(--text-muted);padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600}.upload-zone{border:2px dashed var(--border);border-radius:12px;padding:28px 16px;text-align:center;cursor:pointer;transition:all .2s}.upload-zone:hover,.upload-zone.dragover{border-color:var(--primary);background:#1e3a8a08}.upload-zone .icon{width:48px;height:48px;margin:0 auto 12px;background:var(--bg);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:22px}.upload-zone p{font-weight:500;margin-bottom:4px}.upload-zone span{font-size:12px;color:var(--text-muted)}.supplier-list{display:flex;flex-direction:column;gap:8px}.supplier{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;background:var(--bg);border:2px solid transparent;cursor:pointer;transition:border-color .15s,background .15s,opacity .15s}.supplier-active{border-color:color-mix(in srgb,var(--primary) 40%,transparent);background:color-mix(in srgb,var(--primary) 8%,transparent)}.supplier-inactive{opacity:.5}.supplier-inactive:hover{opacity:.75}.supplier .dot{width:10px;height:10px;border-radius:50%}.supplier .info{flex:1}.supplier .name{font-weight:500;font-size:13px}.supplier .meta{font-size:11px;color:var(--text-muted)}.supplier-delete{font-size:13px;opacity:.6}.supplier-delete:hover{opacity:1;color:var(--red)}.main{background:#fff;border-radius:12px;box-shadow:0 1px 3px #0000000d;overflow:hidden;display:flex;flex-direction:column}.tabs{display:flex;border-bottom:1px solid var(--border);padding:0 20px;gap:4px;overflow-x:auto}.tab{padding:16px 18px;border:none;background:transparent;font-weight:500;color:var(--text-muted);border-bottom:2px solid transparent;transition:all .2s;white-space:nowrap}.tab:hover{color:var(--text)}.tab.active{color:var(--primary);border-bottom-color:var(--primary)}.tab-toolbar{display:flex;gap:8px;padding:16px 20px;border-bottom:1px solid var(--border);align-items:center;flex-wrap:wrap}.tab-content{flex:1;overflow:auto}.filter-chip{padding:6px 14px;border:1px solid var(--border);background:#fff;border-radius:999px;font-size:12px;transition:all .2s}.filter-chip:hover{border-color:var(--primary)}.filter-chip.active{background:var(--primary);color:#fff;border-color:var(--primary)}.search-input{flex:1;min-width:200px;max-width:280px;padding:8px 14px;border:1px solid var(--border);border-radius:999px}.btn{padding:8px 16px;background:var(--primary);color:#fff;border-radius:8px;font-weight:500;font-size:13px;transition:opacity .2s;display:inline-flex;align-items:center;gap:6px}.btn:hover{opacity:.9}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.btn-secondary{background:var(--bg);color:var(--text);border:1px solid var(--border)}.btn.btn-ghost{background:transparent;color:var(--primary)}.btn.btn-success{background:var(--accent)}.btn.btn-danger{background:var(--red)}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse}th{text-align:left;padding:12px 16px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted);border-bottom:1px solid var(--border);white-space:nowrap}td{padding:14px 16px;border-bottom:1px solid var(--border);vertical-align:middle}tr:hover td{background:var(--bg)}.product-cell .name{font-weight:600;margin-bottom:2px}.product-cell .cat{font-size:12px;color:var(--text-muted)}.price-cell{text-align:right}.price-cell .price{font-weight:700;font-size:15px;margin-bottom:2px}.price-cell .norm,.price-cell .pkg{font-size:11px;color:var(--text-muted)}.price-cell.green .price{color:var(--green)}.price-cell.yellow .price{color:var(--yellow)}.price-cell.red .price{color:var(--red)}.traffic-light{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle}.tl-green{background:var(--green)}.tl-yellow{background:var(--yellow)}.tl-red{background:var(--red)}.cheapest-badge{background:var(--green-bg);color:var(--green);padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600;margin-bottom:4px;display:inline-block}.savings-tag{font-size:11px;padding:2px 6px;border-radius:4px;font-weight:600;display:inline-block;margin-top:2px}.savings-tag.green{background:var(--green-bg);color:var(--green)}.savings-tag.red{background:var(--red-bg);color:var(--red)}.price-history-tooltip{position:absolute;top:100%;right:0;z-index:100;background:#fff;border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px #0000002e;padding:10px 12px;width:220px;text-align:left;margin-top:4px}.price-history-title{font-weight:700;font-size:11px;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px}.price-history-empty{font-size:12px;color:var(--text-muted)}.price-history-row{display:flex;justify-content:space-between;font-size:12px;padding:3px 0;border-bottom:1px solid var(--border)}.price-history-row:last-child{border-bottom:none}.price-history-date{color:var(--text-muted)}.recs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:16px;padding:20px}@media(max-width:420px){.recs-grid{grid-template-columns:1fr;padding:16px}}.rec-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px;border-left:4px solid}.rec-card.green{border-left-color:var(--green)}.rec-card.yellow{border-left-color:var(--yellow)}.rec-card.red{border-left-color:var(--red)}.rec-card .rec-product{font-weight:700;margin-bottom:6px}.rec-card .rec-text{color:var(--text-muted);font-size:13px;line-height:1.5;margin-bottom:12px}.rec-card .rec-period{font-size:12px;color:var(--text-muted);margin-bottom:8px}.rec-card .rec-period input{width:70px;padding:2px 6px;margin:0 2px}.rec-card .rec-savings{font-size:22px;font-weight:700}.rec-card.green .rec-savings{color:var(--green)}.rec-card.yellow .rec-savings{color:var(--yellow)}.rec-card.red .rec-savings{color:var(--red)}.mapping-list{padding:20px;display:flex;flex-direction:column;gap:10px}.mapping-row{display:grid;grid-template-columns:1fr auto 1fr auto;gap:12px;align-items:center;padding:12px;background:var(--bg);border-radius:8px}.mapping-row .arrow{color:var(--text-muted)}.mapping-row .source{font-size:13px}.mapping-row select{padding:6px 10px;border:1px solid var(--border);border-radius:6px}@media(max-width:640px){.mapping-row{grid-template-columns:1fr}.mapping-row .arrow{display:none}}.history-list{padding:20px;display:flex;flex-direction:column;gap:8px}.history-row{display:grid;grid-template-columns:auto 1fr auto auto;gap:12px;align-items:center;padding:12px 16px;background:var(--bg);border-radius:8px}.history-row .file-icon{width:36px;height:36px;background:var(--surface);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px}.history-row .meta{font-size:12px;color:var(--text-muted)}.history-row .badge{padding:4px 10px;border-radius:4px;font-size:11px;font-weight:600;white-space:nowrap}@media(max-width:640px){.history-row{display:flex;flex-wrap:wrap}.history-row .file-icon{flex-shrink:0}.history-row>div+div{flex:1 1 auto;min-width:0}.history-row .badge{margin-left:auto;flex-shrink:0}}.badge-green{background:var(--green-bg);color:var(--green)}.badge-yellow{background:var(--yellow-bg);color:var(--yellow)}.badge-red{background:var(--red-bg);color:var(--red)}.modal-bg{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;align-items:center;justify-content:center;z-index:1000;padding:20px}.modal-bg.active{display:flex}.modal{background:#fff;border-radius:16px;max-width:540px;width:100%;max-height:90vh;overflow-y:auto}.modal-head{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}.modal-head h2{font-size:18px}.modal-close{background:var(--bg);width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.modal-body{padding:24px}.modal-foot{padding:16px 24px;border-top:1px solid var(--border);display:flex;gap:8px;justify-content:flex-end}.modal-body label{display:block;margin-bottom:6px;font-weight:500;font-size:13px}.modal-body input,.modal-body textarea,.modal-body select{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:6px;margin-bottom:16px}.modal-body textarea{min-height:140px;resize:vertical;font-family:inherit}.form-row{display:grid;grid-template-columns:160px 1fr;gap:16px;align-items:center;margin-bottom:14px}.form-row label{font-weight:500;font-size:13px;margin-bottom:0}@media(max-width:640px){.form-row{grid-template-columns:1fr;gap:4px}}.toasts{position:fixed;top:20px;right:20px;left:20px;z-index:2000;display:flex;flex-direction:column;align-items:flex-end;gap:8px}.toast{background:#fff;padding:12px 18px;border-radius:8px;box-shadow:0 4px 12px #00000026;border-left:4px solid;width:280px;max-width:100%;animation:slideIn .3s ease}.toast.success{border-left-color:var(--green)}.toast.error{border-left-color:var(--red)}.toast.info{border-left-color:var(--primary)}@keyframes slideIn{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.empty{padding:60px 20px;text-align:center;color:var(--text-muted)}.empty .icon{font-size:48px;margin-bottom:12px}.empty p{font-size:14px}.spinner{width:14px;height:14px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}.status-widget{position:fixed;bottom:20px;right:20px;left:20px;margin-left:auto;z-index:1500;background:#fff;border-radius:12px;box-shadow:0 8px 24px #0000002e;width:320px;max-width:calc(100vw - 40px);overflow:hidden}.status-widget-head{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;background:var(--bg)}.status-widget-head .title{font-weight:600;font-size:13px;flex:1}.status-widget-body{max-height:260px;overflow-y:auto;padding:8px 16px 14px}.status-widget-item{padding:8px 0;border-bottom:1px solid var(--border);font-size:12px}.status-widget-item:last-child{border-bottom:none}.status-widget-item .fn{font-weight:500;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-widget-item .st{color:var(--text-muted)}.status-widget-item .st.error{color:var(--red)}.status-widget-item .st.done{color:var(--green)}.status-widget-dismiss{background:none;border:none;color:var(--red);cursor:pointer;font-size:14px;line-height:1;padding:0 0 0 8px;font-weight:700}.status-widget-dismiss:hover{text-decoration:underline}.status-widget-retry{background:none;border:1px solid var(--border);border-radius:4px;color:var(--text);cursor:pointer;font-size:11px;padding:2px 6px}.status-widget-retry:hover{background:var(--bg)}.admin-shell{max-width:960px;margin:0 auto;padding:32px 20px}.admin-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.admin-table th,.admin-table td{text-align:left}
