*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#f5f5f5;color:#333}
.login-page{display:flex;justify-content:center;align-items:center;min-height:100vh}
.login-card{background:#fff;padding:2rem;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.1);width:100%;max-width:400px}
.login-card h1{margin-bottom:1.5rem;text-align:center}
label{display:block;margin:.75rem 0 .25rem;font-weight:600;font-size:.9rem}
input,select,textarea{width:100%;padding:.6rem;border:1px solid #ddd;border-radius:6px;font-size:1rem;font-family:inherit}
textarea{resize:vertical}
button{padding:.7rem 1.2rem;background:#2563eb;color:#fff;border:none;border-radius:6px;font-size:1rem;cursor:pointer}
button:hover{background:#1d4ed8}
.alert{padding:.6rem 1rem;border-radius:6px;margin-bottom:1rem;font-size:.9rem}
.alert.error{background:#fee2e2;color:#991b1b}
.alert.warn{background:#fef3c7;color:#92400e}
.alert.success{background:#dcfce7;color:#166534}
.cf-turnstile{margin-top:1rem}
.container{max-width:1400px;margin:0 auto;padding:1.5rem}
header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}
header h1{font-size:1.5rem}
.header-right{display:flex;align-items:center;gap:1rem}
.btn-small{padding:.35rem .7rem;background:#2563eb;color:#fff;text-decoration:none;border-radius:6px;font-size:.8rem;border:none;cursor:pointer;display:inline-block}
.btn-small:hover{background:#1d4ed8}
.btn-small.active{background:#1e40af}
.btn-small.btn-gray{background:#6b7280}
.btn-small.btn-gray:hover{background:#4b5563}
.btn-small.btn-red{background:#dc2626}
.btn-small.btn-red:hover{background:#b91c1c}
.btn-small.btn-green{background:#16a34a}
.btn-small.btn-green:hover{background:#15803d}
.tabs{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1.5rem;border-bottom:2px solid #e2e8f0;padding-bottom:.5rem}
.tabs a{text-decoration:none;padding:.5rem 1rem;border-radius:6px 6px 0 0;color:#475569;font-weight:500;font-size:.9rem}
.tabs a:hover{background:#f1f5f9}
.tabs a.active{background:#2563eb;color:#fff}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:2rem}
.card{background:#fff;padding:1.25rem;border-radius:10px;box-shadow:0 1px 6px rgba(0,0,0,.08)}
.card-value{font-size:1.8rem;font-weight:700;color:#1e293b}
.card-label{font-size:.85rem;color:#64748b;margin-top:.25rem}
.card-sub{font-size:.8rem;color:#94a3b8;margin-top:.25rem}
.card-sub.warn{color:#dc2626}
.section{background:#fff;padding:1.5rem;border-radius:10px;box-shadow:0 1px 6px rgba(0,0,0,.08);margin-bottom:1.5rem}
.section h2{font-size:1.1rem;margin-bottom:1rem}
.empty{color:#94a3b8;font-style:italic}
.meta{font-size:.85rem;color:#64748b;margin:.75rem 0}
table{width:100%;border-collapse:collapse;font-size:.85rem}
th,td{padding:.5rem .6rem;text-align:left;border-bottom:1px solid #e2e8f0}
th{font-weight:600;color:#475569;background:#f8fafc;white-space:nowrap}
tr:hover{background:#f1f5f9}
.nowrap{white-space:nowrap}
.truncate{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filter-form{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;align-items:end}
.filter-form input,.filter-form select{width:auto;min-width:120px}
.pagination{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:1rem}
.inline-form{display:flex;flex-wrap:wrap;gap:.5rem;align-items:end;padding:.5rem 0}
.inline-form input,.inline-form textarea{width:auto;min-width:200px}
@media(max-width:768px){
.stats-grid{grid-template-columns:repeat(2,1fr)}
header{flex-direction:column;align-items:flex-start;gap:.5rem}
table{font-size:.75rem}
th,td{padding:.3rem}
.filter-form{flex-direction:column}
.filter-form input,.filter-form select{width:100%}
.tabs{overflow-x:auto;flex-wrap:nowrap}
}

.header-left{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.company-switcher select{padding:.4rem .6rem;border:1px solid #ddd;border-radius:6px;font-size:.85rem;background:#fff}
.company-badge{padding:.3rem .7rem;background:#e0e7ff;color:#3730a3;border-radius:6px;font-size:.85rem;font-weight:600}
@media(max-width:768px){.header-left{flex-direction:column;align-items:flex-start}}
