* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background: #f0f4f8; color: #1a2536; font-size: 13px; }

.header { background: linear-gradient(135deg,#1F4E79,#2F75B6); color:white; padding:14px 22px; display:flex; align-items:center; gap:14px; }
.header h1 { font-size:17px; font-weight:700; }
.header p  { font-size:11px; opacity:.8; margin-top:2px; }
.badge { background:rgba(255,255,255,.2); border-radius:20px; padding:3px 12px; font-size:11px; white-space:nowrap; }

.layout { display:grid; grid-template-columns:340px 1fr; min-height:calc(100vh - 54px); }
.sidebar { background:#fff; border-right:1px solid #dde3ec; padding:14px; overflow-y:auto; overflow-x:visible; }
.content { padding:0; overflow:auto; display:flex; flex-direction:column; }
.content-inner { padding:14px; flex:1; overflow:auto; }

/* Filter bar */
#filter-bar { background:#fff; border-bottom:2px solid #dde3ec; padding:7px 14px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; position:sticky; top:0; z-index:10; }
.fb-label { font-size:10px; font-weight:700; color:#2F75B6; text-transform:uppercase; white-space:nowrap; }
.fb-sep { width:1px; height:20px; background:#dde3ec; margin:0 2px; flex-shrink:0; }
.fb-btn { display:flex; align-items:center; gap:4px; padding:3px 8px; font-size:11px; cursor:pointer; border:1px solid #ccc; border-radius:4px; background:#fff; white-space:nowrap; font-family:Arial,sans-serif; }
.fb-btn:hover { background:#eef4fb; border-color:#2F75B6; }
.fb-btn.active-filter { background:#E3F2FD; border-color:#1565C0; color:#1565C0; font-weight:700; }
.fb-panel { position:fixed; background:#fff; border:1px solid #bbb; border-radius:5px; box-shadow:0 4px 14px rgba(0,0,0,.2); padding:10px 12px; z-index:2000; min-width:170px; font-size:11px; display:none; }
.fb-panel.open { display:block; }
.fb-panel-items { max-height:200px; overflow-y:auto; margin:6px 0; }
.fb-pill { display:inline-flex; align-items:center; gap:3px; padding:2px 7px; border-radius:10px; font-size:10px; font-weight:600; cursor:pointer; border:1px solid transparent; margin:1px; }
.fb-seg { padding:3px 9px; font-size:11px; cursor:pointer; border:1px solid #ccc; background:#fff; font-family:Arial,sans-serif; }
.fb-seg:first-child { border-radius:4px 0 0 4px; }
.fb-seg:last-child { border-radius:0 4px 4px 0; }
.fb-seg.on { background:#1F4E79; color:#fff; border-color:#1F4E79; }
.fb-toggle-wrap { display:flex; border:1px solid #ccc; border-radius:4px; overflow:hidden; }

.sec { font-size:10px; font-weight:700; text-transform:uppercase; color:#2F75B6; letter-spacing:.5px; margin:14px 0 6px; border-bottom:1px solid #dde3ec; padding-bottom:3px; }
.ctl { margin-bottom:9px; }
.ctl label { display:block; font-size:11px; color:#555; margin-bottom:3px; }
.ctl input[type=range] { width:100%; accent-color:#2F75B6; }
.ctl select { width:100%; padding:4px 6px; border:1px solid #ccc; border-radius:4px; font-size:12px; }
.vd { display:inline-block; background:#2F75B6; color:white; border-radius:10px; padding:1px 8px; font-size:11px; margin-left:6px; min-width:22px; text-align:center; }

/* Profile cards */
.profile-card { border:1.5px solid #dde3ec; border-radius:7px; margin-bottom:8px; overflow:hidden; }
.profile-card .ph { display:flex; align-items:center; gap:6px; padding:6px 8px; font-weight:700; font-size:11px; cursor:pointer; user-select:none; }
.profile-card .ph:hover { filter:brightness(.96); }
.ph-name { flex:1; border:none; background:transparent; font-weight:700; font-size:11px; font-family:Arial,sans-serif; cursor:text; padding:0; min-width:0; }
.ph-name:focus { outline:1px dashed #2F75B6; border-radius:2px; background:rgba(255,255,255,.6); }
.ph-del { background:none; border:none; color:#c00; font-size:13px; cursor:pointer; padding:0 2px; line-height:1; }
.ph-del:hover { color:#900; }
.ph-toggle { font-size:12px; color:#555; cursor:pointer; padding:0 2px; }
.profile-card .pb { padding:8px 10px; background:#fafbfc; display:none; }
.profile-card .pb.open { display:block; }
.pillar-row { display:flex; align-items:center; gap:6px; margin-bottom:5px; font-size:11px; }
.pillar-row input[type=checkbox] { accent-color:#2F75B6; width:14px; height:14px; flex-shrink:0; }
.pillar-row .plabel { flex:1; font-weight:600; }
.pillar-row .maxlabel { font-size:10px; color:#666; }
.pillar-row input[type=number] { width:42px; padding:2px 4px; border:1px solid #ccc; border-radius:3px; font-size:11px; text-align:center; }
.btn-add-profile { width:100%; padding:5px; background:#f0f4f8; border:1.5px dashed #2F75B6; border-radius:5px; color:#2F75B6; font-size:11px; font-weight:700; cursor:pointer; margin-bottom:4px; }
.btn-add-profile:hover { background:#eef4fb; }

/* Modeller assignment table */
.assign-table { width:100%; border-collapse:collapse; font-size:11px; margin-top:4px; table-layout:fixed; }
.assign-table th { background:#1F4E79; color:white; padding:4px 5px; text-align:left; font-size:10px; white-space:nowrap; }
.assign-table td { border-bottom:1px solid #eee; padding:3px 4px; vertical-align:middle; overflow:visible; }
.assign-table tr:last-child td { border-bottom:none; }
.assign-table select, .assign-table input[type=text] { width:100%; font-size:11px; padding:2px 3px; border:1px solid #ccc; border-radius:3px; min-width:0; }
.assign-table th:first-child, .assign-table td:first-child { white-space:nowrap; width:42px; }
.assign-table th:nth-child(2), .assign-table td:nth-child(2) { width:62px; }
.assign-table th:nth-child(3), .assign-table td:nth-child(3) { white-space:nowrap; width:58px; font-size:10px; }
.assign-table th:nth-child(4), .assign-table td:nth-child(4) { width:82px; }
.assign-table th:nth-child(5), .assign-table td:nth-child(5) { width:72px; }
.batch-contract { border:1px solid #dde3ec; background:#f7f9fc; border-radius:5px; padding:7px; margin:6px 0 8px; }
.batch-contract-grid { display:grid; grid-template-columns:1fr 78px; gap:6px; align-items:end; }
.batch-contract label { display:block; font-size:9px; color:#666; margin-bottom:2px; }
.batch-contract select, .batch-contract input { width:100%; font-size:10px; padding:2px 3px; border:1px solid #ccc; border-radius:3px; }
.batch-contract button { width:100%; margin-top:6px; padding:4px 6px; font-size:11px; border:1px solid #1F4E79; border-radius:4px; background:#1F4E79; color:#fff; cursor:pointer; font-weight:700; }

.chk-group { display:flex; flex-wrap:wrap; gap:4px; }
.chk-group label { display:flex; align-items:center; gap:3px; font-size:11px; cursor:pointer; padding:2px 6px; border-radius:3px; border:1px solid #ddd; background:#f9f9f9; }
.chk-group label:hover { background:#eef4fb; }
.chk-group input[type=checkbox] { accent-color:#2F75B6; }

.btn { width:100%; padding:7px; border:none; border-radius:5px; font-size:12px; cursor:pointer; font-weight:600; margin-top:6px; transition:background .2s; color:white; }
.btn-refresh { background:#2F75B6; } .btn-refresh:hover { background:#1F4E79; }
.btn-excel   { background:#2E7D32; } .btn-excel:hover   { background:#1B5E20; }
.btn-pdf     { background:#C62828; } .btn-pdf:hover     { background:#8B0000; }

/* Tabs */
.tabs { display:flex; gap:4px; margin-bottom:12px; border-bottom:2px solid #2F75B6; }
.tab { padding:7px 14px; cursor:pointer; font-size:12px; font-weight:600; color:#666; border-radius:5px 5px 0 0; border:1px solid transparent; border-bottom:none; }
.tab.active { background:#2F75B6; color:white; border-color:#2F75B6; }
.tab:hover:not(.active) { background:#eef4fb; color:#2F75B6; }

/* Cards */
.cards { display:flex; gap:9px; flex-wrap:wrap; margin-bottom:12px; }
.card { background:white; border-radius:7px; padding:10px 14px; min-width:110px; flex:1; box-shadow:0 1px 4px rgba(0,0,0,.08); border-top:3px solid #2F75B6; }
.card.g { border-color:#2E7D32; } .card.o { border-color:#E65100; } .card.r { border-color:#C62828; }
.card .n { font-size:24px; font-weight:700; color:#1F4E79; }
.card.g .n { color:#2E7D32; } .card.o .n { color:#E65100; } .card.r .n { color:#C62828; }
.card .l { font-size:10px; color:#666; margin-top:2px; }

.warn { background:#FFF3E0; border:1px solid #FFB300; border-radius:5px; padding:7px 10px; font-size:11px; margin-bottom:9px; display:none; }
.warn b { color:#E65100; }

.current-col { border-left:2px solid #E60000 !important; border-right:2px solid #E60000 !important; background:#fff7f7 !important; }
.current-head { position:relative; border-left:2px solid #E60000 !important; border-right:2px solid #E60000 !important; background:#2F75B6 !important; }
.current-label { position:absolute; top:-18px; left:50%; transform:translateX(-50%); color:#E60000; font-size:12px; font-weight:700; background:#fff; padding:0 3px; z-index:4; }

/* Tables */
.tscroll { overflow-x:auto; }
table.gt { border-collapse:collapse; font-size:11px; }
table.gt th { background:#1F4E79; color:white; padding:4px 6px; white-space:nowrap; position:sticky; top:0; z-index:2; }
table.gt th.mh { font-size:10px; background:#2F75B6; min-width:26px; max-width:26px; padding:2px; text-align:center; }
table.gt th.yh { background:#1F4E79; text-align:center; }
table.gt td { border:1px solid #e4e4e4; padding:3px 5px; white-space:nowrap; height:21px; }
table.gt td.mb { min-width:26px; max-width:26px; padding:1px; }
.gbar { border-radius:2px; height:15px; opacity:.88; }
.rr td { background:#1F4E79 !important; color:white !important; font-weight:700; font-size:11px; }
.mr td { font-weight:600; }
.lr td { font-size:9px; background:#f5f5f5 !important; }

table.dt { border-collapse:collapse; width:100%; font-size:11px; }
table.dt th { background:#1F4E79; color:white; padding:5px 8px; text-align:left; white-space:nowrap; }
table.dt td { border:1px solid #ddd; padding:4px 7px; }
table.dt tr:nth-child(even) { background:#f7f9fc; }

.tag { display:inline-block; border-radius:3px; padding:1px 6px; font-size:10px; font-weight:600; color:white; }
.ok  { color:#2E7D32; font-weight:700; } .ov { color:#C62828; font-weight:700; }

/* PDF print */
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  .sidebar, .tabs, .cards, .warn, .btn, .header { display:none !important; }
  .layout { display:block; }
  .content { padding:0; }
  .tscroll { overflow:visible; }
  table.gt, table.dt { font-size:9px; page-break-inside:auto; }
  table.gt th, table.dt th { background:#1F4E79 !important; color:white !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .gbar { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  #print-title { display:block !important; font-size:14px; font-weight:700; margin-bottom:8px; color:#1F4E79; }
}
#print-title { display:none; }
