* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.main-content {
    margin: 0 auto;
    max-width: 1200px;
    padding: 30px;
}
.page h1 {
    margin-bottom: 20px;
}
.modal-overlay {
    background: #00000080;
    height: 100%;
    width: 100%;
}
.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px #00000026;
    max-width: 400px;
    padding: 30px;
    width: 100%;
}
.modal .modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal .modal-header h2 {
    font-size: 1.4rem;
    margin: 0;
}
.modal .modal-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0 5px;
}
.modal .modal-close:hover {
    color: #333;
}
.modal .modal-error {
    background: #fee;
    border-radius: 4px;
    color: #c00;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px;
}
.modal .form-group {
    margin-bottom: 15px;
}
.modal .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}
.modal .form-group input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    padding: 10px 12px;
    width: 100%;
}
.modal .form-group input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.header {
    background: #2c3e50;
    color: #fff;
    justify-content: space-between;
    padding: 15px 30px;
}
.header,
.header .header-left {
    align-items: center;
    display: flex;
}
.header .header-left {
    gap: 30px;
}
.header .header-title {
    font-size: 1.3rem;
    font-weight: 700;
}
.header .header-nav {
    display: flex;
    gap: 5px;
}
.header .header-nav a {
    border-radius: 4px;
    color: #ffffffb3;
    font-size: 0.9rem;
    padding: 6px 14px;
    text-decoration: none;
    transition:
        background 0.2s,
        color 0.2s;
}
.header .header-nav a:hover {
    background: #ffffff1a;
    color: #fff;
}
.header .header-nav a.active {
    background: #ffffff26;
    color: #fff;
    font-weight: 600;
}
.header .header-actions {
    align-items: center;
    display: flex;
    gap: 15px;
}
.header .header-user {
    font-size: 0.9rem;
    opacity: 0.85;
}
.btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 20px;
    transition: background 0.2s;
}
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.btn-login,
.btn-primary {
    background: #4a90d9;
    color: #fff;
}
.btn-login:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: #357abd;
}
.btn-logout {
    background: #e74c3c;
    color: #fff;
}
.btn-logout:hover {
    background: #c0392b;
}
.dashboard-welcome {
    color: #555;
    font-size: 1.05rem;
    margin-bottom: 20px;
}
.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-width: 160px;
    padding: 25px 35px;
    text-decoration: none;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
}
.stat-card:hover {
    border-color: #4a90d9;
    box-shadow: 0 2px 12px #4a90d926;
}
.stat-card .stat-value {
    color: #2c3e50;
    font-size: 2.2rem;
    font-weight: 700;
}
.stat-card .stat-label {
    color: #888;
    font-size: 0.9rem;
    margin-top: 5px;
}
.dashboard-recent h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}
.dashboard-table {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.dashboard-table td,
.dashboard-table th {
    padding: 10px 15px;
    text-align: left;
}
.dashboard-table th {
    background: #f5f6f8;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}
.dashboard-table td {
    border-top: 1px solid #eee;
    font-size: 0.95rem;
}
.dashboard-table tr:hover td {
    background: #fafbfc;
}
.edit-modal {
    max-height: 500px;
    max-width: 500px;
    overflow-y: auto;
    width: 100%;
}
.edit-modal .form-group {
    margin-bottom: 15px;
}
.edit-modal .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}
.edit-modal .form-group input,
.edit-modal .form-group select {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    padding: 10px 12px;
    width: 100%;
}
.edit-modal .form-group input:focus,
.edit-modal .form-group select:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.edit-modal .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.products .products-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
}
.products .products-toolbar .filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.products .search-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    padding: 10px 14px;
    width: 280px;
}
.products .search-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.products .product-link {
    color: #4a90d9;
    cursor: pointer;
    text-decoration: none;
}
.products .product-link:hover {
    text-decoration: underline;
}
.products .product-form {
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
}
.products .product-form input,
.products .product-form select {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 8px 12px;
}
.products .product-form input:focus,
.products .product-form select:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.products .product-form select {
    min-width: 160px;
}
.products .product-form input[type="number"] {
    width: 120px;
}
.products .product-form input[type="text"] {
    width: 150px;
}
.products .data-table {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.products .data-table td,
.products .data-table th {
    padding: 10px 15px;
    text-align: left;
}
.products .data-table th {
    background: #f5f6f8;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}
.products .data-table td {
    border-top: 1px solid #eee;
    font-size: 0.95rem;
}
.products .data-table tr:hover td {
    background: #fafbfc;
}
.products .data-table .actions {
    display: flex;
    gap: 6px;
}
.products .data-table .empty {
    color: #999;
    padding: 30px;
    text-align: center;
}
.products .btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 8px 16px;
}
.products .btn-primary {
    background: #4a90d9;
    color: #fff;
}
.products .btn-primary:hover {
    background: #357abd;
}
.products .btn-edit {
    background: #f39c12;
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 12px;
}
.products .btn-edit:hover {
    background: #e08e0b;
}
.products .btn-delete {
    background: #e74c3c;
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 12px;
}
.products .btn-delete:hover {
    background: #c0392b;
}
.products .btn-cancel {
    background: #95a5a6;
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 12px;
}
.products .btn-cancel:hover {
    background: #7f8c8d;
}
.products .pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.products .pagination button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 12px;
}
.products .pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}
.products .pagination button.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}
.products .pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.page-header {
    margin-bottom: 25px;
}
.page-header h1 {
    margin: 10px 0 5px;
}
.page-header h1 .product-code {
    color: #888;
    font-size: 0.8em;
    font-weight: 400;
}
.page-header .product-info {
    color: #666;
    font-size: 0.95rem;
}
.btn-back {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 14px;
}
.btn-back:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
.empty-message {
    color: #999;
    font-size: 1rem;
    padding: 40px 0;
    text-align: center;
}
.section-description {
    color: #888;
    font-size: 0.85rem;
    margin: -5px 0 15px;
}
.inverse-heading {
    margin-top: 40px;
}
.relations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.relation-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.relation-card.expanded {
    border-color: #4a90d9;
}
.relation-card.expanded .relation-header {
    background: #f0f5fb;
    border-bottom: 1px solid #e0e0e0;
}
.relation-card .relation-header {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    transition: background 0.15s;
    -webkit-user-select: none;
    user-select: none;
}
.relation-card .relation-header:hover {
    background: #f5f6f8;
}
.relation-card .relation-header .relation-info {
    align-items: center;
    display: flex;
    gap: 10px;
}
.relation-card .relation-header .relation-icon {
    color: #888;
    font-size: 0.75rem;
    width: 16px;
}
.relation-card .relation-header .related-product {
    font-size: 0.95rem;
}
.relation-card .relation-header .related-product .code {
    color: #888;
    font-size: 0.85em;
}
.relation-card .relation-header .relation-id {
    color: #aaa;
    font-size: 0.8rem;
}
.relation-card .relation-details {
    overflow-x: auto;
    padding: 15px;
}
.relation-card .relation-details .empty-sub {
    color: #999;
    padding: 15px;
    text-align: center;
}
.chart-modal {
    max-height: 90vh;
    max-width: 1100px;
    overflow-y: auto;
    width: 95%;
}
.chart-modal .modal-header .modal-products {
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    font-weight: 600;
    gap: 2px;
}
.chart-modal .modal-header .modal-products .product-tag {
    color: #888;
    font-size: 0.8rem;
    font-weight: 400;
}
.chart-modal .modal-header .modal-header-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}
.chart-modal .modal-header .btn-toggle-section {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 6px 14px;
    transition: all 0.2s;
    white-space: nowrap;
}
.chart-modal .modal-header .btn-toggle-section:hover {
    background: #e0e0e0;
}
.chart-modal .modal-header .btn-toggle-section.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}
.chart-modal .modal-header .btn-toggle-section.active:hover {
    background: #357abd;
}
.chart-modal .modal-header .btn-pdf {
    background: #d9534f;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 16px;
    white-space: nowrap;
}
.chart-modal .modal-header .btn-pdf:hover {
    background: #c9302c;
}
.chart-modal .modal-header .btn-pdf:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.chart-modal .chart-controls {
    margin-bottom: 15px;
    padding: 0 20px;
}
.chart-modal .chart-controls .year-range {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
.chart-modal .chart-controls .year-range label {
    align-items: center;
    color: #444;
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
}
.chart-modal .chart-controls .year-range label input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 6px 10px;
    width: 70px;
}
.chart-modal .chart-controls .year-range label input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.chart-modal .chart-controls .field-toggles .toggle-header {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}
.chart-modal .chart-controls .field-toggles .toggle-header span {
    color: #444;
    font-size: 0.9rem;
    font-weight: 600;
}
.chart-modal .chart-controls .field-toggles .toggle-header .btn-link {
    background: none;
    border: none;
    color: #4a90d9;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
}
.chart-modal .chart-controls .field-toggles .toggle-header .btn-link:hover {
    color: #357abd;
}
.chart-modal .chart-controls .field-toggles .checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.chart-modal .chart-controls .field-toggles .checkboxes .checkbox-label {
    align-items: center;
    color: #555;
    cursor: pointer;
    display: flex;
    font-size: 0.85rem;
    gap: 5px;
    -webkit-user-select: none;
    user-select: none;
}
.chart-modal .chart-controls .field-toggles .checkboxes .checkbox-label input[type="checkbox"] {
    cursor: pointer;
    height: 15px;
    width: 15px;
}
.chart-modal .chart-controls .field-toggles .checkboxes .checkbox-label .color-dot {
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    height: 10px;
    width: 10px;
}
.chart-modal .chart-table-wrapper {
    margin-bottom: 15px;
    overflow-x: auto;
    padding: 0 20px;
}
.chart-modal .chart-table-wrapper .chart-editable-table {
    border-collapse: collapse;
    font-size: 0.82rem;
    width: 100%;
}
.chart-modal .chart-table-wrapper .chart-editable-table td,
.chart-modal .chart-table-wrapper .chart-editable-table th {
    border: 1px solid #e0e0e0;
    padding: 4px 6px;
    text-align: center;
    white-space: nowrap;
}
.chart-modal .chart-table-wrapper .chart-editable-table th {
    background: #f5f6f8;
    color: #555;
    font-size: 0.75rem;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.chart-modal .chart-table-wrapper .chart-editable-table .year-cell {
    background: #fafafa;
    font-weight: 600;
    width: 50px;
}
.chart-modal .chart-table-wrapper .chart-editable-table td input {
    background: #0000;
    border: none;
    font-size: 0.82rem;
    min-width: 80px;
    outline: none;
    padding: 3px 2px;
    text-align: center;
}
.chart-modal .chart-table-wrapper .chart-editable-table td input:focus {
    background: #eef4fc;
    border-radius: 2px;
}
.chart-modal .chart-table-wrapper .chart-editable-table .cell-display {
    border-radius: 2px;
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    line-height: 1.2;
    min-width: 80px;
    padding: 3px 4px;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
    width: 100%;
}
.chart-modal .chart-table-wrapper .chart-editable-table .cell-display:hover {
    background: #eef4fc;
}
.chart-modal .chart-table-wrapper .chart-editable-table .cell-display.cell-readonly {
    background: #0000 !important;
    color: #666;
    cursor: default;
}
.chart-modal .chart-table-wrapper .chart-editable-table .cell-input-active {
    appearance: textfield;
    background: #eef4fc;
    border: 1px solid #4a90d9;
    border-radius: 2px;
    box-sizing: border-box;
    display: block;
    font-size: 0.82rem;
    line-height: 1.2;
    margin: 0 auto;
    max-width: 80px;
    min-width: 80px;
    outline: none;
    padding: 2px;
    text-align: center;
    width: 100%;
}
.chart-modal .chart-table-wrapper .chart-editable-table .cell-input-active::-webkit-inner-spin-button,
.chart-modal .chart-table-wrapper .chart-editable-table .cell-input-active::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.chart-modal .chart-container {
    height: 400px;
    padding: 10px 20px 20px;
    position: relative;
}
.chart-modal .chart-container .empty-chart {
    color: #999;
    font-size: 0.95rem;
    padding: 80px 0;
    text-align: center;
}
.chart-modal .extra-section {
    border-top: 2px solid #e0e0e0;
    margin-top: 30px;
    padding-top: 20px;
}
.chart-modal .extra-section .extra-section-title {
    color: #333;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    padding: 0 20px 10px;
}
.chart-modal .extra-section .chart-table-wrapper {
    overflow-x: auto;
    padding: 0 20px;
}
.chart-modal .extra-section .chart-container {
    height: 400px;
    padding: 10px 20px 20px;
    position: relative;
}
.chart-modal .extra-section .chart-container .empty-chart {
    color: #999;
    font-size: 0.95rem;
    padding: 80px 0;
    text-align: center;
}
.searchable-select {
    min-width: 300px;
    position: relative;
}
.searchable-select .ss-display {
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    font-size: 0.95rem;
    gap: 8px;
    padding: 9px 12px;
}
.searchable-select .ss-display:hover {
    border-color: #4a90d9;
}
.searchable-select .ss-value {
    flex: 1 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.searchable-select .ss-placeholder {
    color: #999;
}
.searchable-select .ss-clear {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
}
.searchable-select .ss-clear:hover {
    color: #333;
}
.searchable-select .ss-arrow {
    color: #888;
    font-size: 0.65rem;
}
.searchable-select .ss-dropdown {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    border-top: none;
    box-shadow: 0 4px 12px #0000001a;
    left: 0;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
}
.searchable-select .ss-search {
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    outline: none;
    padding: 8px 12px;
    width: 100%;
}
.searchable-select .ss-search::placeholder {
    color: #bbb;
}
.searchable-select .ss-options {
    list-style: none;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 0;
}
.searchable-select .ss-option {
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 12px;
}
.searchable-select .ss-option:hover {
    background: #f0f4f8;
}
.searchable-select .ss-option.ss-selected {
    background: #e8f0fe;
    font-weight: 600;
}
.searchable-select .ss-no-results {
    color: #999;
    font-size: 0.9rem;
    padding: 12px;
    text-align: center;
}
.relations-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-bottom: 25px;
}
.relations-toolbar label {
    color: #444;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}
.relations-toolbar .product-select {
    min-width: 350px;
}
.relations-toolbar .btn-totals {
    background: #27ae60;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 9px 18px;
    white-space: nowrap;
}
.relations-toolbar .btn-totals:hover {
    background: #219150;
}
.relations-toolbar .btn-import {
    background: #e67e22;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 9px 18px;
    white-space: nowrap;
}
.relations-toolbar .btn-import:hover {
    background: #cf6d17;
}
.relations-toolbar .btn-import:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.import-result {
    align-items: flex-start;
    border-radius: 6px;
    display: flex;
    font-size: 0.9rem;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
}
.import-result.success {
    background: #eafaf1;
    border: 1px solid #27ae60;
    color: #1e7e46;
}
.import-result.error {
    background: #fdecea;
    border: 1px solid #e74c3c;
    color: #c0392b;
}
.import-result p {
    margin: 0;
}
.import-result details {
    margin-top: 6px;
}
.import-result details summary {
    cursor: pointer;
    font-weight: 600;
}
.import-result details ul {
    font-size: 0.85rem;
    margin: 6px 0 0;
    padding-left: 20px;
}
.import-result .btn-close-result {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    margin-left: auto;
    padding: 0 4px;
}
.import-result .btn-close-result:hover {
    opacity: 0.7;
}
.loading-text {
    color: #888;
    padding: 30px;
    text-align: center;
}
.relation-group {
    margin-bottom: 30px;
}
.relation-group .group-header {
    align-items: center;
    background: #f5f6f8;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 10px 15px;
}
.relation-group .group-header .secondary-product {
    font-size: 0.95rem;
}
.relation-group .group-header .secondary-product .code {
    color: #888;
    font-size: 0.85em;
    font-weight: 400;
}
.relation-group .group-header .group-relation-id {
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 400;
}
.relation-group .table-wrapper {
    border-radius: 0;
    overflow-x: auto;
}
.relation-group .data-table {
    border-radius: 0;
}
.relation-group .group-actions {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    border-top: none;
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px;
}
.relation-group .group-actions .btn-chart {
    background: #4a90d9;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 16px;
}
.relation-group .group-actions .btn-chart:hover {
    background: #357abd;
}
.relation-data-table {
    font-size: 0.85rem;
}
.relation-data-table td,
.relation-data-table th {
    padding: 6px 10px;
    white-space: nowrap;
}
.relation-data-table th {
    font-size: 0.75rem;
}
.production-plan-page {
    max-width: 100%;
}
.production-plan-page h1 {
    margin-bottom: 25px;
}
.production-plan-page .plan-list-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.production-plan-page .plan-list-toolbar .btn-totals {
    background: #4a90d9;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 9px 20px;
}
.production-plan-page .plan-list-toolbar .btn-totals:hover {
    background: #357abd;
}
.production-plan-page .plan-list-toolbar .btn-add {
    background: #27ae60;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 9px 20px;
}
.production-plan-page .plan-list-toolbar .btn-add:hover {
    background: #219150;
}
.production-plan-page .plan-list-toolbar .create-plan-form {
    align-items: center;
    display: flex;
    gap: 10px;
}
.production-plan-page .plan-list-toolbar .create-plan-form input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 260px;
    outline: none;
    padding: 8px 12px;
}
.production-plan-page .plan-list-toolbar .create-plan-form input[type="text"]:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d926;
}
.production-plan-page .plan-list-toolbar .create-plan-form .btn-primary {
    background: #4a90d9;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 18px;
}
.production-plan-page .plan-list-toolbar .create-plan-form .btn-primary:hover {
    background: #357abd;
}
.production-plan-page .plan-list-toolbar .create-plan-form .btn-primary:disabled {
    background: #b0c4d8;
    cursor: not-allowed;
}
.production-plan-page .plan-list-toolbar .create-plan-form .btn-cancel {
    background: #eee;
    border: none;
    border-radius: 5px;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 18px;
}
.production-plan-page .plan-list-toolbar .create-plan-form .btn-cancel:hover {
    background: #ddd;
}
.production-plan-page .empty-message,
.production-plan-page .loading-text {
    color: #888;
    font-size: 0.95rem;
    padding: 20px 0;
}
.production-plan-page .plans-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.production-plan-page .plan-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    transition: box-shadow 0.15s;
}
.production-plan-page .plan-card:hover {
    box-shadow: 0 2px 10px #00000012;
}
.production-plan-page .plan-card .plan-card-body {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex: 1 1;
    gap: 16px;
    padding: 14px 18px;
}
.production-plan-page .plan-card .plan-card-body .plan-name {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.production-plan-page .plan-card .plan-card-body .plan-category-badge {
    background: #4a90d91a;
    border: 1px solid #4a90d940;
    border-radius: 20px;
    color: #4a90d9;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 3px;
    padding: 2px 10px;
}
.production-plan-page .plan-card .plan-card-body .plan-name-input {
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    min-width: 200px;
    outline: none;
    padding: 5px 10px;
}
.production-plan-page .plan-card .plan-card-body .plan-name-input:focus {
    border-color: #4a90d9;
}
.production-plan-page .plan-card .plan-card-body .plan-date {
    color: #999;
    font-size: 0.82rem;
}
.production-plan-page .plan-card .plan-card-actions {
    display: flex;
    gap: 8px;
}
.production-plan-page .plan-card .plan-card-actions .btn-edit {
    background: #f0ad4e;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 5px 14px;
}
.production-plan-page .plan-card .plan-card-actions .btn-edit:hover {
    background: #d9952a;
}
.production-plan-page .plan-card .plan-card-actions .btn-primary {
    background: #4a90d9;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 5px 14px;
}
.production-plan-page .plan-card .plan-card-actions .btn-primary:hover {
    background: #357abd;
}
.production-plan-page .plan-detail-header {
    align-items: center;
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.production-plan-page .plan-detail-header .btn-back {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: #555;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 14px;
}
.production-plan-page .plan-detail-header .btn-back:hover {
    background: #f5f5f5;
    border-color: #999;
}
.production-plan-page .plan-detail-header h1 {
    margin-bottom: 0;
}
.production-plan-page .plan-section {
    margin-bottom: 40px;
}
.production-plan-page .plan-section .section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.production-plan-page .plan-section .section-header h2 {
    color: #333;
    font-size: 1.15rem;
}
.production-plan-page .plan-section .section-header .btn-add {
    background: #27ae60;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 7px 16px;
}
.production-plan-page .plan-section .section-header .btn-add:hover {
    background: #219150;
}
.production-plan-page .table-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow-x: auto;
}
.production-plan-page .plan-table {
    border-collapse: collapse;
    font-size: 0.8rem;
    white-space: nowrap;
    width: 100%;
}
.production-plan-page .plan-table td,
.production-plan-page .plan-table th {
    border: 1px solid #e8e8e8;
    padding: 3px 4px;
    text-align: center;
}
.production-plan-page .plan-table th {
    background: #f5f6f8;
    color: #555;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
.production-plan-page .plan-table .col-name {
    max-width: 100px;
    min-width: 60px;
    text-align: left;
    white-space: wrap;
}
.production-plan-page .plan-table .col-code {
    font-weight: 500;
    min-width: 50px;
}
.production-plan-page .plan-table .col-num {
    max-width: 60px;
    min-width: 55px;
}
.production-plan-page .plan-table .col-year {
    min-width: 45px;
}
.production-plan-page .plan-table .col-actions {
    background: #f5f6f8;
    border-left: 2px solid #ddd;
    min-width: 55px;
    position: sticky;
    right: 0;
    z-index: 2;
}
.production-plan-page .plan-table tbody .col-actions {
    background: #fff;
}
.production-plan-page .plan-table .totals-row .col-actions {
    background: #f0f4f8;
}
.production-plan-page .plan-table .totals-row {
    background: #f0f4f8;
    font-weight: 600;
}
.production-plan-page .plan-table .totals-row td {
    border-top: 2px solid #ccc;
}
.production-plan-page .plan-table .totals-row .total-value {
    color: #2c3e50;
}
.production-plan-page .plan-table .cell-input {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.85rem;
    min-width: 40px;
    outline: none;
    padding: 1px 2px;
    text-align: center;
    width: 100%;
}
.production-plan-page .plan-table .cell-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
}
.production-plan-page .plan-table .computed-cell {
    align-items: center;
    background: #f5f5f5;
    border-radius: 3px;
    color: #555;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    gap: 2px;
    padding: 1px 2px;
    text-align: center;
    width: 100%;
}
.production-plan-page .plan-table .computed-cell .computed-value {
    font-weight: 500;
}
.production-plan-page .plan-table .computed-cell .pc-info {
    align-items: center;
    border-top: 1px solid #ddd;
    color: #888;
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    line-height: 1.2;
    padding-top: 2px;
    width: 100%;
}
.production-plan-page .plan-table .pc-label {
    color: #aaa;
    display: block;
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 1px;
    text-align: center;
}
.production-plan-page .plan-table .relation-warning {
    align-items: center;
    background: #e67e22;
    border-radius: 50%;
    color: #fff;
    cursor: help;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    margin-left: 6px;
    vertical-align: middle;
    width: 18px;
}
.production-plan-page .save-all-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    margin-top: 16px;
}
.production-plan-page .save-all-bar .btn-save-all {
    background: #27ae60;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 28px;
}
.production-plan-page .save-all-bar .btn-save-all:hover {
    background: #219150;
}
.production-plan-page .save-all-bar .btn-save-all:disabled {
    background: #b0d4be;
    cursor: not-allowed;
}
.production-plan-page .btn-delete {
    background: #e74c3c;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 4px 10px;
}
.production-plan-page .btn-delete:hover {
    background: #c0392b;
}
.modal-overlay {
    align-items: center;
    background: #00000073;
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}
.add-row-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px #0003;
    max-width: 95vw;
    padding: 0;
    width: 480px;
}
.add-row-modal .modal-header {
    align-items: center;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
}
.add-row-modal .modal-header h2 {
    color: #333;
    font-size: 1.05rem;
}
.add-row-modal .modal-header .modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}
.add-row-modal .modal-header .modal-close:hover {
    color: #333;
}
.add-row-modal .modal-body {
    padding: 20px;
}
.add-row-modal .modal-body label {
    color: #444;
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.add-row-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px 20px;
}
.add-row-modal .modal-actions .btn-primary {
    background: #4a90d9;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 20px;
}
.add-row-modal .modal-actions .btn-primary:hover {
    background: #357abd;
}
.add-row-modal .modal-actions .btn-primary:disabled {
    background: #b0c4d8;
    cursor: not-allowed;
}
.add-row-modal .modal-actions .btn-cancel {
    background: #eee;
    border: none;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 20px;
}
.add-row-modal .modal-actions .btn-cancel:hover {
    background: #ddd;
}
.pds-page {
    background: #f1f5f9;
    font-family:
        Segoe UI,
        system-ui,
        sans-serif;
    min-height: 100vh;
}
.pds-hero {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #fff;
    overflow: hidden;
    padding: 52px 40px 0;
    position: relative;
}
.pds-hero-bg {
    background:
        radial-gradient(ellipse 600px 400px at 80% -10%, #38bdf826 0, #0000 70%),
        radial-gradient(ellipse 400px 300px at 10% 110%, #818cf81f 0, #0000 70%);
    inset: 0;
    pointer-events: none;
    position: absolute;
}
.pds-hero-content {
    margin: 0 auto 32px;
    max-width: 1200px;
    position: relative;
}
.pds-hero-eyebrow {
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.pds-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 10px;
}
.pds-hero-sub {
    color: #ffffffb3;
    font-size: 1rem;
    margin: 0;
}
.pds-hero-sub strong {
    color: #fff;
}
.pds-cat-nav {
    display: flex;
    gap: 8px;
    margin: 0 auto;
    max-width: 1200px;
    overflow-x: auto;
    position: relative;
}
.pds-cat-nav::-webkit-scrollbar {
    height: 0;
}
.pds-cat-pill {
    align-items: center;
    background: #ffffff1a;
    border-radius: 8px 8px 0 0;
    color: #ffffffbf;
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 6px;
    padding: 9px 18px;
    text-decoration: none;
    transition:
        background 0.18s,
        opacity 0.18s;
}
.pds-cat-pill:hover {
    background: #ffffff2e;
    color: #fff;
}
.pds-cat-pill .pill-count {
    background: #fff3;
    border-radius: 20px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 22px;
    padding: 1px 7px;
    text-align: center;
}
.pds-cat-pill.cat-blue:hover {
    background: #3b82f64d;
}
.pds-cat-pill.cat-green:hover {
    background: #22c55e4d;
}
.pds-cat-pill.cat-amber:hover {
    background: #f59e0b4d;
}
.pds-cat-pill.cat-purple:hover {
    background: #a855f74d;
}
.pds-cat-pill.cat-rose:hover {
    background: #f43f5e4d;
}
.pds-body {
    margin: 0 auto;
    max-width: 1200px;
    padding: 36px 40px 60px;
}
.pds-loading {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    gap: 16px;
    padding: 80px 0;
}
.pds-spinner {
    animation: spin 0.7s linear infinite;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #38bdf8;
    height: 36px;
    width: 36px;
}
@keyframes spin {
    to {
        transform: rotate(1turn);
    }
}
.pds-empty {
    color: #64748b;
    padding: 80px 0;
    text-align: center;
}
.pds-empty .pds-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.pds-empty p {
    font-size: 1rem;
}
.pds-sections {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.pds-cat-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 16px;
    box-shadow: 0 1px 4px #0000000a;
    overflow: hidden;
}
.pds-cat-section.cat-blue {
    border-left-color: #3b82f6;
}
.pds-cat-section.cat-green {
    border-left-color: #22c55e;
}
.pds-cat-section.cat-amber {
    border-left-color: #f59e0b;
}
.pds-cat-section.cat-purple {
    border-left-color: #a855f7;
}
.pds-cat-section.cat-rose {
    border-left-color: #f43f5e;
}
.pds-cat-section.cat-grey {
    border-left-color: #94a3b8;
}
.pds-cat-header {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 14px;
    padding: 18px 24px 16px;
}
.pds-cat-icon {
    flex-shrink: 0;
    font-size: 1.6rem;
    line-height: 1;
}
.pds-cat-info {
    flex-shrink: 0;
}
.pds-cat-title {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 2px;
}
.cat-blue .pds-cat-title {
    color: #1469f4;
}
.cat-green .pds-cat-title {
    color: #199145;
}
.cat-amber .pds-cat-title {
    color: #bb7808;
}
.cat-purple .pds-cat-title {
    color: #942ef5;
}
.cat-rose .pds-cat-title {
    color: #f2183e;
}
.pds-cat-count {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
}
.pds-cat-line {
    background: #e2e8f0;
    flex: 1 1;
    height: 1px;
}
.pds-cat-plans {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
}
.pds-plan-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    padding: 14px 20px;
    transition:
        box-shadow 0.18s,
        background 0.18s,
        transform 0.18s;
}
.pds-plan-card:hover {
    background: #fff;
    box-shadow: 0 4px 16px #00000014;
    transform: translateY(-1px);
}
.pds-plan-card-name {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}
.pds-plan-card-date {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 500;
}
@media (max-width: 768px) {
    .pds-hero {
        padding: 36px 20px 0;
    }
    .pds-hero-title {
        font-size: 1.8rem;
    }
    .pds-body {
        padding: 24px 20px 40px;
    }
    .pds-cat-plans {
        gap: 8px;
    }
    .pds-plan-card {
        min-width: 140px;
    }
}
.users .auth-message {
    color: #999;
    font-style: italic;
    margin-top: 20px;
}
.users-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
}
.users-toolbar .add-form {
    align-items: center;
    display: flex;
    gap: 8px;
}
.users-toolbar .add-form input,
.users-toolbar .add-form select {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    padding: 10px 14px;
}
.users-toolbar .add-form input:focus,
.users-toolbar .add-form select:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px #4a90d933;
    outline: none;
}
.users-toolbar .add-form input {
    width: 180px;
}
.users-toolbar .add-form select {
    cursor: pointer;
    width: 100px;
}
.role-badge {
    border-radius: 12px;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    text-transform: uppercase;
}
.role-badge.role-admin {
    background: #e8f5e9;
    color: #2e7d32;
}
.role-badge.role-user {
    background: #e3f2fd;
    color: #1565c0;
}
