/* =============================================
   NOTIFY CONTRACTS DIALOG
   Prefix: nc- (Notify Contracts)
   Mirrors the weighbridge Select Contract style
   ============================================= */

/* ---- Dialog shell ---- */
.nc-dialog.e-dialog {
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.05) !important;
    border: none !important;
    font-family: var(--font-sans) !important;
}

.nc-dialog.e-dialog.e-dlg-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: min(1560px, 94vw) !important;
    height: auto !important;
    max-height: 92vh !important;
}

/* Hide default Syncfusion header chrome */
.nc-dialog .e-dlg-header-content {
    padding: 0 !important;
    border: none !important;
    background: var(--chrome-bg) !important;
}

.nc-dialog .e-dlg-header {
    width: 100% !important;
    color: var(--chrome-text) !important;
}

.nc-dialog .e-dlg-header-content *,
.nc-dialog .e-dlg-header * {
    color: inherit;
}

.nc-dialog .e-dlg-header-content .e-btn.e-dlg-closeicon-btn {
    display: none !important;
}

.nc-dialog .e-dlg-content {
    padding: 0 !important;
    background: var(--bg-primary) !important;
    overflow: hidden !important;
}

/* Backdrop overlay */
.nc-dialog ~ .e-dlg-overlay,
.nc-dialog + .e-dlg-overlay {
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(4px) !important;
}

[data-theme="dark"] .nc-dialog ~ .e-dlg-overlay,
[data-theme="dark"] .nc-dialog + .e-dlg-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ---- Header bar — seamless black ---- */
.nc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--chrome-bg);
    gap: 16px;
}

.nc-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--chrome-text);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.nc-header-left > i {
    color: var(--accent-primary);
    font-size: 17px;
}

.nc-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--chrome-text-muted);
    background: var(--chrome-active);
    padding: 2px 10px;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
}

.nc-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Search ---- */
.nc-search {
    display: flex;
    align-items: center;
    background: var(--chrome-hover);
    border: 1px solid var(--chrome-input-border);
    border-radius: 6px;
    padding: 0 12px;
    height: 32px;
    min-width: 240px;
    transition: all .15s ease;
}

.nc-search:focus-within {
    background: var(--chrome-active);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-20);
}

.nc-search i { color: var(--chrome-text-dim); font-size: 12px; margin-right: 8px; flex-shrink: 0; }

.nc-search-input {
    background: none; border: none; outline: none;
    color: var(--chrome-text); font-size: 13px; font-family: var(--font-sans);
    width: 100%; height: 100%;
}
.nc-search-input::placeholder { color: var(--chrome-text-dim); }

.nc-search-clear {
    background: none; border: none; color: var(--chrome-text-dim);
    cursor: pointer; padding: 4px; font-size: 11px;
    display: flex; align-items: center; transition: color .12s;
}
.nc-search-clear:hover { color: var(--chrome-text); }

/* ---- Filter pills ---- */
.nc-filter-pills {
    display: flex;
    gap: 4px;
}

.nc-pill {
    background: var(--chrome-hover);
    border: 1px solid var(--chrome-input-border);
    border-radius: 4px;
    color: var(--chrome-text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 4px 10px;
    cursor: pointer;
    transition: all .15s ease;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.nc-pill:hover {
    background: var(--chrome-active);
    color: var(--chrome-text);
}

.nc-pill-active {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}
.nc-pill-active.nc-pill-sale {
    background: var(--success) !important;
    border-color: var(--success) !important;
}
.nc-pill-active.nc-pill-purchase {
    background: var(--warning) !important;
    border-color: var(--warning) !important;
}
.nc-pill-active.nc-pill-toll {
    background: #818cf8 !important;
    border-color: #818cf8 !important;
    color: var(--on-accent) !important;
}

/* ---- Close button ---- */
.nc-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: var(--chrome-hover);
    color: var(--chrome-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .15s;
}

.nc-close-btn:hover {
    background: var(--error-light);
    color: var(--error);
}

/* ---- Body ---- */
.nc-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    height: calc(92vh - 54px);
}

/* Loading & empty */
.nc-loading, .nc-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 14px; height: 100%; min-height: 250px;
    color: var(--text-muted); font-size: 14px;
}
.nc-loading i { font-size: 28px; color: var(--accent-primary); }
.nc-empty i { font-size: 36px; opacity: .25; }
.nc-clear-btn {
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.nc-clear-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ---- Table scroll ---- */
.nc-table-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}
.nc-table-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.nc-table-scroll::-webkit-scrollbar-track { background: var(--bg-primary); }
.nc-table-scroll::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
.nc-table-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Table — uses shared --grid-* density variables so the
   font-size slider scales it like every other grid in the app ---- */
.nc-tbl {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: var(--grid-font-size, 12.5px);
}

/* Headers — black, seamless with dialog header */
.nc-tbl thead { position: sticky; top: 0; z-index: 10; }

.nc-tbl thead th {
    background: var(--chrome-bg);
    color: var(--chrome-text);
    font-size: var(--grid-header-font-size, 11px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: var(--grid-header-padding-y, 5px) var(--grid-header-padding-x, 12px);
    text-align: left;
    border-bottom: 1px solid var(--chrome-border);
    white-space: nowrap;
    height: var(--grid-header-height, 30px);
}
.nc-tbl thead th:first-child { padding-left: 14px; }
.nc-r { text-align: right !important; }

/* Type column — narrow, centered */
.nc-tbl thead th:first-child,
.nc-tr td:first-child { width: 72px; text-align: center; padding-left: 10px; padding-right: 4px; }

/* Rows */
.nc-tr { transition: background .1s ease; }
.nc-tr td {
    padding: var(--grid-row-padding-y, 6px) var(--grid-row-padding-x, 12px);
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: var(--grid-font-size, 12.5px);
    height: var(--grid-row-height, 28px);
}
.nc-tr td:first-child { padding-left: 14px; }

.nc-tr:nth-child(even) { background: var(--bg-secondary); }
.nc-tr-click { cursor: pointer; }

/* Row left accent border by type — uses theme variables */
.nc-tr td:first-child { border-left: 3px solid transparent; }
.nc-tr:has(.nc-tp-sale) td:first-child { border-left-color: var(--success); }
.nc-tr:has(.nc-tp-purchase) td:first-child { border-left-color: var(--warning); }
.nc-tr:has(.nc-tp-toll) td:first-child { border-left-color: var(--info); }

/* Hover row — themed accent tint */
.nc-tr-click:hover td { background: var(--accent-10); }
.nc-tr-click:hover td:first-child { background: var(--accent-10); }

/* Contract number */
.nc-cc { display: flex; align-items: center; gap: 8px; }
.nc-cn {
    font-weight: 600;
    font-family: var(--font-numeric, var(--font-sans));
    font-size: var(--grid-font-size, 12.5px);
    letter-spacing: -.01em;
    color: var(--text-primary);
}

/* Attached document icon */
.nc-attach { color: var(--text-muted); font-size: 12px; }

/* Package badge */
.nc-pkg {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 700;
    color: var(--info); background: var(--info-light);
    border: 1px solid var(--info-light);
    padding: 1px 7px; border-radius: 10px;
    white-space: nowrap; font-family: var(--font-sans);
}
.nc-pkg i { font-size: 9px; }

/* Status pills — high-contrast on every theme */
.nc-status {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .05em;
    min-width: 56px; text-align: center;
}
.nc-status-pending { background: var(--warning-light); color: var(--warning); }
.nc-status-future { background: var(--info-light); color: var(--info); }
.nc-status-inactive { background: var(--error-light); color: var(--error); }
.nc-status-open { background: var(--success-light); color: var(--success); }

/* Period */
.nc-per { font-size: var(--grid-font-size, 12px); color: var(--text-secondary); white-space: nowrap; }

/* Dual-line (company/product) */
.nc-dl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nc-m {
    font-size: var(--grid-font-size, 12.5px); font-weight: 500; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.nc-s { font-size: 10px; color: var(--text-muted); font-family: var(--font-numeric, var(--font-sans)); }

/* Type pills — high contrast in both themes, no hardcoded indigo */
.nc-tp {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .05em;
    min-width: 56px; text-align: center;
}
.nc-tp-sale     { background: var(--success-light); color: var(--success); }
.nc-tp-purchase { background: var(--warning-light); color: var(--warning); }
.nc-tp-toll     { background: var(--info-light); color: var(--info); }

/* Numeric cells */
.nc-num {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-numeric, var(--font-sans));
    font-size: var(--grid-font-size, 12px);
}

.nc-neg { color: var(--error); font-weight: 700; }

/* ---- Dark mode — keep text bright enough to read ---- */
[data-theme="dark"] .nc-tbl thead th { background: var(--chrome-bg); }
[data-theme="dark"] .nc-tr:nth-child(even) { background: rgba(255,255,255,.025); }
[data-theme="dark"] .nc-tr-click:hover td { background: var(--accent-15); }
[data-theme="dark"] .nc-tr-click:hover td:first-child { background: var(--accent-15); }
[data-theme="dark"] .nc-tr td { color: var(--text-primary); }
[data-theme="dark"] .nc-m { color: var(--text-primary); }
[data-theme="dark"] .nc-s { color: var(--text-muted); }
[data-theme="dark"] .nc-per { color: var(--text-secondary); }
[data-theme="dark"] .nc-cn { color: var(--text-primary); }

/* ---- Responsive ---- */
@media (max-width: 1199px) {
    .nc-dialog.e-dialog.e-dlg-modal { width: 98vw !important; }
    .nc-filter-pills { display: none; }
}

@media (max-width: 899px) {
    .nc-dialog.e-dialog.e-dlg-modal { max-height: 95vh !important; }
    .nc-search { min-width: 160px; }
    .nc-m { max-width: 130px; }
    .nc-header { padding: 8px 14px; flex-wrap: wrap; }
}

@media (max-width: 699px) {
    .nc-search { min-width: 120px; }
    .nc-badge { display: none; }
    .nc-tbl { font-size: 11px; }
    .nc-tr td { padding: 5px 8px; }
}
