/* Opening Stock Import Summary — premium layout */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

.ois-page,
.ois-page .fi-page-content {
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

.ois-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: #0f172a;
}

.ois-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    padding: 1.5rem 1.75rem;
    color: #f8fafc;
    background:
        radial-gradient(ellipse 70% 55% at 100% 0%, rgba(56, 189, 248, 0.18), transparent 55%),
        linear-gradient(135deg, #0b1f3a 0%, #123056 55%, #0f2744 100%);
    box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.55);
}

.ois-hero__eyebrow {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ois-hero__title {
    margin: 0.35rem 0 0;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ois-hero__subtitle {
    margin: 0.45rem 0 0;
    max-width: 40rem;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.45;
}

.ois-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ois-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 36px;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
}

.ois-panel {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 1.15rem;
    padding: 1.2rem 1.35rem;
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.45);
}

.ois-panel__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}

.ois-panel__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.ois-panel__hint {
    margin: 0.3rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
    max-width: 42rem;
}

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

@media (min-width: 700px) {
    .ois-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .ois-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.ois-field {
    display: grid;
    gap: 0.35rem;
}

.ois-field > span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.ois-field select,
.ois-field input {
    min-height: 44px;
    width: 100%;
    border-radius: 0.8rem;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #0f172a;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
}

.ois-field select:focus,
.ois-field input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: #93c5fd;
    background: #fff;
}

.ois-filter-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.ois-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.ois-btn--ghost {
    background: #f8fafc;
    border-color: #dbe3ef;
    color: #334155;
}

.ois-btn--ghost:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ois-btn--primary {
    background: #1d4ed8;
    color: #fff;
}

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

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

@media (min-width: 640px) {
    .ois-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
    .ois-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
    .ois-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.ois-kpi {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e7edf5;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem 1.05rem 1.05rem;
    min-height: 7.25rem;
    box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.45);
}

.ois-kpi::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #94a3b8;
}

.ois-kpi--items::before { background: #2563eb; }
.ois-kpi--qty::before { background: #0f766e; }
.ois-kpi--stock::before { background: #7c3aed; }
.ois-kpi--cost::before { background: #b45309; }
.ois-kpi--ok::before { background: #15803d; }
.ois-kpi--issues::before { background: #b91c1c; }

.ois-kpi__label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.ois-kpi__value {
    margin: 0.55rem 0 0;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
    line-height: 1.15;
    word-break: break-word;
}

.ois-kpi__hint {
    margin: 0.4rem 0 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

.ois-kpi--ok .ois-kpi__value { color: #15803d; }
.ois-kpi--issues .ois-kpi__value { color: #0f172a; }
.ois-kpi__split { color: #94a3b8; font-weight: 600; }
.ois-kpi__warn { color: #b45309; }
.ois-kpi__danger { color: #b91c1c; }

.ois-price-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .ois-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
    .ois-price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
    .ois-price-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.ois-price {
    border-radius: 0.9rem;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    padding: 0.85rem 0.95rem;
}

.ois-price__label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.ois-price__value {
    margin: 0.4rem 0 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.ois-latest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ois-latest-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 600;
}

.ois-errors {
    margin-top: 1rem;
    border-radius: 0.9rem;
    border: 1px solid #fecaca;
    background: #fff7f7;
    overflow: hidden;
}

.ois-errors__title {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
    background: #fef2f2;
}

.ois-errors table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ois-errors th,
.ois-errors td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #fee2e2;
}

.ois-errors th {
    color: #7f1d1d;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ois-table-wrap {
    overflow-x: auto;
    border-radius: 0.9rem;
    border: 1px solid #e7edf5;
}

.ois-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ois-table thead {
    background: #0f172a;
    color: #e2e8f0;
}

.ois-table th {
    padding: 0.85rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ois-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    vertical-align: top;
}

.ois-table tbody tr:hover {
    background: #f8fafc;
}

.ois-table a {
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

.ois-table a:hover {
    text-decoration: underline;
}

.ois-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.ois-badge--ok { background: #dcfce7; color: #166534; }
.ois-badge--skip { background: #ffedd5; color: #9a3412; }
.ois-badge--fail { background: #fee2e2; color: #991b1b; }

.ois-empty {
    padding: 1.75rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    border-radius: 0.9rem;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.ois-page:has(.ois-shell) > .fi-page-header-main-ctn > .fi-header {
    display: none;
}

@media (max-width: 640px) {
    .ois-hero { padding: 1.15rem; }
    .ois-panel { padding: 1rem; }
}

/* Opening Stock Import — conflict resolution premium cards */
.os-conflict-panel {
    margin-top: 1.5rem;
    border: 1px solid #dbe4f0;
    border-radius: 1.25rem;
    padding: 1.35rem 1.4rem 1.5rem;
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(14, 116, 144, 0.08), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.4);
}

.os-conflict-panel__header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.os-conflict-panel__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0e7490;
}

.os-conflict-panel__title {
    margin: 0.35rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.os-conflict-panel__subtitle {
    margin: 0.4rem 0 0;
    max-width: 42rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #475569;
}

.os-conflict-panel__default-chip {
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
}

.os-conflict-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

@media (min-width: 768px) {
    .os-conflict-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .os-conflict-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.os-conflict-metric {
    border-radius: 0.95rem;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.85rem 0.95rem;
}

.os-conflict-metric span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.os-conflict-metric strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.os-conflict-metric--accent {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
}

.os-conflict-price-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.os-conflict-price-strip > div {
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.6rem 0.8rem;
    min-width: 8.5rem;
}

.os-conflict-price-strip span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.os-conflict-price-strip strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.95rem;
    color: #0f172a;
}

.os-conflict-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

@media (min-width: 960px) {
    .os-conflict-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.os-conflict-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 100%;
    border-radius: 1.1rem;
    border: 1px solid #dbe4f0;
    padding: 1.1rem 1.05rem 1rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    background: #fff;
}

.os-conflict-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.45);
}

.os-conflict-card--override {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 55%);
}

.os-conflict-card--separate {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
}

.os-conflict-card--only-new {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 55%);
}

.os-conflict-card.is-selected {
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18), 0 18px 34px -26px rgba(15, 23, 42, 0.45);
}

.os-conflict-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.os-conflict-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.os-conflict-card__badge {
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #334155;
    background: rgba(15, 23, 42, 0.05);
}

.os-conflict-card__title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.os-conflict-card__copy {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #475569;
}

.os-conflict-card__warn {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    color: #b45309;
}

.os-conflict-card__check {
    margin-top: auto;
    padding-top: 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f766e;
}

.os-conflict-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
}

.os-conflict-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.os-conflict-table th,
.os-conflict-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}

.os-conflict-table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
}

.os-conflict-table__muted {
    font-size: 0.75rem;
    color: #94a3b8;
}

.os-conflict-table__note {
    margin: 0.55rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.dark .os-conflict-panel {
    border-color: #1e293b;
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(34, 211, 238, 0.08), transparent 55%),
        linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

.dark .os-conflict-panel__title,
.dark .os-conflict-metric strong,
.dark .os-conflict-card__title,
.dark .os-conflict-price-strip strong {
    color: #f8fafc;
}

.dark .os-conflict-panel__subtitle,
.dark .os-conflict-metric span,
.dark .os-conflict-card__copy {
    color: #94a3b8;
}

.dark .os-conflict-metric,
.dark .os-conflict-price-strip > div,
.dark .os-conflict-card,
.dark .os-conflict-table-wrap {
    border-color: #1e293b;
    background: #0f172a;
}

.dark .os-conflict-table th {
    background: #111827;
    color: #94a3b8;
}

.dark .os-conflict-table th,
.dark .os-conflict-table td {
    border-bottom-color: #1e293b;
}
