/* ═══════════════════════════════════════════════════════════
   Sathya Connect — shared mobile shell (MobileTemplate style)
   ═══════════════════════════════════════════════════════════ */

.row > * { margin-top: 1rem; }

body {
    background: #f4f6fa;
    margin: 0;
    font-family: Inter, sans-serif;
}

.page {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    background: var(--tblr-bg-surface, #f4f6fa);
    position: relative;
}

/* ── App header ── */
.app-header {
    background: #206bc4;
    padding: 16px clamp(14px, 3vw, 28px);
    color: #fff;
    border-radius: 0;
}

.app-header .d-flex,
.page-content {
    width: min(100%, 1100px);
    margin: 0 auto;
}

.app-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; color: #fff; }
.app-subtitle { margin-top: 4px; font-size: 13px; opacity: .9; color: #fff; }

/* ── Profile panel ── */
.profile-panel { z-index: 3100; }
.offcanvas.offcanvas-end { top: 0; right: 0; width: 350px; }
.offcanvas-backdrop { z-index: 3090; }

.profile-panel-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 12px;
}

.profile-panel-back { border: 0; background: transparent; color: #1f2937; font-size: 20px; line-height: 1; padding: 6px; cursor: pointer; }
.profile-panel-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--tblr-body-color, #1f2937); }
.profile-panel-user { padding: 8px 8px 20px; border-bottom: 1px solid #e5e7eb; }

.profile-panel-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background-color: #206bc4;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.profile-panel-name { font-size: 16px; font-weight: 700; color: #111827; }
.profile-panel-email { font-size: 13px; color: #6b7280; margin-top: 2px; overflow-wrap: anywhere; }
.profile-panel-list { display: flex; flex-direction: column; }

.profile-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-top: 1px solid #e5e7eb;
    text-decoration: none;
    color: var(--tblr-body-color, #1f2937) !important;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.profile-panel-item i { font-size: 18px; color: #206bc4; width: 20px; text-align: center; }
.profile-panel-item:hover { color: #206bc4 !important; text-decoration: none; }

.profile-panel-signout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-top: 1px solid #e5e7eb;
    text-decoration: none;
    color: #d63939 !important;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.profile-panel-signout i { font-size: 18px; }
.profile-panel-signout:hover { color: #b02a2a !important; text-decoration: none; }

/* ── Bottom nav ── */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(0);
    transition: transform .25s ease;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 14px rgba(15, 23, 42, .08);
    display: flex;
    z-index: 3000;
}

.mobile-bottom-nav.is-hidden { transform: translateY(calc(100% + 8px)); }

.bottom-nav-item {
    flex: 1;
    text-decoration: none;
    border-bottom: 0;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px max(11px, env(safe-area-inset-bottom));
    font-size: 12px;
    font-weight: 600;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus,
.bottom-nav-item:focus-visible {
    text-decoration: none !important;
    border-bottom: 0 !important;
    color: #206bc4;
}

.bottom-nav-item i { font-size: 20px; line-height: 1; }
.bottom-nav-item.active { color: #206bc4; }

@media (max-width: 480px) {
    .page { min-height: 100dvh; }
}

/* ── Page content wrapper ── */
.page-body-content { padding: 20px 14px 92px; }

/* ── Dashboard page container (TaskDashboard.html pattern) ── */
.dashboard-page-content { padding: 20px 10px 92px; }
.dashboard-shell { max-width: 100%; }

/* ── Menu card (home-screen list pattern) ── */
.menu-card {
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
    margin-bottom: 14px;
    transition: .2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.menu-card:hover { transform: translateY(-2px); text-decoration: none; color: inherit; }
.menu-card .card-body { display: flex; align-items: center; padding: 16px; gap: 16px; }

.menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    flex-shrink: 0;
}

.menu-content { flex: 1; min-width: 0; }
.menu-title { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.menu-desc { font-size: 13px; color: #6b7280; line-height: 1.4; }
.menu-arrow { color: #9ca3af; font-size: 20px; }

/* ── KPI / module card (dashboard tiles) ── */
.module-card {
    border: 1px solid #e6edf8;
    border-radius: 4px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .05);
    text-decoration: none;
    color: inherit;
    display: block;
}

.module-card:hover { text-decoration: none; color: inherit; }
.module-card .card-body { padding: 12px; }

.module-icon {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.module-copy { min-width: 0; flex: 1; }
.module-title { margin: 0; font-size: 12px; font-weight: 700; color: #52627a; line-height: 1.2; }
.module-value { margin-top: 4px; font-size: 20px; font-weight: 700; color: #111827; line-height: 1; }
.module-meta { margin-top: 4px; font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-arrow { color: #9ba7ba; font-size: 16px; }

.chart-wrap { padding-top: 8px; padding-bottom: 6px; }
.chart-wrap > div { min-height: 250px; }

/* ── List card (bills / transaction rows) ── */
.list-card {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
    margin-bottom: 12px;
}

.list-card .card-body { padding: 14px; }
.list-card-title { font-size: 14px; font-weight: 700; color: #111827; }
.list-card-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.list-card-amount { font-size: 15px; font-weight: 700; color: #111827; }

/* ── Status badges ── */
.badge-status-paid { background: #2fb34422; color: #1a7431; }
.badge-status-pending { background: #f59f0022; color: #a15c00; }
.badge-status-overdue { background: #d6393922; color: #b02a2a; }

/* ═══════════════════════════════════════════════════════════
   Report / list-with-filters components (MobileTemplate
   AssignedTask.html pattern — searchable-select, custom date
   picker, filter-tabs bar, bottom filter-sheets, order-card)
   ═══════════════════════════════════════════════════════════ */

/* ── Searchable select (reused for any dropdown filter) ── */
.searchable-select { position: relative; }

.searchable-select-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.searchable-select-toggle-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.searchable-select-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 3220;
    max-height: 260px;
    overflow: hidden;
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, #d1d5db);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.searchable-select.open .searchable-select-panel { display: flex; }

/* Flip upward when there isn't enough room below the toggle (e.g. a short bottom sheet) */
.searchable-select.drop-up .searchable-select-panel {
    top: auto;
    bottom: calc(100% + 4px);
}

.searchable-select-search-wrap {
    position: relative;
    flex: 0 0 auto;
    padding: 8px;
    border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
}

.searchable-select-search-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

.searchable-select-search { padding-left: 30px; }
.searchable-select-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1 1 auto; }
.searchable-select-option { padding: 8px 14px; font-size: 14px; cursor: pointer; }

.searchable-select-option:hover,
.searchable-select-option.focused { background-color: var(--bs-tertiary-bg, #f3f4f6); }

.searchable-select-option.active { font-weight: 700; color: #0f5132; background-color: #d1fae5; }
.searchable-select-empty { padding: 10px 14px; font-size: 13px; color: #9ca3af; }

/* ── Custom calendar date picker (replaces the native <input type="date">) ── */
.date-picker { position: relative; }

.date-picker-input {
    padding-right: 36px;
    cursor: pointer;
    background-color: #fff;
}

.date-picker-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    pointer-events: none;
}

.date-picker.open .date-picker-input {
    border-color: #206bc4;
    box-shadow: 0 0 0 .2rem rgba(32, 107, 196, .15);
}

.date-picker-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 3220;
    width: 300px;
    max-width: 90vw;
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, #d1d5db);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
    padding: 14px;
}

.date-picker.open .date-picker-panel { display: block; }

/* Flip upward when there isn't enough room below the input (e.g. a short bottom sheet) */
.date-picker.drop-up .date-picker-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.date-picker-nav {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.date-picker-nav:hover { background-color: var(--bs-tertiary-bg, #f3f4f6); }

.date-picker-monthyear {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    font-size: 17px;
    font-weight: 500;
    color: var(--bs-body-color, #1f2937);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.date-picker-monthyear:hover { background-color: var(--bs-tertiary-bg, #f3f4f6); }

.date-picker-monthyear-caret {
    font-size: 14px;
    color: #9ca3af;
    transition: transform .15s ease;
}

.date-picker.quicknav-open .date-picker-monthyear-caret { transform: rotate(180deg); }

.date-picker-weekdays,
.date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.date-picker-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    padding-bottom: 6px;
}

.date-picker-day {
    border: 0;
    background: transparent;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--bs-body-color, #1f2937);
    cursor: pointer;
    border-radius: 50%;
}

.date-picker-day:hover:not(.is-selected) { background-color: var(--bs-tertiary-bg, #f3f4f6); }
.date-picker-day.is-adjacent { color: #d1d5db; }

.date-picker-day.is-today:not(.is-selected) {
    font-weight: 700;
    color: #206bc4;
}

.date-picker-day.is-selected {
    background-color: #206bc4;
    color: #fff;
    font-weight: 700;
}

.date-picker-quicknav { display: none; }
.date-picker.quicknav-open .date-picker-quicknav { display: block; }

.date-picker.quicknav-open .date-picker-weekdays,
.date-picker.quicknav-open .date-picker-days {
    display: none;
}

.date-picker-quicknav-year {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}

.date-picker-quicknav-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.date-picker-quicknav-month {
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 4px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--bs-body-color, #1f2937);
}

.date-picker-quicknav-month:hover { background-color: var(--bs-tertiary-bg, #f3f4f6); }

.date-picker-quicknav-month.is-active {
    background-color: #206bc4;
    color: #fff;
    font-weight: 700;
}

/* ── Filter tabs bar (pill buttons that open a bottom filter-sheet) ── */
.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #334155;
    border-radius: 4px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.filter-tab:hover { text-decoration: none; color: #1d4f91; }
.filter-tab-sort { gap: 6px; }
.sort-arrow-icon { font-size: 14px; line-height: 1; }
.filter-tab.active { border-color: #206bc4; background: #e9f2ff; color: #1d4f91; }
.filter-tab-clear { border-color: #fecaca; background: #fef2f2; color: #dc2626; }

/* ── Filter sheet overlay (bottom sheet) ── */
.filter-sheet { position: fixed; inset: 0; display: none; z-index: 4000; }
.filter-sheet.open { display: block; }
.filter-sheet-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .35); }

.filter-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 4px 4px 0 0;
    padding: 12px;
    box-shadow: 0 -12px 24px rgba(15, 23, 42, .16);
}

.filter-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.filter-sheet-title { margin: 0; font-size: 15px; font-weight: 700; color: #111827; }
.filter-sheet-close { border: 0; background: transparent; color: #6b7280; font-size: 20px; line-height: 1; cursor: pointer; }
.filter-sheet-body { display: grid; gap: 8px; }
.sort-sheet-body { gap: 10px; }

.sort-option {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #334155;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.sort-option.active { border-color: #206bc4; background: #e9f2ff; color: #1d4f91; }
.date-label { font-size: 12px; font-weight: 700; color: #374151; }
.filter-sheet-footer { margin-top: 12px; }

/* ── Order card (report row with expandable extra fields + status badge) ── */
.order-card .card-body { align-items: flex-start; justify-content: space-between; position: relative; }

.order-meta { margin-top: 6px; display: grid; gap: 2px; font-size: 13px; color: #6b7280; }
.order-kv-row { display: flex; align-items: center; gap: 8px; }
.order-kv-row.order-kv-extra { display: none; }
.order-card.details-open .order-kv-row.order-kv-extra { display: flex; }
.order-kv-label { width: 98px; flex: 0 0 98px; color: #6b7280; font-weight: 700; }
.order-kv-value { color: #4b5563; }

.order-title {
    display: -webkit-box;
    max-width: 30ch;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.order-details-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #64748b;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: 16px;
    right: 16px;
}

.order-card.details-open .order-details-toggle i { transform: rotate(180deg); }

.order-status {
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 4px 8px;
    white-space: nowrap;
    position: absolute;
    right: 12px;
    bottom: 12px;
}

.order-card.has-extra-fields .menu-content { padding-right: 48px; }
.order-card.compact-fields .menu-content { padding-right: 118px; }
.order-card.has-extra-fields .order-status { right: 12px; bottom: 12px; top: auto; }
.order-card.compact-fields .order-status { top: 16px; right: 16px; bottom: auto; }

.order-status.status-progress     { color: #0f5132; background: #d1fae5; border: 1px solid #a7f3d0; }
.order-status.status-awaiting     { color: #92400e; background: #fef3c7; border: 1px solid #fde68a; }
.order-status.status-verification { color: #1e3a8a; background: #dbeafe; border: 1px solid #bfdbfe; }
.order-status.status-default      { color: #374151; background: #f3f4f6; border: 1px solid #e5e7eb; }

/* ── Dark theme overrides for the report/filter components above ── */
html[data-bs-theme="dark"] .order-kv-label { color: #9aa7bd; }
html[data-bs-theme="dark"] .order-kv-value { color: #c9d4e3; }

html[data-bs-theme="dark"] .order-details-toggle {
    background: #1a2336;
    border-color: #2c3e54;
    color: #9aa7bd;
}

html[data-bs-theme="dark"] .filter-tab {
    background: #1a2336;
    border-color: #2c3e54;
    color: #c9d4e3;
}

html[data-bs-theme="dark"] .filter-tab:hover { color: #7ab4e8; }

html[data-bs-theme="dark"] .filter-tab.active {
    border-color: #2a4d78;
    background: #1a2e48;
    color: #7ab4e8;
}

html[data-bs-theme="dark"] .filter-tab-clear {
    border-color: #4a2530;
    background: #2a1418;
    color: #f4a3a3;
}

html[data-bs-theme="dark"] .filter-sheet-panel { background: #151f2e; }
html[data-bs-theme="dark"] .filter-sheet-title { color: #e8edf5; }
html[data-bs-theme="dark"] .filter-sheet-close { color: #9aa7bd; }
html[data-bs-theme="dark"] .date-label { color: #c9d4e3; }

html[data-bs-theme="dark"] .sort-option {
    background: #1a2336;
    border-color: #2c3e54;
    color: #c9d4e3;
}

html[data-bs-theme="dark"] .sort-option.active {
    border-color: #2a4d78;
    background: #1a2e48;
    color: #7ab4e8;
}

/* ── Tabbed forms ── */
.connect-tabs .nav-link { font-size: 13px; font-weight: 600; }

/* ── Auth (login) page ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, #206bc4 0%, #206bc4 220px, #f4f6fa 220px);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.auth-logo { font-size: 22px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: #6b7280; text-align: center; margin-bottom: 20px; }

/* ── Dark theme overrides ── */
html[data-bs-theme="dark"] body { background: #0f1623; }

html[data-bs-theme="dark"] .profile-panel-header,
html[data-bs-theme="dark"] .profile-panel-user,
html[data-bs-theme="dark"] .profile-panel-item,
html[data-bs-theme="dark"] .profile-panel-signout {
    border-color: #253143;
}

html[data-bs-theme="dark"] .profile-panel-back { color: #d7e0ed; }
html[data-bs-theme="dark"] .profile-panel-name { color: #e8edf5; }
html[data-bs-theme="dark"] .profile-panel-email { color: #9aa7bd; }

html[data-bs-theme="dark"] .menu-card,
html[data-bs-theme="dark"] .module-card,
html[data-bs-theme="dark"] .list-card { border-color: #253143; }

html[data-bs-theme="dark"] .menu-title,
html[data-bs-theme="dark"] .module-value,
html[data-bs-theme="dark"] .list-card-title,
html[data-bs-theme="dark"] .list-card-amount { color: #e8edf5; }

html[data-bs-theme="dark"] .menu-desc,
html[data-bs-theme="dark"] .module-title,
html[data-bs-theme="dark"] .list-card-meta { color: #9aa7bd; }

html[data-bs-theme="dark"] .menu-arrow,
html[data-bs-theme="dark"] .module-arrow { color: #6a7a92; }

html[data-bs-theme="dark"] .auth-card { background: #131c2b; border-color: #253143; }
html[data-bs-theme="dark"] .auth-logo { color: #e8edf5; }
