:root {
    --nu-space-1: 4px;
    --nu-space-2: 8px;
    --nu-space-3: 12px;
    --nu-space-4: 16px;
    --nu-space-5: 20px;
    --nu-radius-sm: 8px;
    --nu-radius-md: 12px;
    --nu-border: #e5eaf0;
    --nu-muted: #64748b;
    --nu-heading: #1f2937;
    --nu-bg-soft: #f8fafc;
    --nu-primary: #0d6efd;
    --nu-success: #15803d;
    --nu-danger: #dc2626;
    --nu-warning: #d97706;
}

body {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.45;
    background: #f3f6fa;
}

#app.app {
    background: #f3f6fa;
}

.app-content {
    padding: 18px;
}

.app-header {
    border-bottom: 1px solid var(--nu-border);
    background: #ffffff;
}

.app-sidebar {
    border-right: 1px solid var(--nu-border);
}

.app-sidebar .menu .menu-item > .menu-link {
    border-radius: 8px;
    margin: 2px 8px;
}

.app-sidebar .menu .menu-item > .menu-link:hover,
.app-sidebar .menu .menu-item.active > .menu-link {
    background: #eef4ff;
}

.app-content > h4,
.app-content .page-header {
    font-weight: 700;
    color: var(--nu-heading);
    margin-bottom: 10px;
}

.login-branding {
    text-align: center;
    margin-bottom: 18px;
}

.login-brand-logo {
    width: auto;
    max-width: 65px;
    max-height: 23px;
    object-fit: contain;
    display: inline-block;
    margin-bottom: 2px;
}

.login-brand-caption {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.login-brand-tagline {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}

.app-content hr {
    border-top: 1px solid var(--nu-border);
    opacity: 1;
    margin-top: 10px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: var(--nu-space-3);
}

.form-group > label,
.control-label {
    font-size: 12px;
    font-weight: 700;
    color: #5c6b7a;
    letter-spacing: .03em;
}

.form-control,
.form-select,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 38px;
    font-size: 14px;
    border-radius: var(--nu-radius-sm) !important;
    border-color: #d8e1ea !important;
    box-shadow: none !important;
    background-color: #fff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #9fc3ff !important;
    box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .1) !important;
}

.form-control::placeholder {
    color: #94a3b8;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    line-height: 28px !important;
    padding-left: 10px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.required-field::before {
    content: "*";
    color: #dc2626;
    margin-right: 2px;
}

.is-invalid,
.input-validation-error {
    border-color: #dc3545 !important;
}

.text-danger {
    font-size: 12px;
    margin-top: 4px;
    display: inline-block;
}

.card,
.section-card,
.order-edit-panel,
.summary-card,
.details-changes-box,
.order-files-box,
.upload-card,
.attachment-strip,
.changes-box,
.product-builder,
.product-table-wrap {
    border-radius: var(--nu-radius-md) !important;
    border: 1px solid var(--nu-border) !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    background: #fff;
}

.card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--nu-border);
    font-weight: 700;
}

.table {
    --bs-table-bg: #fff;
    border-color: var(--nu-border);
    margin-bottom: 0;
}

.table thead th {
    background: var(--nu-bg-soft);
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--nu-border);
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
    padding: 8px 10px;
}

.table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.table tbody tr:hover {
    background: #f4f8ff;
}

.table-sm td,
.table-sm th {
    padding: 6px 8px;
}

.btn {
    border-radius: 9px;
    min-height: 36px;
    font-weight: 600;
    box-shadow: none !important;
}

.btn:focus {
    box-shadow: 0 0 0 .16rem rgba(13, 110, 253, .16) !important;
}

.btn:hover {
    transform: translateY(-1px);
    transition: all .15s ease;
}

.btn-sm {
    min-height: 30px;
    min-width: 30px;
    padding: 4px 9px;
}

.btn-primary {
    background: var(--nu-primary);
    border-color: var(--nu-primary);
}

.btn-success {
    background: var(--nu-success);
    border-color: var(--nu-success);
}

.btn-danger {
    background: var(--nu-danger);
    border-color: var(--nu-danger);
}

.btn-secondary,
.btn-outline-secondary {
    color: #334155;
    border-color: #cbd5e1;
}

.btn-default {
    color: #334155 !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

.btn.btn-sm:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-outline-danger) {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #d8e1ea;
}

.btn.btn-sm:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-outline-danger):hover {
    background: #eaf1ff;
    border-color: #c2d5ff;
    color: #1d4ed8;
}

.badge,
.file-type-badge,
.order-file-type {
    border-radius: 999px !important;
    font-weight: 700;
    font-size: 11px;
}

.empty-state {
    background: var(--nu-bg-soft);
    border: 1px dashed #d8e1ea;
    border-radius: 10px;
    color: var(--nu-muted);
    font-size: 12px;
    padding: 10px 12px;
}

.nav-tabs {
    border-bottom: 1px solid var(--nu-border);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 600;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
    color: #1e3a8a;
    border-bottom-color: #2563eb;
    background: transparent;
}

.dropdown-menu {
    border: 1px solid var(--nu-border);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .08);
}

.dropdown-notification {
    width: 360px;
    max-width: calc(100vw - 24px);
    padding-bottom: 0;
}

.dropdown-notification .dropdown-header {
    font-weight: 700;
    font-size: 13px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nu-border);
}

.dropdown-notification-item {
    max-height: 340px;
    overflow-y: auto;
}

#messagesList {
    list-style: none;
    margin: 0;
    padding: 8px;
}

#messagesList .notification-item {
    border: 1px solid #e4ebf4;
    border-radius: 10px;
    background: #fbfdff;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .15s ease;
}

#messagesList .notification-item:last-child {
    margin-bottom: 0;
}

#messagesList .notification-item.unread {
    border-left: 3px solid #2563eb;
}

#messagesList .notification-item.read {
    opacity: .75;
}

#messagesList .notification-item:hover {
    background: #f4f8ff;
}

#messagesList .notification-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

#messagesList .notification-message {
    font-size: 12px;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 4px;
}

#messagesList .notification-date {
    font-size: 11px;
    color: #64748b;
}

#messagesList .notification-meta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#messagesList .mark-read-btn {
    border: 1px solid #c9d6ea;
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    line-height: 1.4;
    cursor: pointer;
}

#messagesList .mark-read-btn:hover {
    border-color: #9fb9ea;
    color: #0d4cc9;
}

#messagesList .mark-read-btn:disabled {
    cursor: default;
    color: #64748b;
    border-color: #dbe4f2;
    background: #f8fafc;
}

#messagesList .no-record {
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #d8e1ea;
    border-radius: 10px;
    padding: 16px 10px;
    font-size: 12px;
}

.dropdown-notification-footer {
    border-top: 1px solid var(--nu-border);
    background: #fff;
}

.profile-dropdown {
    min-width: 280px;
    padding-top: 0;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-meta {
    min-width: 0;
}

.profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.profile-email {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d8e1ea !important;
    border-radius: 8px !important;
    min-height: 34px;
    padding: 4px 10px;
    background: #fff;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: #9fc3ff !important;
    box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .1);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
}

.app-content .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.header-brand-logo {
    width: auto;
    max-width: 120px;
    max-height: 36px;
    object-fit: contain;
}

.header-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: .02em;
}

.sidebar-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 10px 12px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.65);
}

.sidebar-brand-logo {
    width: auto;
    max-width: 48px;
    max-height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.sidebar-brand-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}

.app-sidebar.app-sidebar-minified .sidebar-branding,
.app-sidebar-minified .sidebar-branding {
    justify-content: center;
    padding: 8px 4px;
}

.app-sidebar.app-sidebar-minified .sidebar-brand-text,
.app-sidebar-minified .sidebar-brand-text {
    display: none;
}

.modal-content {
    border-radius: 12px;
    border: 1px solid var(--nu-border);
}

.modal-header,
.modal-footer {
    border-color: var(--nu-border);
}

.is-loading {
    opacity: .65;
    pointer-events: none;
}

.is-submitting {
    opacity: .75;
    pointer-events: none;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
    border-top: 1px solid var(--nu-border);
    padding-top: var(--nu-space-2);
}

.compact-grid .form-group {
    margin-bottom: 8px;
}

@media (max-width: 991px) {
    .app-content {
        padding: 12px;
    }

    .table-responsive,
    .table {
        display: block;
        overflow-x: auto;
    }

    .app-header .menu-search {
        display: none;
    }

    .app-sidebar {
        border-right: none;
    }

    .dropdown-notification {
        width: 320px;
    }

    .header-brand-text {
        display: none;
    }

    .header-brand-logo {
        max-width: 92px;
        max-height: 30px;
    }

    .login-brand-logo {
        max-width: 58px;
        max-height: 20px;
    }

    .sidebar-branding {
        margin: 8px 8px 10px;
    }
}
