* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Malgun Gothic", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1f2937;
    color: #fff;
    min-height: 100vh;
    padding: 18px 14px;
}

.brand {
    padding: 10px 10px 18px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 14px;
}

.brand-title {
    font-size: 20px;
    font-weight: bold;
}

.brand-sub {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 4px;
}

.menu-section {
    font-size: 12px;
    color: #9ca3af;
    margin: 18px 8px 6px 8px;
}

.menu a {
    display: block;
    color: #e5e7eb;
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
}

.menu a:hover {
    background: #374151;
}

.main {
    flex: 1;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
}

.user-box {
    font-size: 14px;
    color: #555;
}

.logout {
    margin-left: 10px;
    color: #2563eb;
    text-decoration: none;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card-title {
    color: #6b7280;
    font-size: 14px;
}

.card-value {
    font-size: 30px;
    font-weight: bold;
    margin-top: 8px;
}

.panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    margin-top: 18px;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
}

.login-box {
    width: 380px;
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.login-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.login-sub {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 22px;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-row input {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.btn {
    width: 100%;
    padding: 12px;
    border: 0;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.form-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #374151;
}

.form-field input,
.form-field select,
.form-field textarea,
.search-box input,
.search-box select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    background: #fff;
}

.form-field textarea {
    min-height: 70px;
    resize: vertical;
}

.full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-primary,
.btn-secondary,
.btn-search,
.btn-small {
    display: inline-block;
    border: 0;
    border-radius: 7px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    padding: 10px 18px;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
    padding: 10px 14px;
}

.btn-search {
    background: #111827;
    color: #fff;
    padding: 9px 16px;
}

.btn-small {
    background: #e5e7eb;
    color: #111827;
    padding: 5px 8px;
    font-size: 12px;
}

.btn-small.danger {
    background: #fee2e2;
    color: #991b1b;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr 160px 140px 80px 90px;
    gap: 8px;
    margin-bottom: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.data-table th,
.data-table td {
    border: 1px solid #e5e7eb;
    padding: 9px 8px;
    text-align: center;
}

.data-table th {
    background: #f9fafb;
    font-weight: bold;
}

.data-table tr:hover {
    background: #f8fafc;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.empty {
    padding: 24px !important;
    color: #6b7280;
}

.inline-form {
    display: inline;
}

.global-topbar {
    height: 48px;
    background: #111111;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid #222;
}

.global-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-system-name {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.2px;
}

.global-system-sub {
    font-size: 12px;
    color: #cfcfcf;
}

.global-topbar-right {
    font-size: 12px;
    color: #d1d5db;
}

.global-env {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background: #1a1a1a;
}

.app {
    display: flex;
    min-height: calc(100vh - 48px);
}

.sidebar {
    width: 260px;
    background: #1f2937;
    color: #fff;
    min-height: calc(100vh - 48px);
    padding: 18px 14px;
}

/* =========================
   예인티엔지 MES 공통 상단바 위치 보정
   - 좌측 메뉴는 최상단부터 시작
   - 검은띠는 본문 영역 상단에만 표시
   ========================= */

.global-topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 32px;
    background: #111111;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid #222;
    z-index: 1000;
}

.global-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-page-marker {
    color: #60a5fa;
    font-weight: bold;
}

.global-system-name {
    font-size: 13px;
    font-weight: bold;
}

.global-system-sub {
    font-size: 11px;
    color: #cfcfcf;
}

.global-topbar-right {
    font-size: 11px;
    color: #d1d5db;
}

.global-env {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid #3a3a3a;
    border-radius: 5px;
    background: #1a1a1a;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1f2937;
    color: #fff;
    min-height: 100vh;
    padding: 18px 14px;
}

.main {
    flex: 1;
    padding: 52px 24px 24px 24px;
}

.work-order-search {
    grid-template-columns: 1fr 150px 150px 130px 80px 90px;
}

.prod-result-search {
    grid-template-columns: 1fr 130px 130px 80px 90px;
}

.btn-small.primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.process-select-form {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 8px;
    align-items: center;
}

.process-select-form select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    background: #fff;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.info-table th,
.info-table td {
    border: 1px solid #e5e7eb;
    padding: 10px;
}

.info-table th {
    width: 140px;
    background: #f9fafb;
    text-align: left;
}

.table-input {
    width: 100%;
    min-width: 90px;
    padding: 5px 6px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
}

.btn-small.success {
    background: #dcfce7;
    color: #166534;
}

.prod-lot-search {
    grid-template-columns: 1fr 140px 140px 130px 80px 90px;
}

.material-lot-search {
    grid-template-columns: 1fr 130px 130px 120px 120px 80px 90px;
}

.material-input-search {
    grid-template-columns: 1fr 130px 130px 110px 80px 90px;
}

.lot-trace-search {
    grid-template-columns: 1fr 140px 120px 80px 90px;
}

.quality-search {
    grid-template-columns: 1fr 130px 130px 120px 120px 80px 90px;
}
.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.defect-search {
    grid-template-columns: 1fr 130px 130px 180px 120px 80px 90px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #d8dee9;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.dashboard-hero h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
}
.dashboard-hero p {
    margin: 0;
    color: #606b7b;
}
.hero-date {
    min-width: 150px;
    text-align: right;
    color: #606b7b;
    font-size: 13px;
}
.hero-date strong {
    color: #111827;
    font-size: 18px;
}
.dashboard-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.quick-menu {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}
.quick-menu a {
    display: block;
    background: #111827;
    color: #ffffff;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}
.quick-menu a:hover {
    background: #2563eb;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.data-table.compact th,
.data-table.compact td {
    padding: 8px 6px;
    font-size: 12px;
}
@media (max-width: 1200px) {
    .dashboard-cards,
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .quick-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.erp-customer-search {
    grid-template-columns: 1fr 150px 80px 90px;
}
.erp-price-search {
    grid-template-columns: 1fr 150px 80px 90px;
}

/* ERP 메뉴 좌측 사이드바 보정 */
.sidebar .menu-group {
    margin-top: 18px;
}

.sidebar .menu-title {
    display: block;
    margin: 14px 16px 8px 16px;
    font-size: 12px;
    color: #8fa3bd;
    font-weight: 600;
}

.sidebar .menu-group a {
    display: block;
    padding: 9px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar .menu-group a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .menu-group a.active {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
}

/* workflow-menu-fix-20260623 */
.sidebar {
    overflow-y: auto;
}
.sidebar-brand {
    padding: 22px 18px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.16);
}
.brand-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}
.brand-subtitle {
    color: #b8c7d9;
    font-size: 12px;
    margin-top: 6px;
}
.sidebar-menu {
    padding: 10px 0 28px 0;
}
.sidebar .menu-group {
    margin-top: 12px;
}
.sidebar .menu-title {
    display: block;
    margin: 14px 16px 8px 16px;
    font-size: 12px;
    color: #8fa3bd;
    font-weight: 600;
}
.sidebar .menu-group a {
    display: block;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}
.sidebar .menu-group a:hover {
    background: rgba(255, 255, 255, 0.08);
}
.sidebar .menu-group a.active {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    margin: 0 8px;
    padding-left: 8px;
}

/* broad-scope-menu-20260623 */
.sidebar {
    overflow-y: auto;
}
.sidebar-brand {
    padding: 22px 18px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.16);
}
.brand-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}
.brand-subtitle {
    color: #b8c7d9;
    font-size: 12px;
    margin-top: 6px;
}
.sidebar-menu {
    padding: 10px 0 32px 0;
}
.sidebar .menu-group {
    margin-top: 12px;
}
.sidebar .menu-title {
    display: block;
    margin: 14px 16px 8px 16px;
    font-size: 12px;
    color: #8fa3bd;
    font-weight: 600;
}
.sidebar .menu-group a {
    display: block;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}
.sidebar .menu-group a:hover {
    background: rgba(255, 255, 255, 0.08);
}
.sidebar .menu-group a.active {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    margin: 0 8px;
    padding-left: 8px;
}

/* warehouse-bom-20260623 */
.warehouse-search {
    grid-template-columns: 1fr 130px 130px 80px 90px;
}
.bom-search {
    grid-template-columns: 1fr 240px 130px 80px 90px;
}

/* inventory-ledger-20260623 */
.inventory-search {
    grid-template-columns: 1fr 130px 130px 80px 90px;
}
.ledger-search {
    grid-template-columns: 1fr 120px 120px 140px 120px 80px 90px;
}
.help-text {
    margin-top: 10px;
    color: #6b7280;
    font-size: 12px;
}

/* fixed-sidebar-20260623 */
/* 좌측 메뉴는 화면에 고정하고, 본문만 스크롤되도록 보정 */
.sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.main {
    margin-left: 260px !important;
    width: calc(100% - 260px);
    min-height: 100vh;
}

/* 좌측 메뉴 스크롤바가 너무 튀지 않게 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* purchase-inbound-20260623 */
.purchase-search {
    grid-template-columns: 1fr 120px 120px 130px 80px 90px;
}

/* customer-type-20260623 */
.customer-type-search {
    grid-template-columns: 1fr 130px 130px 80px 90px;
}

/* numbering-update-20260624 */
.help-text {
    margin-top: 10px;
    color: #6b7280;
    font-size: 12px;
}

/* sales-management-20260624 */
.sales-search {
    grid-template-columns: 1fr 120px 120px 120px 80px 90px;
}

/* shipment-management-20260624 */
.shipment-search {
    grid-template-columns: 1fr 120px 120px 120px 80px 90px;
}

/* sales-price-integration-20260624 */
.price-search {
    grid-template-columns: 1fr 120px 80px 90px;
}
.success-text {
    color: #047857;
    font-weight: 600;
}
.danger-text {
    color: #b91c1c;
    font-weight: 600;
}

/* collect-management-20260624 */
.collect-search {
    grid-template-columns: 1fr 140px 80px 90px;
}
.collect-search-wide {
    grid-template-columns: 1fr 150px 140px 80px 90px;
}
.collect-history-search {
    grid-template-columns: 1fr 120px 120px 130px 120px 80px 90px;
}

/* sidebar-layout-download-fix-20260624 */
:root {
    --yein-sidebar-width: 260px !important;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: var(--yein-sidebar-width) !important;
    min-width: var(--yein-sidebar-width) !important;
    max-width: var(--yein-sidebar-width) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1000 !important;
    background: #1f2937 !important;
}

.sidebar-brand {
    padding: 24px 24px 16px 24px !important;
    box-sizing: border-box !important;
}

.sidebar .brand-title {
    font-size: 20px !important;
    line-height: 1.25 !important;
    word-break: keep-all !important;
    white-space: normal !important;
}

.sidebar .brand-sub {
    font-size: 12px !important;
    line-height: 1.4 !important;
}

.sidebar-menu {
    padding: 0 16px 28px 16px !important;
    box-sizing: border-box !important;
}

.sidebar-menu a {
    display: block !important;
    width: 100% !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
}

.menu-section {
    display: block !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    margin-top: 18px !important;
    margin-bottom: 6px !important;
}

.main,
main.main {
    margin-left: var(--yein-sidebar-width) !important;
    width: calc(100vw - var(--yein-sidebar-width)) !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 18px 20px !important;
    box-sizing: border-box !important;
    display: block !important;
}

.main > *,
main.main > *,
.main .container,
.main .content,
.main .page-container,
.main .page-wrap,
.main .wrap,
.main .layout,
.main .section,
.main .panel,
.main .cards,
.main .topbar {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.panel,
.cards,
.topbar {
    max-width: none !important;
    width: 100% !important;
}

.header,
.app-header,
.system-header,
.top-header,
.global-header {
    left: var(--yein-sidebar-width) !important;
    width: calc(100vw - var(--yein-sidebar-width)) !important;
    max-width: none !important;
}

/* sidebar-link-style-fix-20260624 */
aside.sidebar,
.sidebar {
    background: #1f2937 !important;
    color: #e5e7eb !important;
}

aside.sidebar a,
aside.sidebar a:link,
aside.sidebar a:visited,
aside.sidebar a:hover,
aside.sidebar a:active,
.sidebar a,
.sidebar a:link,
.sidebar a:visited,
.sidebar a:hover,
.sidebar a:active {
    color: #f9fafb !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    outline: none !important;
}

aside.sidebar .sidebar-menu a,
aside.sidebar .sidebar-menu a:link,
aside.sidebar .sidebar-menu a:visited,
.sidebar .sidebar-menu a,
.sidebar .sidebar-menu a:link,
.sidebar .sidebar-menu a:visited {
    display: block !important;
    color: #f9fafb !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    line-height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    margin: 1px 0 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

aside.sidebar .sidebar-menu a:hover,
.sidebar .sidebar-menu a:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.10) !important;
    text-decoration: none !important;
}

aside.sidebar .sidebar-menu a.active,
.sidebar .sidebar-menu a.active {
    color: #ffffff !important;
    background: #374151 !important;
    text-decoration: none !important;
}

aside.sidebar .menu-section,
.sidebar .menu-section {
    color: #93a4b7 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    margin: 18px 0 6px 0 !important;
    padding: 0 12px !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    text-decoration: none !important;
}

aside.sidebar .brand-title,
.sidebar .brand-title {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

aside.sidebar .brand-sub,
.sidebar .brand-sub {
    color: #cbd5e1 !important;
    text-decoration: none !important;
}

/* 브라우저 visited 기본 보라색 방지 */
.sidebar-menu a:-webkit-any-link {
    color: #f9fafb !important;
    text-decoration: none !important;
}

/* 기존 CSS가 밑줄을 강제한 경우 방지 */
.sidebar-menu a::before,
.sidebar-menu a::after {
    text-decoration: none !important;
}

/* main-top-overlap-fix-20260624
   목적:
   - 상단 검은 헤더가 본문 제목을 덮는 현상 보정
   - 센서관리 등 신규 화면의 제목/카드가 위로 말려 들어가는 현상 보정
   - 기존 좌측 메뉴 260px 기준 유지
*/
:root {
    --yein-sidebar-width: 260px !important;
    --yein-header-height: 34px !important;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* 좌측 메뉴는 기존처럼 고정 */
.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: var(--yein-sidebar-width) !important;
    min-width: var(--yein-sidebar-width) !important;
    max-width: var(--yein-sidebar-width) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1000 !important;
}

/* 상단 검은 헤더가 fixed/absolute인 경우 본문보다 위에 오도록 하되, 좌측 메뉴와 겹치지 않게 보정 */
.header,
.app-header,
.system-header,
.top-header,
.global-header,
.header-bar,
.topbar-black,
.site-header {
    left: var(--yein-sidebar-width) !important;
    width: calc(100vw - var(--yein-sidebar-width)) !important;
    max-width: none !important;
    z-index: 900 !important;
}

/* 본문 시작 위치: 좌측 메뉴 옆 + 상단 헤더 아래 */
.main,
main.main {
    margin-left: var(--yein-sidebar-width) !important;
    width: calc(100vw - var(--yein-sidebar-width)) !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 52px 20px 24px 20px !important;
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
}

/* 화면 내부 wrapper가 중앙정렬되어 있으면 풀폭으로 해제 */
.main > *,
main.main > *,
.main .container,
.main .content,
.main .page-container,
.main .page-wrap,
.main .wrap,
.main .layout,
.main .section,
.main .panel,
.main .cards,
.main .topbar {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* 각 화면 제목이 헤더에 붙거나 잘리는 현상 방지 */
.main h1,
.main h2,
.main .page-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1.35 !important;
}

/* 화면 안쪽 사용자 표시 줄은 헤더와 겹치지 않게 */
.main .topbar {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    margin-bottom: 14px !important;
}

/* 카드/패널은 좌측부터 자연스럽게 */
.panel,
.cards {
    max-width: none !important;
    width: 100% !important;
}

/* 잘못 남아있는 큰 왼쪽 여백/중앙정렬 계열 무력화 */
main,
.main,
.content-area,
.page-content {
    transform: none !important;
}

/* top-erp-nav-fix-20260624
   SMART ERP 스타일 상단 메뉴 재정리
   - 검은띠 높이 46px 고정
   - POP 드롭다운 구성
   - 기존 top-quick 버튼 숨김
   - 본문 상단 여백 일괄 보정
*/
:root {
    --yein-sidebar-width: 260px !important;
    --yein-header-height: 46px !important;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* 기존 quick 링크가 남아 있으면 숨김 */
.top-quick-links,
.top-quick-fallback {
    display: none !important;
}

/* ERP 스타일 상단 검은띠 */
.app-top-erp-nav {
    position: fixed !important;
    top: 0 !important;
    left: var(--yein-sidebar-width) !important;
    right: 0 !important;
    height: var(--yein-header-height) !important;
    min-height: var(--yein-header-height) !important;
    max-height: var(--yein-header-height) !important;
    background: #111827 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    z-index: 950 !important;
    border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    overflow: visible !important;
}

/* 기존 header 계열 CSS가 겹칠 때 방지 */
.header,
.app-header,
.system-header,
.top-header,
.global-header,
.header-bar,
.topbar-black,
.site-header {
    min-height: var(--yein-header-height) !important;
}

/* 좌측 브랜드 */
.erp-nav-brand {
    flex: 0 0 auto !important;
    min-width: 250px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    height: 100% !important;
}

.erp-nav-brand strong {
    display: inline-block !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    line-height: 1 !important;
}

.erp-nav-brand span {
    display: inline-block !important;
    font-size: 11px !important;
    color: #cbd5e1 !important;
    line-height: 1 !important;
}

/* 중앙 메뉴 */
.erp-nav-menu {
    flex: 1 1 auto !important;
    height: 100% !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.erp-nav-menu > a,
.erp-nav-dropdown > button {
    height: 100% !important;
    min-width: 68px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid rgba(255,255,255,0.05) !important;
    color: #e5e7eb !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.erp-nav-menu > a:hover,
.erp-nav-dropdown:hover > button,
.erp-nav-menu > a.active,
.erp-nav-dropdown.active > button {
    background: #1f2937 !important;
    color: #ffffff !important;
}

/* POP 드롭다운 */
.erp-nav-dropdown {
    position: relative !important;
    height: 100% !important;
    display: inline-flex !important;
    align-items: stretch !important;
    overflow: visible !important;
}

.erp-nav-dropdown-menu {
    display: none !important;
    position: absolute !important;
    top: var(--yein-header-height) !important;
    left: 0 !important;
    min-width: 190px !important;
    background: #ffffff !important;
    color: #111827 !important;
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 16px 35px rgba(0,0,0,0.25) !important;
    padding: 8px !important;
    z-index: 2000 !important;
    box-sizing: border-box !important;
}

.erp-nav-dropdown:hover .erp-nav-dropdown-menu {
    display: block !important;
}

.erp-nav-dropdown-menu a,
.erp-nav-dropdown-menu a:link,
.erp-nav-dropdown-menu a:visited {
    display: block !important;
    color: #111827 !important;
    background: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    padding: 11px 12px !important;
    border-radius: 7px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.erp-nav-dropdown-menu a:hover {
    background: #2563eb !important;
    color: #ffffff !important;
}

/* 오른쪽 클라우드 배지 */
.erp-nav-cloud {
    flex: 0 0 auto !important;
    margin-left: 8px !important;
    padding: 3px 7px !important;
    border: 1px solid rgba(255,255,255,0.45) !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    color: #ffffff !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* 본문은 상단 검은띠 아래에서 시작 */
.main,
main.main {
    margin-left: var(--yein-sidebar-width) !important;
    width: calc(100vw - var(--yein-sidebar-width)) !important;
    max-width: none !important;
    padding-top: calc(var(--yein-header-height) + 20px) !important;
    box-sizing: border-box !important;
}

/* 사이드바는 기존 폭 유지 */
.sidebar {
    width: var(--yein-sidebar-width) !important;
    min-width: var(--yein-sidebar-width) !important;
    max-width: var(--yein-sidebar-width) !important;
}

/* 화면이 좁으면 메뉴 간격 축소 */
@media (max-width: 1500px) {
    .erp-nav-brand {
        min-width: 210px !important;
    }

    .erp-nav-menu > a,
    .erp-nav-dropdown > button {
        min-width: 58px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 1250px) {
    .erp-nav-brand span {
        display: none !important;
    }

    .erp-nav-brand {
        min-width: 145px !important;
    }

    .erp-nav-menu {
        justify-content: flex-start !important;
        overflow-x: auto !important;
    }
}
