/* ============================
   COMPONENTS CSS
   ============================ */

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-success {
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--rose), #e11d48);
    color: #fff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-warning {
    background: linear-gradient(135deg, var(--amber), #d97706);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    gap: 4px;
}

.btn-xs svg {
    width: 12px;
    height: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--card-border, var(--border));
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow, none);
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-focus, rgba(99, 102, 241, 0.2));
    box-shadow: var(--card-shadow-hover, none);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-light);
}

/* STAT CARDS */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--card-border, var(--border));
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow, none);
    transition: all var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-color, var(--accent)), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover, var(--shadow-md));
    border-color: var(--border-focus, rgba(99, 102, 241, 0.2));
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-right: 50px;
    /* Stay clear of icon */
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-family: var(--font-mono);
    margin-bottom: 4px;
    padding-right: 50px;
    /* Space for the absolute icon */
}

.stat-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-right: 50px;
}

.stat-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-color-bg, rgba(99, 102, 241, 0.15));
    color: var(--card-color, var(--accent-light));
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-trend.up {
    color: var(--emerald-light);
}

.stat-trend.down {
    color: var(--rose-light);
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--rose);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: all var(--transition);
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control-mono {
    font-family: var(--font-mono);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--rose);
    margin-top: 4px;
}

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

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

.input-group {
    position: relative;
}

.input-prefix,
.input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.input-prefix {
    left: 12px;
}

.input-suffix {
    right: 12px;
}

.input-group .form-control {
    padding-left: 32px;
}

.input-group.suffix-group .form-control {
    padding-right: 50px;
}

/* TABLES */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
}

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

thead {
    background: var(--table-header-bg, var(--bg-tertiary));
}

th {
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background var(--transition), box-shadow 0.2s;
}

tbody tr:hover {
    background: var(--bg-hover);
    box-shadow: inset 3px 0 0 var(--border-focus, var(--accent));
}

td.text-primary {
    color: var(--text-primary);
    font-weight: 600;
}

.td-mono {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-light);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-light);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-light);
}

.badge-info {
    background: rgba(14, 165, 233, 0.15);
    color: var(--sky-light);
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-light);
}

/* PROGRESS BAR */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent), var(--purple));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* TABS */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    text-align: center;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

/* SEARCH BAR */
.search-bar {
    position: relative;
    flex: 1;
}

.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: all var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

.modal-container.modal-lg {
    max-width: 900px;
}

.modal-container.modal-xl {
    max-width: min(1200px, 92vw);
    width: 92vw;
}

.modal-container.modal-xxl {
    max-width: min(1400px, 95vw);
    width: 95vw;
}

/* Compact form controls inside modals */
.modal-body .form-control {
    font-size: 13px;
    padding: 8px 10px;
    height: 36px;
}

.modal-body .input-group .form-control {
    padding-left: 28px;
}

.modal-body .input-group.suffix-group .form-control {
    padding-right: 44px;
}

.modal-body .form-control-mono {
    font-size: 13px;
}

.modal-body .form-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.modal-body .form-group {
    margin-bottom: 12px;
}

.modal-body .form-row {
    gap: 10px;
    margin-bottom: 0;
}

.modal-body textarea.form-control {
    height: auto;
    min-height: 60px;
}

.modal-body select.form-control {
    height: 36px;
    padding: 6px 10px;
}

.modal-body .btn {
    font-size: 13px;
    padding: 7px 12px;
    height: 36px;
}

.modal-body .btn-sm {
    font-size: 12px;
    padding: 5px 10px;
    height: 30px;
}

.modal-body .btn-xs {
    font-size: 11px;
    padding: 3px 8px;
    height: 26px;
}

/* Two-column sale modal grid */
.modal-body .modal-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .modal-body .modal-two-col {
        grid-template-columns: 1fr;
    }

    .modal-container.modal-xl,
    .modal-container.modal-xxl {
        width: 98vw;
        max-width: 98vw;
    }
}

/* Sale summary rows */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.summary-row.total {
    border-bottom: none;
    padding-top: 8px;
    font-weight: 700;
    font-size: 14px;
}

.summary-label {
    color: var(--text-muted);
}

.summary-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

/* Compact card title inside modals */
.modal-body .card-title {
    font-size: 13px;
    margin-bottom: 10px !important;
}

.modal-body .card {
    padding: 14px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    font-size: 24px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* TOAST */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 380px;
    animation: toastIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    cursor: pointer;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success {
    border-left: 3px solid var(--emerald);
}

.toast.error {
    border-left: 3px solid var(--rose);
}

.toast.warning {
    border-left: 3px solid var(--amber);
}

.toast.info {
    border-left: 3px solid var(--sky);
}

.toast.success .toast-icon {
    color: var(--emerald-light);
}

.toast.error .toast-icon {
    color: var(--rose-light);
}

.toast.warning .toast-icon {
    color: var(--amber-light);
}

.toast.info .toast-icon {
    color: var(--sky-light);
}

.toast-msg {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

/* DIVIDER */
.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
}

/* SECTION HEADER */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* CHIP */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.chip:hover,
.chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* SUMMARY BOX */
.summary-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.summary-row.total {
    border-top: 2px solid rgba(99, 102, 241, 0.3);
    padding-top: 12px;
    margin-top: 4px;
    font-weight: 700;
    font-size: 15px;
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ALERT FLAGS */
.alert-flag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.alert-flag.danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--rose-light);
}

.alert-flag.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--amber-light);
}

.alert-flag.info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--sky-light);
}

.alert-flag.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--emerald-light);
}

.alert-flag svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* GRID LAYOUTS */
.chart-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

@media (max-width: 1024px) {
    .chart-grid-2-1 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-3 > div:nth-child(3):last-child {
        grid-column: 1 / -1;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================
   NOTIFICATIONS
   ============================ */

.notifications-wrapper {
    position: relative;
    display: inline-block;
}

.notifications-btn {
    width: 34px;
    height: 34px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.notifications-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.notifications-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--rose);
    color: white;
    font-size: 9px;
    font-weight: 800;
    height: 16px;
    min-width: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    animation: pulse-soft 2s infinite;
}

.notification-badge.pulse {
    animation: pulse-ring 1s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(225, 29, 72, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
    }
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 380px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(99, 102, 241, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#markAllReadBtn {
    color: var(--accent-light);
    font-weight: 600;
    transition: all 0.2s ease;
    opacity: 0.8;
}

#markAllReadBtn:hover {
    opacity: 1;
    text-shadow: 0 0 8px var(--accent-glow);
}

.notifications-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.notifications-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.notification-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.notification-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.notification-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.notification-tab.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.notification-tab.active::after {
    width: 100%;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    padding: 0;
    margin: 0;
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    align-items: center;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 20px;
}

.notification-delete-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    color: var(--rose-light);
    background: rgba(244,63,94,0.1);
    transform: scale(1.1);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 20px;
    height: 20px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.notification-subject {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.notification-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.notification-action {
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

/* Tipos de notificaciones */
.notification-item.type-critical .notification-icon {
    background: rgba(225, 29, 72, 0.1);
    color: var(--rose);
}

.notification-item.type-critical.unread::before {
    background: var(--rose);
}

.notification-item.type-alert .notification-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber);
}

.notification-item.type-alert.unread::before {
    background: var(--amber);
}

.notification-item.type-info .notification-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.notification-item.type-success .notification-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
}

.notification-item.type-success.unread::before {
    background: var(--emerald);
}

.notifications-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 768px) {
    .notifications-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: auto;
        border-radius: 0 0 16px 16px;
        border-left: none;
        border-right: none;
        max-height: calc(100vh - 60px);
    }
}

/* ============================
   SUPPLIER CATALOG AUTOCOMPLETE
   ============================ */
.cat-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.15);
    max-height: 320px;
    overflow-y: auto;
}

.cat-suggestion-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

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

.cat-suggestion-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.cat-suggestion-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cat-suggestion-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================
   SHIPPING CALC RESPONSIVE
   ============================ */
@media (max-width: 640px) {
    #shipCalcArea [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    #shipCalcArea [style*="border-right:1px solid"] {
        border-right: none !important;
        padding-right: 16px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}