:root { font-family: Arial, sans-serif; color: #1f2937; background: #f3f4f6; }
* { box-sizing: border-box; }
body { margin: 0; padding: 24px; }
.container { max-width: 1600px; margin: auto; }
.login-card { max-width: 430px; margin: 8vh auto; }
.card { background: white; border: 1px solid #e5e7eb; border-radius: 14px; padding: 20px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
h1, h2 { margin-top: 0; }
h3 { margin: 0 0 10px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; }
input, select { width: 100%; padding: 9px; border: 1px solid #d1d5db; border-radius: 8px; background: white; }
input:focus, select:focus { outline: 3px solid rgba(37, 99, 235, .15); border-color: #2563eb; }
button, .button { display: inline-block; border: 0; border-radius: 8px; padding: 9px 14px; color: white; background: #2563eb; font-weight: 700; cursor: pointer; text-decoration: none; }
button:disabled { background: #9ca3af; cursor: not-allowed; }
.button.secondary { background: #4b5563; }
.button.danger { background: #b91c1c; }
.button.light { background: #e5e7eb; color: #374151; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; align-items: center; }
.alert { border-radius: 9px; padding: 11px 13px; margin-bottom: 15px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.muted { color: #6b7280; font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.compact-settings { max-width: 650px; }
.label-editor-grid { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(360px, 1.25fr); gap: 16px; }
.label-editor-grid fieldset { border: 1px solid #dbeafe; border-radius: 12px; padding: 12px 14px; }
.label-editor-grid legend { padding: 0 7px; color: #1d4ed8; font-weight: 800; }
.label-editor-grid label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; margin: 7px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.section-heading h2 { margin-bottom: 4px; }
.row-count { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 13px; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; gap: 10px; align-items: end; padding: 14px; margin: 16px 0; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.filter-bar label { margin-top: 0; }
.filter-action { padding-bottom: 1px; }
.filter-action .button { white-space: nowrap; }
.table-wrap { width: 100%; max-height: 65vh; overflow: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 3180px; font-size: 12px; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 8px 6px; text-align: left; vertical-align: middle; }
th { background: #f9fafb; position: sticky; top: 0; z-index: 4; white-space: nowrap; }
thead tr:nth-child(2) th { top: 35px; }
td input { min-width: 85px; padding: 6px; }
td select { min-width: 88px; padding: 6px; }
td input.wide { min-width: 180px; }
.package-row:nth-child(even) td { background-color: #fcfcfd; }
.package-row.group-start td { border-top: 3px solid #cbd5e1; }
.package-row.row-dirty td { background-color: #fff7ed; }
.package-row[hidden] { display: none; }
.identity-col { position: sticky; z-index: 2; background: white; }
th.identity-col { z-index: 6; background: #f9fafb; }
.sku-col { left: 0; min-width: 70px; }
.phase-col { left: 70px; min-width: 95px; }
.panels-col { left: 165px; min-width: 70px; text-align: center; }
.package-col { left: 235px; min-width: 110px; }
.subpackage-col { left: 345px; min-width: 120px; box-shadow: 5px 0 7px -7px rgba(15, 23, 42, .7); }
.price-tier-heading { text-align: center; color: #1d4ed8; border-left: 2px solid #bfdbfe; }
.price-method-heading { min-width: 108px; max-width: 130px; white-space: normal; text-align: center; line-height: 1.2; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.phase-badge { background: #e0f2fe; color: #075985; }
.package-prime { background: #fef3c7; color: #92400e; }
.package-elite { background: #fce7f3; color: #9d174d; }
.checkbox-cell input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; }
.change-status { color: #64748b; font-size: 11px; font-weight: 700; }
.row-dirty .change-status { color: #c2410c; }
.save-bar { position: sticky; bottom: 10px; z-index: 8; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: rgba(239, 246, 255, .97); box-shadow: 0 8px 20px rgba(15, 23, 42, .12); }
.section { margin-top: 18px; }
details > summary { cursor: pointer; color: #1d4ed8; font-size: 18px; font-weight: 800; }
.form-intro { max-width: 850px; line-height: 1.5; }
.add-package-form { margin-top: 16px; }
.package-fieldset { margin: 18px 0; padding: 16px; border: 1px solid #cbd5e1; border-radius: 12px; }
.package-fieldset legend { padding: 0 8px; font-weight: 800; color: #1e3a8a; }
.saving-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; max-width: 700px; }
.subpackage-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; margin-top: 15px; }
.subpackage-card { padding: 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; }
.form-actions { display: flex; justify-content: flex-end; }
.add-row-wrap { max-height: 330px; }
.add-row-table { min-width: 2900px; }
@media (max-width: 950px) {
    .filter-bar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .label-editor-grid { grid-template-columns: 1fr; }
    .subpackage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    body { padding: 12px; }
    .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
    .filter-bar, .saving-grid { grid-template-columns: 1fr; }
    .save-bar { align-items: stretch; flex-direction: column; }
    .save-bar button { width: 100%; }
}
