/* ═══════════════════════════════════════════════════════════════
   responsive.css — Shared styles for SunHouseWeb pages
   Used across: Cleanogitems, Conversions, and future pages
   ═══════════════════════════════════════════════════════════════ */


/* ── Common page layout ──────────────────────────────────────── */
.form-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.grid-container {
    flex: 0 0 90%;
    overflow-x: auto;
    padding-right: 20px;
    order: 1;
    padding-left: 0;
    margin-left: 0;
    width: 100%;
}

.grid-container.cart-open {
    max-width: 100%;
}

.small-font {
    font-size: 12px;
}

.error-message {
    color: red;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.search-container {
    padding: 8px 0;
}

.notes-container {
    margin-top: 20px;
}

.button-container {
    margin-top: 20px;
}


/* ── Custom select dropdowns ─────────────────────────────────── */
.custom-select {
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    appearance: none;
    background-color: #f9f9f9;
    color: #333;
}

.custom-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-select-no-shade {
    font-size: 14px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    appearance: none;
    background-color: transparent;
    color: #333;
}

.custom-select-no-shade:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}


/* ── Cart container ──────────────────────────────────────────── */
.cart-container {
    flex: 0 0 30%;
    border: 1px solid blue;
    padding: 10px;
    height: fit-content;
    position: relative;
}

.cart-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-container td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ccc;
}

.cart-container th {
    background-color: #f2f2f2;
}

.cart-container tbody tr:hover {
    background-color: #f5f5f5;
}

.cart-notes {
    width: 100%;
}


/* ── Dialog edit form ────────────────────────────────────────── */
.edit-form {
    display: flex;
    flex-direction: column;
}

.form-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.form-row label {
    width: 150px;
    font-weight: bold;
}

.form-row span {
    padding-left: 10px;
}

.form-row input,
.form-row button {
    flex-grow: 1;
}

.addbutton-container {
    position: absolute;
    z-index: 1000;
    top: 100px;
    right: 300px;
}


/* ── Mobile card styles ──────────────────────────────────────── */
.mobile-cards {
    display: none;
}

.item-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.item-card .card-field {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.item-card .card-field:last-of-type {
    border-bottom: none;
}

.item-card .card-label {
    font-weight: 600;
    color: #555;
    flex: 0 0 40%;
}

.item-card .card-value {
    color: #222;
    text-align: right;
    flex: 0 0 58%;
    word-break: break-word;
}

.item-card .card-actions {
    margin-top: 8px;
    text-align: right;
}

.mobile-export-bar {
    display: none;
    padding: 8px 0;
}

/* ── Responsive breakpoints ──────────────────────────────────── */
@media (max-width: 1023px) {
    .desktop-grid {
        display: none !important;
    }
    .mobile-cards {
        display: block;
    }
    .mobile-export-bar {
        display: block;
    }
    /* Hide the Add Item SfDialog on mobile (it renders at body level) */
    .add-item-dialog.e-dialog,
    .add-item-dialog + .e-dlg-overlay,
    .e-dlg-overlay + .add-item-dialog {
        display: none !important;
    }
    /* Also hide any leftover overlay when the dialog has add-item-dialog class */
    .e-dlg-container.add-item-dialog {
        display: none !important;
    }
    /* Stacked tab buttons on mobile */
    .e-tab .e-tab-header .e-toolbar-items {
        flex-wrap: wrap !important;
    }
    .e-tab .e-tab-header .e-toolbar-item {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
}

/* Tablet: 2-column card grid */
@media (min-width: 769px) and (max-width: 1023px) {
    .mobile-cards-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}


/* ── Mobile edit panel ───────────────────────────────────────── */
.mobile-edit-panel {
    padding: 0;
}
.mobile-edit-panel .panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 16px;
}
.mobile-edit-panel .panel-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}
.mobile-edit-panel .panel-header .btn-outline-secondary {
    color: white;
    border-color: rgba(255,255,255,0.5);
}
.mobile-edit-panel .panel-header .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.mobile-edit-panel .action-bar {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}


/* ── Info card (read-only fields) ────────────────────────────── */
.edit-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.edit-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}
.edit-info-card .info-row:last-child {
    border-bottom: none;
}
.edit-info-card .info-label {
    font-weight: 600;
    color: #6c757d;
}
.edit-info-card .info-value {
    color: #212529;
    font-weight: 500;
}


/* ── Editable form card ──────────────────────────────────────── */
.edit-form-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.edit-form-card .section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 14px;
}


/* ── Mobile form rows ────────────────────────────────────────── */
.mobile-form-row {
    margin-bottom: 14px;
}
.mobile-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #495057;
}
.mobile-form-row input[type="text"],
.mobile-form-row input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    background: #f8f9fa;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mobile-form-row input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
    background: white;
}


/* ── Toggle switch (iOS-style) ───────────────────────────────── */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-switch .switch {
    position: relative;
    width: 48px;
    height: 26px;
}
.toggle-switch .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
.toggle-switch input:checked + .slider {
    background-color: #28a745;
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(22px);
}
.toggle-label {
    font-size: 14px;
    color: #495057;
}


/* ── Mobile select card (for item pickers) ───────────────────── */
.mobile-select-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: border-color 0.2s, background 0.2s;
}
.mobile-select-card .card-content {
    flex: 1;
}
.mobile-select-card .card-content .card-field {
    font-size: 13px;
    padding: 2px 0;
}


/* ── Mobile search bar ───────────────────────────────────────── */
.mobile-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.mobile-search-bar input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
}
.mobile-search-bar input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
    background: white;
}


/* ── Checklist items (for order guide lists etc.) ─────────────── */
.og-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.og-check-item:last-child {
    border-bottom: none;
}
.og-check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}
.og-check-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    color: #495057;
}
.og-check-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}


/* ── Sticky action bar ───────────────────────────────────────── */
.sticky-action-bar {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 0;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    z-index: 10;
}
.sticky-action-bar .btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}


/* ── Pill tab styling (Syncfusion SfTab override) ────────────── */
.e-tab .e-tab-header {
    border-bottom: none !important;
    gap: 6px;
}
.e-tab .e-tab-header .e-toolbar-items {
    display: flex !important;
    gap: 6px;
}
.e-tab .e-tab-header .e-toolbar-item {
    margin: 0 !important;
}
.e-tab .e-tab-header .e-tab-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 24px !important;
    border-radius: 24px !important;
    background: #e9ecef !important;
    color: #495057 !important;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    border: none !important;
    box-shadow: none !important;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    cursor: pointer;
}
.e-tab .e-tab-header .e-tab-wrap:hover {
    background: #dee2e6 !important;
    transform: translateY(-1px);
}
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-wrap,
.e-tab .e-tab-header .e-tab-wrap.e-active {
    background: #007bff !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3) !important;
}
.e-tab .e-tab-header .e-indicator {
    display: none !important;
}
.e-tab .e-content {
    margin-top: 12px;
}
.e-tab .e-tab-header .e-tab-wrap .e-tab-text {
    color: inherit !important;
    font-weight: inherit !important;
}


/* ── Detail grid (child/sub grid, e.g. PO detail rows) ──────── */
.detail-grid .e-gridheader {
    background-color: #d1c4e9;
}
.detail-grid .e-rowcell {
    border-color: #673ab7;
    font-size: 0.9em;
    color: #673ab7;
}

/* ── Mobile sub-card (expandable detail inside item-card) ────── */
.sub-order-cards {
    margin-top: 10px;
    border-top: 2px solid #673ab7;
    padding-top: 10px;
}
.sub-order-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.sub-order-card .card-field {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.sub-order-card .card-field:last-of-type {
    border-bottom: none;
}

/* ── Confirmation banner ─────────────────────────────────────── */
.conf-banner {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #155724;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.conf-banner a {
    font-weight: 600;
}


/* ── Status badges (PO detail rows) ──────────────────────────── */
.inactive {
    color: #ffffff;
    background-color: #333333;
    padding: 5px;
    border-radius: 5px;
}
.inactive3 {
    color: red;
    background-color: #ffcccc;
    padding: 5px;
    border-radius: 5px;
}
.faded-out {
    color: #999;
}
.faded-checkbox {
    opacity: 0.5;
}

/* ── Action button row ───────────────────────────────────────── */
.action-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 0;
    align-items: center;
}

/* ── Pagination bar (shared) ─────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 2px solid #ccc;
    background: #f8f9fa;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pagination-bar span {
    font-size: 13px;
    color: #555;
    margin-right: 10px;
}

/* ── Mobile dialog override ──────────────────────────────────── */
@media (max-width: 768px) {
    .e-dialog {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .e-dialog .e-dlg-content {
        overflow-y: auto !important;
        max-height: calc(100vh - 110px) !important;
        -webkit-overflow-scrolling: touch;
    }
    .e-dlg-overlay {
        position: fixed !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD KPI CARDS
   ═══════════════════════════════════════════════════════════════ */
.dashboard-container {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.dashboard-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.kpi-card {
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.kpi-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.kpi-value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
}
.kpi-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card color themes */
.kpi-blue   { background: linear-gradient(135deg, #4a90d9, #357abd); }
.kpi-green  { background: linear-gradient(135deg, #43b581, #2d9b6a); }
.kpi-purple { background: linear-gradient(135deg, #7c5cbf, #6347a5); }
.kpi-orange { background: linear-gradient(135deg, #e67e22, #d35400); }

/* Tablet: 2 cols */
@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* Mobile: 1 col */
@media (max-width: 500px) {
    .dashboard-container { padding: 16px; }
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .kpi-card { padding: 20px 16px; }
    .kpi-value { font-size: 34px; }
}


/* ═══════════════════════════════════════════════════════════════
   Order Guide — custom selects & card editing
   ═══════════════════════════════════════════════════════════════ */
.custom-select {
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    appearance: none;
    background-color: #f9f9f9;
    color: #333;
    width: 100%;
}
.custom-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-select-no-shade {
    font-size: 14px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    appearance: none;
    background-color: transparent;
    color: #333;
}
.custom-select-no-shade:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

/* OG card inline-edit fields */
.og-card-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
}

.og-card-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
}


/* ── Item card (Add Item mobile view) ──────────────────────── */
.item-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color 0.2s, background 0.2s;
}

/* ── Sticky bottom action bar ──────────────────────────────── */
.sticky-action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}


/* ── Read-only data table (non-Syncfusion) ───────────────────── */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.detail-table thead th {
    background: #f1f3f5;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 14px;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
    white-space: nowrap;
}
.detail-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}
.detail-table tbody tr:hover {
    background: #f8f9fa;
}
.detail-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.detail-table tbody tr:nth-child(even):hover {
    background: #f1f3f5;
}
.detail-table .text-right {
    text-align: right;
}
.detail-table .text-center {
    text-align: center;
}
.detail-table .item-desc {
    font-weight: 500;
}
.detail-table .item-sub {
    font-size: 12px;
    color: #888;
}
.detail-table .row-inactive td {
    color: #fff;
    background-color: #333;
}

/* ── Customer search dropdown ────────────────────────────────── */
.customer-dropdown-item:hover {
    background: #e7f1ff !important;
}

