* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f5f7fb;
    color: #111827;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo,
.auth-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}



.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-heading {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.page-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
}

.user-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
}

.page-content {
    padding: 28px;
}

.footer-note {
    text-align: center;
    padding: 16px;
    color: #6b7280;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.panel-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.04);
}

.stat-title {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.clean-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: #374151;
}

.clean-list li {
    margin-bottom: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-light {
    background: #fff;
    color: #111827;
    border-color: #e5e7eb;
}

.btn-light:hover {
    background: #f9fafb;
}

.btn-full {
    width: 100%;
}

.guest-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrap {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 15px 40px rgba(17, 24, 39, 0.06);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand h2 {
    margin: 16px 0 8px;
    font-size: 28px;
}

.auth-brand p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.auth-switch a {
    color: #2563eb;
    font-weight: 600;
}

@media (max-width: 991px) {
    .sidebar {
        display: none;
    }

    .stats-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 18px;
    }

    .page-content {
        padding: 18px;
    }
}


.page-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.section-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead th {
    text-align: left;
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.modern-table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 14px;
    color: #111827;
}

.modern-table tbody tr:hover {
    background: #fafcff;
}

.table-primary-text {
    font-weight: 600;
    color: #111827;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background: #ecfdf5;
    color: #047857;
}

.status-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.empty-state p {
    margin: 0 0 20px;
    color: #6b7280;
}

.form-page-wrap {
    max-width: 900px;
}

.form-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.form-card {
    padding: 24px;
}

.two-col-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

@media (max-width: 767px) {
    .page-actions-bar,
    .form-page-head,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .two-col-form {
        grid-template-columns: 1fr;
    }

    .table-actions {
        justify-content: flex-start;
    }

    .text-right {
        text-align: left;
    }
}


.table-secondary-text {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.product-thumb {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-placeholder {
    width: 58px;
    height: 58px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 14px;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-align: center;
    padding: 6px;
}

.product-thumb-placeholder.large {
    width: 120px;
    height: 120px;
    font-size: 14px;
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.status-out {
    background: #fef2f2;
    color: #b91c1c;
}

.edit-image-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.edit-image-box img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.qty-up {
    color: #047857;
    font-weight: 700;
}

.qty-down {
    color: #b91c1c;
    font-weight: 700;
}

.sale-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    align-items: end;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.sale-row:last-child {
    border-bottom: none;
}

.sale-row-remove-wrap {
    min-width: 110px;
}

.detail-grid {
    display: grid;
    gap: 12px;
    color: #374151;
    font-size: 14px;
}

@media (max-width: 767px) {
    .sale-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-grid {
    display: grid;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #374151;
}

.small-preview {
    margin-top: 10px;
}

.small-preview img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.catalog-public-body {
    margin: 0;
    background: #f5f7fb;
    font-family: Inter, Arial, sans-serif;
    color: #111827;
}

.catalog-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.catalog-header-card,
.catalog-cover-card,
.catalog-category-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
    margin-bottom: 22px;
}

.catalog-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.catalog-logo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.catalog-brand h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
}

.catalog-brand p {
    margin: 6px 0 0;
    color: #6b7280;
}

.catalog-contact-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: #374151;
    font-size: 14px;
}

.catalog-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.catalog-search-bar input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
}

.catalog-top-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.catalog-cover-card img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 18px;
}

.catalog-category-head {
    margin-bottom: 18px;
}

.catalog-category-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.catalog-card {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}

.catalog-card-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-no-image {
    color: #6b7280;
    font-size: 14px;
}

.catalog-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: #1d4ed8;
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.catalog-card-body {
    padding: 16px;
}

.catalog-card-body h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

.catalog-price {
    margin-bottom: 10px;
    color: #111827;
    font-weight: 700;
}

.catalog-stock {
    font-size: 14px;
    font-weight: 700;
}

.catalog-stock.available {
    color: #047857;
}

.catalog-stock.out {
    color: #b91c1c;
}

.catalog-password-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

@media (max-width: 991px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .catalog-page {
        padding: 16px;
    }

    .catalog-brand,
    .catalog-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }
}
.checkbox-only {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
}
.inline-edit-form {
    margin: 0;
}

.inline-edit-grid {
    display: grid;
    grid-template-columns: 100px 90px 150px 110px 70px;
    gap: 10px;
    align-items: center;
}

.inline-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13px;
    background: #fff;
    outline: none;
}

.inline-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

@media (max-width: 1200px) {
    .inline-edit-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.stats-grid-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats-grid-two {
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.stat-card-highlight {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

.stat-note {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.mini-list-item:last-child {
    border-bottom: none;
}

.mini-list-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.mini-list-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.mini-list-right {
    text-align: right;
}

.qty-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.qty-badge.low {
    background: #fff7ed;
    color: #c2410c;
}

.money-text {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.empty-inline-state {
    padding: 18px 0;
    color: #6b7280;
    font-size: 14px;
}

.compact-table thead th,
.compact-table tbody td {
    padding-top: 12px;
    padding-bottom: 12px;
}

@media (max-width: 1200px) {
    .stats-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid-two,
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .stats-grid-six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
    }
}
.import-result-box {
    margin-top: 22px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.import-summary {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 14px;
    color: #111827;
}

.import-errors {
    margin-top: 12px;
}

.import-errors h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.code-sample-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    overflow-x: auto;
}

.code-sample-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.6;
}

.qr-preview-box {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.qr-preview-box img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 10px;
}

.qr-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sale-search-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.sale-search-row:last-child {
    border-bottom: none;
}

.sale-search-group {
    position: relative;
}

.sale-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(17, 24, 39, 0.08);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.sale-search-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.sale-search-item:last-child {
    border-bottom: none;
}

.sale-search-item:hover {
    background: #f8fbff;
}

.sale-search-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.sale-search-item-sub {
    margin-top: 5px;
    font-size: 12px;
    color: #6b7280;
}

.sale-search-empty {
    padding: 16px;
    font-size: 14px;
    color: #6b7280;
}

.sale-selected-info {
    margin-top: 10px;
}

.sale-selected-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.sale-selected-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.sale-selected-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.sale-selected-meta {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .sale-search-row {
        grid-template-columns: 1fr;
    }
}
.pdf-preview-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pdf-page-preview {
    background: #dbe4f0;
    padding: 24px;
    border-radius: 24px;
    overflow-x: auto;
}

.pdf-cover-preview,
.pdf-page-preview .pdf-preview-grid-wrapper {
    width: 210mm;
}

.pdf-cover-preview,
.pdf-page-preview > .pdf-category-title,
.pdf-preview-grid {
    background: #ffffff;
}

.pdf-cover-preview {
    min-height: 297mm;
    margin: 0 auto;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    text-align: center;
}

.pdf-cover-logo img {
    height: 80px;
    object-fit: contain;
    margin-bottom: 14px;
}

.pdf-cover-title {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}

.pdf-cover-text {
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.pdf-cover-address {
    font-size: 14px;
    color: #4b5563;
    margin: 16px auto 0;
    max-width: 80%;
    line-height: 1.7;
}

.pdf-cover-image {
    margin-top: 24px;
}

.pdf-cover-image img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.pdf-page-preview > .pdf-category-title {
    width: 210mm;
    margin: 0 auto 0;
    padding: 24px 24px 0 24px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.pdf-preview-grid {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 16px 24px 24px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    font-size: 0;
}

.pdf-preview-card {
    display: inline-block;
    vertical-align: top;
    margin: 0 1% 16px 1%;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-sizing: border-box;
    font-size: 12px;
}

.pdf-preview-image-wrap {
    position: relative;
    height: 170px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-preview-image-wrap img {
    max-width: 100%;
    max-height: 170px;
    object-fit: contain;
}

.pdf-preview-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #1d4ed8;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
}

.pdf-preview-no-image {
    color: #6b7280;
    font-size: 13px;
}

.pdf-preview-body {
    padding: 12px;
    text-align: center;
}

.pdf-preview-name {
    color: #111827;
    line-height: 1.5;
}

.pdf-preview-price {
    margin-top: 8px;
    color: #111827;
}

.pdf-preview-stock-out {
    margin-top: 8px;
    color: #b91c1c;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .pdf-page-preview {
        padding: 16px;
    }
}
.template-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.template-preview-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-preview-card strong {
    font-size: 14px;
    color: #111827;
}

.template-preview-card span {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .template-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.template-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.template-preview-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 110px;
}

.template-preview-card strong {
    font-size: 14px;
    color: #111827;
}

.template-preview-card span {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .template-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .template-preview-grid {
        grid-template-columns: 1fr;
    }
}





:root {
    --primary: #2563eb;
    --primary-light: #eaf1ff;
    --primary-soft: #dbeafe;
    --success: #059669;
    --success-light: #ecfdf5;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --surface: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f8fafc;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: #64748b;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--primary-soft);
}

.nav-item.active .nav-icon {
    color: var(--primary);
}

.nav-item-live {
    margin-top: 10px;
    background: var(--success-light);
    color: var(--success);
    box-shadow: inset 0 0 0 1px #d1fae5;
}

.nav-item-live .nav-icon {
    color: var(--success);
}

.nav-item-live:hover {
    background: #d1fae5;
    color: var(--success);
}

.main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.nav-item.active {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--primary);
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.page-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.profile-form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    padding: 22px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.card-head {
    margin-bottom: 18px;
}

.card-head h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.card-head p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #111827;
    outline: none;
    transition: 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-group small {
    font-size: 12px;
    color: #6b7280;
}

.image-preview-box {
    margin-top: 8px;
    width: 120px;
    height: 120px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-input {
    height: 48px;
    padding: 6px;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
    }

    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        justify-content: stretch;
    }

    .profile-actions .btn {
        width: 100%;
    }
}

.gallery-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.gallery-preview-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px;
    background: #ffffff;
}

.gallery-preview-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 10px;
}

.gallery-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.gallery-thumb-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
}

.gallery-thumb-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 8px;
}

.gallery-thumb-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb-actions {
    display: flex;
    justify-content: center;
}

.btn-xs {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 8px;
}

.gallery-thumb-actions.two-btn {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.replace-btn {
    cursor: pointer;
}
.product-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.product-form-layout .full-span {
    grid-column: 1 / -1;
}

.section-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.edit-image-box {
    width: 180px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.edit-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.gallery-thumb-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
}

.gallery-thumb-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 8px;
}

.gallery-thumb-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb-actions {
    display: flex;
    justify-content: center;
}

.btn-xs {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .product-form-layout {
        grid-template-columns: 1fr;
    }

    .form-grid.two-col {
        grid-template-columns: 1fr;
    }
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    margin-top: 15px;
}

.gallery-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
}

.gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-actions {
    margin-top: 8px;
}

.btn-delete {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-delete:hover {
    background: #dc2626;
}
.suggest-item {
    padding: 8px;
    background: #fff;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.suggest-item:hover {
    background: #f1f5f9;
}
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

/* =========================
   SALES MODULE
========================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.page-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.section-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    opacity: 0.96;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.btn-light {
    background: #ffffff;
    border-color: #d1d5db;
    color: #111827;
}

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 13px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1fr 1fr auto auto;
    gap: 12px;
    align-items: center;
}

.filter-row input,
.filter-row select {
    width: 100%;
}

.form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-col {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea,
.filter-row input,
.filter-row select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    outline: none;
}

.form-group textarea {
    min-height: 110px;
    padding: 12px 14px;
    resize: vertical;
}

.form-group small {
    color: #6b7280;
    font-size: 12px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table thead th {
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #111827;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.text-center {
    text-align: center;
}

/* Sale form */
.sale-form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.sale-items-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.sale-items-table {
    min-width: 900px;
}

.sale-items-table th,
.sale-items-table td {
    text-align: left;
}

.sale-items-table .sale-product-select,
.sale-items-table .sale-qty,
.sale-items-table .sale-price,
.sale-items-table .sale-line-total {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    font-size: 14px;
}

.sale-items-table .sale-line-total {
    background: #f8fafc;
}

.sale-summary-box {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.sale-grand-total {
    min-width: 220px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 16px;
}

.sale-grand-total span {
    font-size: 14px;
    font-weight: 600;
    color: #1d4ed8;
}

.sale-grand-total strong {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* Party suggestions */
.party-search-wrap {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    display: none;
    z-index: 30;
    max-height: 240px;
    overflow-y: auto;
}

.suggestions-box.active {
    display: block;
}

.suggest-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-size: 14px;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: #f8fafc;
}

/* Sale view page */
.view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

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

/* Mobile */
@media (max-width: 1100px) {
    .filter-row {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .filter-row .btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
    }

    .form-grid.two-col,
    .view-grid {
        grid-template-columns: 1fr;
    }

    .sale-items-head {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-summary-box {
        justify-content: stretch;
    }

    .sale-grand-total {
        width: 100%;
    }

    .filter-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .panel-card {
        padding: 16px;
        border-radius: 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}