﻿body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

aside {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: #111827;
    color: white;
    padding: 20px;
    box-sizing: border-box;
}

aside h2 {
    margin-top: 0;
}

aside a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 8px;
    margin: 6px 0;
    border-radius: 8px;
}

aside a:hover {
    background: #374151;
}

main {
    margin-left: 240px;
    padding: 25px;
}

.cards {
    display: flex;
    gap: 16px;
    margin-bottom: 25px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-width: 180px;
}

.card h3 {
    margin: 0;
    color: #555;
}

.card p {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0 0;
}

.card.danger p {
    color: #dc2626;
}

table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #111827;
    color: white;
}

.form-box {
    background: white;
    padding: 22px;
    border-radius: 14px;
    max-width: 520px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-box label {
    display: block;
    margin-top: 14px;
    font-weight: bold;
}

.form-box input {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
}

.form-box button {
    margin-top: 20px;
    background: #111827;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
}

.form-box button:hover {
    background: #374151;
}

.hint {
    color: #555;
    margin-bottom: 16px;
}

.stock-sheet input {
    width: 110px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
}

.stock-sheet input:focus {
    outline: 2px solid #2563eb;
    border-color: #2563eb;
}

.save-status {
    font-weight: bold;
}

.save-status.saved {
    color: #16a34a;
}

.save-status.saving {
    color: #ca8a04;
}

.save-status.changed {
    color: #2563eb;
}

.save-status.error {
    color: #dc2626;
}

.toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

#searchBox {
    width: 320px;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
}

.low-stock-row {
    background: #fff1f2;
}

.stock-sheet td, .stock-sheet th {
    white-space: nowrap;
}

.stock-sheet td:nth-child(3) {
    white-space: normal;
}

.stock-input {
    background: #f8fafc;
    font-weight: bold;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: 1px;
}

.brand h2 {
    margin: 0;
    font-size: 20px;
}

.brand small {
    color: #cbd5e1;
}

nav a {
    display: block;
    color: #e5e7eb;
    text-decoration: none;
    padding: 12px 10px;
    margin: 6px 0;
    border-radius: 10px;
    font-weight: 600;
}

nav a:hover {
    background: #374151;
    color: white;
}

.btn {
    display: inline-block;
    background: #111827;
    color: white;
    text-decoration: none;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.btn.small {
    padding: 7px 10px;
    font-size: 14px;
}

.danger-btn {
    background: #dc2626;
}

.cancel-btn {
    margin-left: 10px;
    background: #6b7280;
}

.actions {
    white-space: nowrap;
}


.message-box {
    margin-top: 18px;
    padding: 12px 14px;
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-weight: bold;
}

pre {
    background: #111827;
    color: white;
    padding: 14px;
    border-radius: 10px;
    overflow-x: auto;
}


.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
}


.login-body {
    margin: 0;
    min-height: 100vh;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

.login-box {
    background: white;
    width: 360px;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.login-box h1 {
    margin: 0 0 8px;
}

.login-box p {
    color: #6b7280;
    margin-bottom: 22px;
}

.login-box label {
    display: block;
    font-weight: bold;
    margin-top: 14px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    margin-top: 20px;
    background: #2563eb;
    color: white;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* Bigger UI font patch */
body {
    font-size: 30px;
}

main {
    padding: 35px;
}

h1 {
    font-size: 52px;
}

h2 {
    font-size: 40px;
}

h3 {
    font-size: 30px;
}

.brand h2 {
    font-size: 32px;
}

.brand small {
    font-size: 22px;
}

nav a {
    font-size: 28px;
    padding: 18px 14px;
}

.card h3 {
    font-size: 28px;
}

.card p {
    font-size: 56px;
}

th, td {
    font-size: 28px;
    padding: 18px;
}

input,
button,
.btn,
.form-box input,
.form-box button,
#searchBox,
.stock-sheet input {
    font-size: 28px;
}

.hint {
    font-size: 26px;
}

.save-status {
    font-size: 26px;
}

.login-box {
    width: 560px;
}

.login-box h1 {
    font-size: 48px;
}

.login-box p,
.login-box label,
.login-box input,
.login-box button {
    font-size: 28px;
}


/* Revert web UI font size back to normal */
body {
    font-size: 16px;
}

main {
    padding: 25px;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 18px;
}

.brand h2 {
    font-size: 20px;
}

.brand small {
    font-size: 13px;
}

nav a {
    font-size: 16px;
    padding: 12px 10px;
}

.card h3 {
    font-size: 18px;
}

.card p {
    font-size: 32px;
}

th, td {
    font-size: 16px;
    padding: 12px;
}

input,
button,
.btn,
.form-box input,
.form-box button,
#searchBox,
.stock-sheet input {
    font-size: 15px;
}

.hint {
    font-size: 16px;
}

.save-status {
    font-size: 16px;
}

.login-box {
    width: 360px;
}

.login-box h1 {
    font-size: 32px;
}

.login-box p,
.login-box label,
.login-box input,
.login-box button {
    font-size: 16px;
}


/* Sortable table headers */
th {
    user-select: none;
}

th:hover {
    filter: brightness(1.15);
}


.zero-filter-box {
    display: flex;
    gap: 18px;
    align-items: center;
    background: white;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 10px 0 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: fit-content;
}

.zero-filter-box label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
}

.zero-filter-box input {
    transform: scale(1.2);
}


/* Move zero-stock filter to right side */
.zero-filter-box {
    float: right;
    margin-top: -58px;
    margin-right: 0;
    margin-bottom: 18px;
    z-index: 10;
    position: relative;
}

/* Clear layout after filter */
.cards,
.toolbar,
table {
    clear: both;
}

/* Sticky/static table header while scrolling */
table {
    position: relative;
}

th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #111827;
}

/* Better spacing for dashboard filter */
h1 + .zero-filter-box {
    margin-top: -52px;
}

/* Mobile/small screen fallback */
@media (max-width: 900px) {
    .zero-filter-box {
        float: none;
        margin-top: 10px;
        width: auto;
    }
}


/* Strong sticky table headers */
table thead th,
table tr:first-child th {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    background: #111827 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.18);
}

/* Prevent parent clipping sticky header */
main,
body {
    overflow: visible !important;
}


/* Reliable sticky table header with inner scroll */
.table-scroll-wrap {
    max-height: 68vh;
    overflow: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: white;
    margin-top: 12px;
}

.table-scroll-wrap table {
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin: 0;
}

.table-scroll-wrap th {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #111827 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* keep first column visible also, useful for stock sheet */
.table-scroll-wrap th:first-child,
.table-scroll-wrap td:first-child {
    position: sticky;
    left: 0;
    z-index: 900;
}

.table-scroll-wrap td:first-child {
    background: inherit;
}

.table-scroll-wrap th:first-child {
    z-index: 1100 !important;
    background: #111827 !important;
}


/* Clickable dashboard cards */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
}



.todo-form {
    margin-bottom: 24px;
}

.status-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

.pending-pill {
    background: #fef3c7;
    color: #92400e;
}

.completed-pill {
    background: #dcfce7;
    color: #166534;
}



.error-message {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

.password-wrap {
    position: relative;
    width: 100%;
}

.password-wrap input {
    padding-right: 48px !important;
}

.password-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    color: #374151 !important;
    border: none !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    width: auto !important;
    cursor: pointer;
    font-size: 18px !important;
    line-height: 1;
}

.password-eye:hover {
    background: #f3f4f6 !important;
    border-radius: 6px;
}



.copy-box {
    background: #111827;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre;
    font-size: 13px;
    line-height: 1.45;
    max-height: 420px;
}


/* Flipkart dashboard */
.copy-box {
    background: #111827;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
}


/* Mail-style Flipkart report tables */
.mail-style-table {
    width: auto;
    min-width: 650px;
    border-collapse: collapse;
    margin-bottom: 24px;
    background: white;
    box-shadow: none;
    border-radius: 0;
}

.mail-style-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #c9c9c9;
    padding: 9px 10px;
    font-weight: 700;
}

.mail-style-table td {
    border: 1px solid #c9c9c9;
    padding: 9px 10px;
    background: #ffffff;
}

.mail-style-table .total-row td,
.total-row td {
    background: #fff2cc !important;
    font-weight: 700;
}

.small-table {
    min-width: 420px;
}

.low-price-cell {
    background: #fecaca !important;
}


.diff-cell {
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 700;
}

/* Flipkart chart cards */
.chart-control-bar {
    display: flex;
    gap: 14px;
    align-items: end;
    flex-wrap: wrap;
    background: white;
    padding: 14px;
    border-radius: 14px;
    margin: 12px 0 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-control-bar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.chart-control-bar select {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
}

.chart-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: 300px;
}

.chart-card-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.chart-card-title span {
    font-weight: 700;
    color: #2563eb;
}


/* Compact Flipkart Dashboard view */
body:has(#flipkartChartCards) main {
    padding: 16px;
}

body:has(#flipkartChartCards) h1 {
    font-size: 26px;
    margin-bottom: 10px;
}

body:has(#flipkartChartCards) h2 {
    font-size: 18px;
    margin: 18px 0 8px;
}

body:has(#flipkartChartCards) .cards {
    gap: 10px;
    margin-bottom: 12px;
}

body:has(#flipkartChartCards) .card {
    padding: 12px;
}

body:has(#flipkartChartCards) .card h3 {
    font-size: 14px;
}

body:has(#flipkartChartCards) .card p {
    font-size: 24px;
}

body:has(#flipkartChartCards) .chart-control-bar {
    padding: 10px;
    gap: 10px;
    margin: 8px 0 12px;
}

body:has(#flipkartChartCards) .chart-control-bar label {
    font-size: 13px;
}

body:has(#flipkartChartCards) .chart-control-bar select,
body:has(#flipkartChartCards) .chart-control-bar button {
    padding: 7px 10px;
    font-size: 13px;
}

body:has(#flipkartChartCards) .chart-card-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

body:has(#flipkartChartCards) .chart-card {
    height: 190px;
    padding: 10px;
    border-radius: 12px;
}

body:has(#flipkartChartCards) .chart-card-title {
    font-size: 13px;
    margin-bottom: 4px;
}

body:has(#flipkartChartCards) .chart-card-title span {
    font-size: 13px;
}

body:has(#flipkartChartCards) .toolbar {
    margin: 8px 0;
}

body:has(#flipkartChartCards) .toolbar input {
    padding: 8px 10px;
    font-size: 13px;
}

body:has(#flipkartChartCards) .mail-style-table {
    font-size: 13px;
    margin-bottom: 14px;
    min-width: 0;
}

body:has(#flipkartChartCards) .mail-style-table th,
body:has(#flipkartChartCards) .mail-style-table td {
    padding: 5px 7px;
    font-size: 13px;
    white-space: nowrap;
}

body:has(#flipkartChartCards) .table-scroll-wrap {
    max-height: 45vh;
    margin-top: 6px;
}

@media (max-width: 1200px) {
    body:has(#flipkartChartCards) .chart-card-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 800px) {
    body:has(#flipkartChartCards) .chart-card-grid {
        grid-template-columns: 1fr;
    }
}


.top-sku-section {
    margin-bottom: 14px;
}

.top-sku-section h2 {
    margin-top: 16px;
}


/* Flipkart six summary cards */
body:has(#flipkartChartCards) .flipkart-summary-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
}

body:has(#flipkartChartCards) .flipkart-summary-cards .card {
    padding: 10px;
}

body:has(#flipkartChartCards) .flipkart-summary-cards .card h3 {
    font-size: 13px;
}

body:has(#flipkartChartCards) .flipkart-summary-cards .card p {
    font-size: 22px;
}

@media (max-width: 1300px) {
    body:has(#flipkartChartCards) .flipkart-summary-cards {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 700px) {
    body:has(#flipkartChartCards) .flipkart-summary-cards {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}


/* White mail-style background for Flipkart Dashboard only */
body:has(#flipkartChartCards) {
    background: #ffffff !important;
}

body:has(#flipkartChartCards) main {
    background: #ffffff !important;
}

body:has(#flipkartChartCards) .content,
body:has(#flipkartChartCards) .main-content {
    background: #ffffff !important;
}

body:has(#flipkartChartCards) .chart-control-bar,
body:has(#flipkartChartCards) .chart-card,
body:has(#flipkartChartCards) .card,
body:has(#flipkartChartCards) .toolbar,
body:has(#flipkartChartCards) .table-scroll-wrap {
    background: #ffffff !important;
    box-shadow: none !important;
    border: 1px solid #d1d5db;
}

body:has(#flipkartChartCards) .mail-style-table {
    background: #ffffff !important;
    border-collapse: collapse !important;
    box-shadow: none !important;
}

body:has(#flipkartChartCards) .mail-style-table th {
    background: #eeeeee !important;
    color: #111827 !important;
    border: 1px solid #999999 !important;
}

body:has(#flipkartChartCards) .mail-style-table td {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #b5b5b5 !important;
}

body:has(#flipkartChartCards) .mail-style-table .total-row td,
body:has(#flipkartChartCards) .total-row td {
    background: #fff2cc !important;
    color: #111827 !important;
    font-weight: 700 !important;
}

body:has(#flipkartChartCards) .low-price-cell {
    background: #fecaca !important;
}

body:has(#flipkartChartCards) .diff-cell {
    background: #fee2e2 !important;
    color: #991b1b !important;
}


/* Restore Flipkart value highlight colors after white background patch */
body:has(#flipkartChartCards) .mail-style-table td.low-price-cell,
body:has(#flipkartChartCards) .low-price-cell {
    background: #fecaca !important;
    color: #991b1b !important;
    font-weight: 700 !important;
}

body:has(#flipkartChartCards) .mail-style-table td.diff-cell,
body:has(#flipkartChartCards) .diff-cell {
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 700 !important;
}

body:has(#flipkartChartCards) .mail-style-table .total-row td,
body:has(#flipkartChartCards) .total-row td {
    background: #fff2cc !important;
    color: #111827 !important;
    font-weight: 700 !important;
}

body:has(#flipkartChartCards) .chart-card-title span {
    color: #2563eb !important;
}

body:has(#flipkartChartCards) .card p {
    color: #2563eb !important;
    font-weight: 700 !important;
}

/* Optional: negative difference stronger */
body:has(#flipkartChartCards) td.diff-cell {
    border: 1px solid #ef4444 !important;
}



.inline-map-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-map-form select {
    min-width: 260px;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.sku-map-table td,
.sku-map-table th {
    white-space: nowrap;
}
