* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; font-size: 13px; background: #eef1f5; color: #222; }
.topbar { background: #235d8c; color: #fff; display: flex; align-items: center; padding: 0 14px; height: 44px; gap: 2px; }
.topbar a { color: #d9e8f5; text-decoration: none; padding: 0 12px; height: 44px; display: flex; align-items: center; font-weight: bold; }
.topbar a:hover, .topbar a.active { background: #184366; color: #fff; }
.topbar .brand { margin-left: auto; font-size: 12px; color: #c5ddf0; }
.subbar { background: #fff; border-bottom: 1px solid #d5dce4; display: flex; padding: 0 14px; gap: 16px; height: 34px; align-items: center; }
.subbar a { color: #4a5568; text-decoration: none; height: 34px; display: flex; align-items: center; border-bottom: 2px solid transparent; }
.subbar a.active { color: #1976d2; font-weight: bold; border-bottom-color: #1976d2; }
.doc-wrap { background: #fff; margin: 10px 14px; padding: 14px 18px; border: 1px solid #d6dde5; border-radius: 4px; }
.doc-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #eef1f4; flex-wrap: wrap; }
.btn-save { background: #7cb342; color: #fff; border: none; padding: 7px 16px; border-radius: 3px; font-weight: bold; cursor: pointer; }
.btn-save:hover { background: #689f38; }
.btn-sec { background: #fff; color: #333; border: 1px solid #c5cdd6; padding: 6px 12px; border-radius: 3px; cursor: pointer; text-decoration: none; }
.btn-blue { background: #1a73e8; color: #fff; border: none; padding: 6px 14px; border-radius: 3px; font-weight: bold; cursor: pointer; text-decoration: none; }
.btn-red { background: #e53935; color: #fff; border: none; padding: 4px 8px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.doc-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.doc-title-row h2 { margin: 0; font-size: 18px; font-weight: bold; }
.doc-grid { display: grid; grid-template-columns: 360px 360px; gap: 8px 28px; margin-bottom: 16px; }
.frow { display: flex; align-items: center; gap: 8px; }
.frow label { width: 115px; color: #666; font-size: 12px; }
.frow input, .frow select { flex: 1; padding: 5px 8px; border: 1px solid #cfd6de; border-radius: 3px; background: #fff; }
.tabs { display: flex; align-items: center; border-bottom: 1px solid #dde2e8; margin-bottom: 10px; gap: 16px; }
.tabs .tab-act { padding: 8px 4px; font-weight: bold; color: #1976d2; border-bottom: 2px solid #1976d2; }
.tabs .right-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th { background: #f7f9fb; color: #666; font-weight: normal; font-size: 12px; padding: 7px 8px; border-top: 1px solid #e2e7ed; border-bottom: 1px solid #e2e7ed; text-align: left; }
td { padding: 6px 8px; border-bottom: 1px solid #eef1f4; }
tr:hover td { background: #f5f9ff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: #d32f2f; font-weight: bold; }
.tfoot { background: #f7f9fb; font-weight: bold; }
.add-row td { background: #fafbfd; }
.add-row input { padding: 5px 7px; border: 1px solid #cfd6de; border-radius: 3px; width: 100%; }
.bottom-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; margin-top: 14px; align-items: start; }
.comment-box { width: 100%; min-height: 76px; padding: 8px; border: 1px solid #cfd6de; border-radius: 3px; resize: vertical; }
.totals-box { background: #f8fafc; border: 1px solid #e4e9ef; padding: 10px 14px; border-radius: 3px; }
.tot-line { display: flex; justify-content: space-between; margin-bottom: 6px; color: #555; }
.tot-big { display: flex; justify-content: space-between; font-size: 16px; font-weight: bold; border-top: 1px solid #dde3ea; padding-top: 8px; margin-top: 6px; }
.ok { background: #e8f5e9; color: #2e7d32; padding: 8px 12px; border-radius: 3px; margin-bottom: 10px; }
.err { background: #ffebee; color: #c62828; padding: 8px 12px; border-radius: 3px; margin-bottom: 10px; }
.badge { padding: 2px 7px; border-radius: 3px; font-size: 11px; font-weight: bold; }
.b-shipped { background: #e3f2fd; color: #1565c0; }
.b-delivered { background: #e8f5e9; color: #2e7d32; }
.b-cancelled { background: #fff3e0; color: #ef6c00; }
.b-defect { background: #ffebee; color: #c62828; }
.search-wrap { position: relative; }
.drop-menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #1a73e8; border-radius: 3px; box-shadow: 0 4px 12px rgba(0,0,0,0.14); max-height: 260px; overflow-y: auto; z-index: 99; display: none; }
.drop-item { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #eef1f4; display: flex; justify-content: space-between; gap: 10px; }
.drop-item:hover { background: #e8f1fd; }
.muted { color: #777; font-size: 12px; white-space: nowrap; }
.cell-inp { width: 90px; padding: 4px 6px; border: 1px solid #cfd6de; border-radius: 3px; text-align: right; }
.del-x { background: none; border: none; color: #c62828; font-weight: bold; cursor: pointer; font-size: 15px; }
.hist-row { cursor: pointer; }
.hist-det td { background: #f8fafc; padding: 10px 16px; }
.dash-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; margin-bottom: 24px; }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.dash-card { background: #fff; border: 1px solid #e2e7ed; border-radius: 4px; padding: 14px 16px; }
.dash-card h3 { margin: 0 0 12px; font-size: 15px; color: #333; border-bottom: 1px solid #eef1f4; padding-bottom: 8px; }
.seg-btns { display: inline-flex; border: 1px solid #cfd6de; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.seg-btns a { padding: 5px 12px; text-decoration: none; color: #444; background: #f8fafc; font-size: 12px; border-right: 1px solid #cfd6de; }
.seg-btns a:last-child { border-right: none; }
.seg-btns a.act { background: #dce8f8; color: #1565c0; font-weight: bold; }
.kpi-block { margin-bottom: 14px; }
.kpi-title { font-size: 12px; color: #666; margin-bottom: 4px; }
.kpi-row { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.kpi-val { font-size: 20px; font-weight: bold; color: #1e293b; }
.kpi-sub { font-size: 11px; color: #777; }
.delta-up { color: #2e7d32; font-size: 13px; font-weight: bold; }
.delta-dn { color: #c62828; font-size: 13px; font-weight: bold; }
.legend { display: flex; gap: 16px; font-size: 12px; color: #555; margin-top: 6px; justify-content: center; }
.leg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
