.admin-page-content {
    background: #f4f6fb;
    min-height: calc(100vh - 140px);
}

html.semi-dark .sidebar-wrapper .sidebar-header .logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: #171449;
}

.sidebar-header {
    color: #171449;
}

.profile-menu-trigger {
    padding: 0.45rem 0.8rem 0.45rem 0.45rem;
    background: #fff;
    min-height: 56px;
}

.profile-menu-trigger:hover,
.profile-menu-trigger:focus {
    background: #fff;
}

.user-box .user-info {
    padding-right: 0.25rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #171449;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.page-intro-card,
.panel-card,
.table-card,
.slot-card {
    background: #fff;
    border: 1px solid #e8ebf3;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(23, 20, 73, 0.06);
}

.page-intro-card {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.page-intro-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #171449;
}

.page-intro-text {
    margin: 0;
    color: #6c757d;
}

.panel-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #171449;
    margin: 0;
}

.panel-subtitle {
    color: #6c757d;
    margin: 0.2rem 0 0;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.slot-card {
    padding: 1rem;
}

.slot-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: #171449;
}

.slot-format {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-top: 0.25rem;
}

.slot-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.slot-sample-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
}

.slot-sample-link:hover {
    color: #171449;
    text-decoration: underline;
}

.drop-zone {
    border: 2px dashed #c9d0e3;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    background: #f8f9fc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4f46e5;
    background: #eef0ff;
}

.drop-icon {
    font-size: 1.8rem;
    color: #4f46e5;
    margin-bottom: 0.75rem;
}

.drop-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: #171449;
}

.drop-formats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.drop-formats span {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe1ef;
    font-size: 0.78rem;
}

.file-input {
    display: none;
}

.file-preview {
    margin-top: 0.75rem;
}

.file-preview-inner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid #dbe1ef;
    border-radius: 14px;
    background: #fff;
    padding: 0.9rem 1rem;
}

.file-preview-icon {
    font-size: 1.5rem;
    color: #4f46e5;
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-preview-name {
    font-weight: 700;
    color: #171449;
    word-break: break-word;
}

.file-preview-size {
    font-size: 0.85rem;
    color: #6c757d;
}

.file-preview-remove,
.chip-reupload {
    border: 0;
    background: transparent;
    color: #4f46e5;
    margin-left: auto;
}

.slot-status {
    margin-top: 0.8rem;
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-size: 0.88rem;
}

.converted-chip,
.success-chip {
    background: #ecfdf3;
    color: #0f8a4a;
}

.converted-chip {
    display: flex;
    width: 100%;
}

.error-chip {
    background: #fef2f2;
    color: #c0392b;
}

.both-required-notice,
.form-message {
    display: none;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    align-items: center;
    gap: 0.65rem;
}

.both-required-notice {
    display: flex;
    background: #fff7ed;
    color: #c2410c;
}

.both-required-notice[hidden] {
    display: none !important;
}

.form-message.visible {
    display: flex;
}

.form-message.success {
    background: #ecfdf3;
    color: #0f8a4a;
}

.form-message.error {
    background: #fef2f2;
    color: #c0392b;
}

.btn-convert,
.btn-add-user {
    border: 0;
    border-radius: 12px;
    background: #171449;
    color: #fff;
    padding: 0.8rem 1rem;
    font-weight: 700;
}

#combinedSubmit {
    padding: 0.8rem 10rem;
}

.btn-convert:disabled {
    opacity: 0.55;
}

.btn-convert.btn-convert-muted {
    background: #6b7280;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.table-card {
    padding: 1.35rem;
}

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

.stat-card,
.quick-link-card {
    background: #fff;
    border: 1px solid #e8ebf3;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(23, 20, 73, 0.06);
}

.stat-card {
    padding: 1.25rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.stat-value {
    color: #171449;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-meta {
    margin-top: 0.4rem;
    color: #8a94a6;
    font-size: 0.86rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.quick-link-card {
    padding: 1.25rem;
    text-decoration: none;
    color: #171449;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.quick-link-card i {
    font-size: 1.5rem;
    color: #4f46e5;
}

.account-card {
    width: 100%;
}

.account-settings-form {
    display: grid;
    gap: 1rem;
}

.form-row-stack {
    display: grid;
    gap: 0.4rem;
}

.account-inline-message {
    font-size: 0.92rem;
}

.account-inline-message.success {
    color: #0f8a4a;
}

.account-inline-message.error {
    color: #c0392b;
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table th,
.history-table td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid #edf0f7;
    vertical-align: middle;
}

.history-table th {
    font-size: 0.83rem;
    text-transform: uppercase;
    color: #6c757d;
}

.type-badge,
.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    border: 0;
}

.sales-type,
.role-badge.admin,
.status-badge.active {
    background: #e8f1ff;
    color: #1d4ed8;
}

.stock-type,
.role-badge.user {
    background: #f3e8ff;
    color: #7e22ce;
}

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

button.status-badge {
    cursor: pointer;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.dl-link,
.btn-edit,
.btn-delete {
    color: #171449;
    text-decoration: none;
    font-weight: 600;
    margin-right: 0.85rem;
}

.dl-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.75rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: #fff;
    margin-bottom: 0.35rem;
}

.dl-link-source {
    background: #2563eb;
}

.dl-link-edi {
    background: #059669;
}

.dl-na {
    color: #a0a7b8;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #6c757d;
    min-height: 120px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    z-index: 1055;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
}

.modal-sm {
    width: min(420px, 100%);
}

.modal-content .close {
    position: absolute;
    right: 1rem;
    top: 0.9rem;
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-content form input,
.modal-content form select,
.modal-content form button {
    width: 100%;
    margin-bottom: 0.85rem;
}

.modal-content form input,
.modal-content form select {
    border: 1px solid #dbe1ef;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}

.modal-content form button,
#cancelDeleteBtn {
    border: 0;
    border-radius: 12px;
    background: #171449;
    color: #fff;
    padding: 0.8rem 1rem;
    font-weight: 700;
}

.modal-actions {
    align-items: stretch;
}

.modal-actions button {
    margin-bottom: 0;
}

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

.modal-secondary-btn,
#cancelDeleteBtn {
    background: #6b7280;
    color: #fff;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    min-width: 280px;
    max-width: 420px;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    animation: slideIn 0.25s ease;
}

.toast-success { background: #0f8a4a; }
.toast-error { background: #c0392b; }
.toast-info { background: #2563eb; }

.toast.hide {
    animation: fadeOut 0.3s ease forwards;
}

.company-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.company-selector-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border: 1px solid #dbe1ef;
    border-radius: 16px;
    text-decoration: none;
    color: #171449;
    background: #f8f9fc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.company-selector-card:hover,
.company-selector-card:focus {
    border-color: #4f46e5;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
    color: #171449;
}

.company-selector-card.is-selected {
    border-color: #4f46e5;
    background: #eef0ff;
}

.company-selector-icon,
.company-selector-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.company-selector-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    color: #4f46e5;
    font-size: 1.25rem;
}

.company-selector-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.company-selector-name {
    font-weight: 700;
    color: #171449;
    word-break: break-word;
}

.company-selector-meta {
    font-size: 0.78rem;
    color: #6c757d;
}

.company-selector-check {
    margin-left: auto;
    color: #4f46e5;
    font-size: 1.1rem;
}

.company-selector-clear {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.company-selector-clear:hover {
    text-decoration: underline;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-6px); }
}

@media (max-width: 991.98px) {
    .stats-grid,
    .quick-links-grid,
    .upload-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
