/* Drive Specialty Coffee — brand purple #6E1A76, taken from the logo. */
:root {
    --brand: #6e1a76;
    --brand-deep: #4a0f50;
    --brand-soft: #f6eef7;
    --brand-line: #e7d6ea;
    --page-bg: #faf7fb;
}

.dark {
    --brand-soft: rgba(110, 26, 118, 0.18);
    --brand-line: rgba(231, 214, 234, 0.12);
    --page-bg: #140d15;
}

/* Company name in place of a logo image. */
.company-mark {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    color: var(--brand);
}

.company-mark-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.company-mark-sub {
    margin-top: 0.3rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    opacity: 0.85;
}

.dark .company-mark {
    color: #f1dff3;
}

.fi-simple-layout .company-mark-name {
    font-size: 1.6rem;
}

.fi-simple-layout .company-mark-sub {
    font-size: 0.8rem;
}

body.fi-body {
    background: var(--page-bg);
}

/* Sidebar: soft lavender with a solid purple active item. */
.fi-main-sidebar {
    background: #fff;
    border-inline-end: 1px solid var(--brand-line);
}

.dark .fi-main-sidebar {
    background: #1b111d;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--brand);
    box-shadow: 0 6px 16px -8px rgba(110, 26, 118, 0.7);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn:hover {
    background: var(--brand-soft);
}

.fi-topbar {
    border-bottom: 1px solid var(--brand-line);
    box-shadow: none !important;
}

/* Headings and cards. */
.fi-header-heading {
    color: var(--brand);
    letter-spacing: -0.01em;
}

.dark .fi-header-heading {
    color: #f1dff3;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-radius: 1rem !important;
}

.fi-wi-stats-overview-stat {
    border-inline-start: 4px solid var(--brand);
}

.fi-ta-header-cell {
    background: var(--brand-soft);
}

.fi-ta-group-header {
    background: var(--brand-soft) !important;
}

.fi-ta-group-header * {
    color: var(--brand);
    font-weight: 700;
}

.dark .fi-ta-group-header * {
    color: #f1dff3;
}

/* Login page: deep purple background with the logo on a white card. */
.fi-simple-layout {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.08) 0, transparent 45%),
        linear-gradient(140deg, var(--brand-deep), var(--brand) 60%, #8e3a96);
}

.fi-simple-main {
    border-radius: 1.5rem !important;
    box-shadow: 0 30px 60px -20px rgba(30, 5, 35, 0.55) !important;
}

/* Salary sheet: people on leave get no salary for those days. */
.drive-on-leave > td {
    background: #fff1dc !important;
}

.dark .drive-on-leave > td {
    background: rgba(245, 158, 11, 0.14) !important;
}

/* Weekly orders: the branch form, one compact row per item, also on phones. */
.drive-order-items .fi-fo-field-has-inline-label {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 5.5rem;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--brand-line);
}

.drive-order-items .fi-fo-field-has-inline-label .fi-fo-field-label-col,
.drive-order-items .fi-fo-field-has-inline-label .fi-fo-field-content-col {
    grid-column: auto !important;
    padding: 0 !important;
}

.drive-order-items .fi-input-wrp input {
    padding-block: 0.35rem;
    font-weight: 600;
}

/* Weekly orders: the buyer's list. */
.drive-supply-status {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid var(--brand-line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
    font-size: 0.92rem;
}

.drive-supply-status.is-open {
    background: #fff7e6;
    border-color: #f6d79b;
}

.drive-supply-status.is-closed {
    background: #ecf7f1;
    border-color: #b9e0c9;
}

.drive-supply-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.drive-supply-chip {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f1f4;
    color: #71717a;
}

.drive-supply-chip.is-done {
    background: #dcf2e5;
    color: #1d6b43;
}

.drive-supply-scroll {
    overflow-x: auto;
    border-radius: 0.9rem;
    border: 1px solid var(--brand-line);
    background: #fff;
}

.drive-supply-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.drive-supply-table th {
    background: #35695a;
    color: #fff;
    padding: 0.55rem 0.5rem;
    white-space: nowrap;
    font-weight: 600;
}

.drive-supply-table td {
    padding: 0.45rem 0.5rem;
    text-align: center;
    border-top: 1px solid #e6ece9;
}

.drive-supply-table .is-item {
    text-align: start;
    white-space: nowrap;
    position: sticky;
    inset-inline-start: 0;
}

.drive-supply-table th.is-item {
    background: #35695a;
}

.drive-supply-table td.is-item {
    background: #fff;
}

.drive-supply-table .is-total {
    font-weight: 700;
    background: #e3ece8;
}

.drive-supply-table th.is-total {
    background: #2f5d4e;
}

.drive-supply-unit {
    color: #71717a;
    font-size: 0.8rem;
}

.drive-supply-empty {
    padding: 2rem !important;
    color: #71717a;
}

.drive-supply-heading {
    font-weight: 700;
    font-size: 1rem;
}

.drive-supply-extras {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
}

.drive-supply-extra {
    padding: 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid var(--brand-line);
    background: #fff;
}

.drive-supply-extra-branch {
    font-size: 0.75rem;
    font-weight: 700;
    color: #35695a;
}

.drive-supply-extra-name {
    font-weight: 600;
}

.dark .drive-supply-scroll,
.dark .drive-supply-extra,
.dark .drive-supply-table td.is-item {
    background: #18181b;
}

.dark .drive-supply-table td {
    border-top-color: #27272a;
}

.dark .drive-supply-table .is-total {
    background: #1f2d28;
}

.dark .drive-supply-status.is-open {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.dark .drive-supply-status.is-closed {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Expired products. */
.drive-expiry-month,
.drive-expiry-report {
    display: grid;
    gap: 0.75rem;
}

.drive-supply-table th.is-missing {
    background: #8aa49b;
}

.drive-supply-table tr.is-sum td {
    font-weight: 700;
    background: #f1f5f3;
}

.dark .drive-supply-table tr.is-sum td {
    background: #1f2d28;
}

.drive-supply-chip small {
    font-weight: 500;
    opacity: 0.75;
}

/* Quick actions on the dashboard. */
.drive-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .drive-quick {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.drive-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 6.5rem;
    padding: 1rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid var(--brand-line);
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.3;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.drive-quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -14px rgba(110, 26, 118, 0.6);
    background: var(--brand-soft);
}

.drive-quick-btn svg {
    width: 1.9rem;
    height: 1.9rem;
}

.drive-quick-btn.is-primary {
    background: linear-gradient(140deg, var(--brand), #8e3a96);
    color: #fff;
    border-color: transparent;
}

.dark .drive-quick-btn {
    background: #1f1422;
    color: #f1dff3;
}

.dark .drive-quick-btn.is-primary {
    background: linear-gradient(140deg, var(--brand), #8e3a96);
    color: #fff;
}

.drive-greeting {
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.dark .drive-greeting {
    color: #f1dff3;
}

/* Month-end inventory: the branch count, one compact row per item, also on phones. */
.drive-inv {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 4.5rem;
}

.drive-inv-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
}

.drive-inv-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.drive-inv-tab {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--brand-line);
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.88rem;
}

.drive-inv-tab small {
    font-weight: 500;
    opacity: 0.7;
}

.drive-inv-tab.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.drive-inv-search {
    flex: 1 1 14rem;
    max-width: 22rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.7rem;
    border: 1px solid var(--brand-line);
    background: #fff;
    font-size: 0.9rem;
}

.drive-inv-list {
    border-radius: 1rem;
    border: 1px solid var(--brand-line);
    background: #fff;
    padding: 0.4rem 0.9rem 0.6rem;
}

.drive-inv-hint {
    padding: 0.5rem 0 0.4rem;
    color: #71717a;
    font-size: 0.85rem;
}

.drive-inv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.5rem 5.8rem;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.25rem;
    border-bottom: 1px dashed var(--brand-line);
}

.drive-inv-row:last-child {
    border-bottom: 0;
}

.drive-inv-name {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.5rem;
    align-items: baseline;
    font-size: 0.92rem;
    line-height: 1.3;
}

.drive-inv-code {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: #71717a;
}

.drive-inv-warn {
    display: none;
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a16207;
}

.drive-inv-row.is-other-unit {
    background: #fff7d6;
    border-radius: 0.5rem;
}

.drive-inv-row.is-other-unit .drive-inv-warn {
    display: block;
}

.drive-inv-qty,
.drive-inv-unit {
    width: 100%;
    padding: 0.4rem 0.45rem;
    border-radius: 0.55rem;
    border: 1px solid #d4d4d8;
    background: #fff;
    font-size: 0.95rem;
}

.drive-inv-qty {
    text-align: center;
    font-weight: 700;
}

.drive-inv-qty:focus,
.drive-inv-unit:focus,
.drive-inv-search:focus {
    outline: 2px solid var(--brand);
    outline-offset: 0;
    border-color: transparent;
}

.drive-inv-qty:disabled,
.drive-inv-unit:disabled {
    background: #f4f4f5;
    color: #52525b;
}

.drive-inv-gap {
    height: 0.6rem;
    border-bottom: 2px solid var(--brand-line);
    margin-bottom: 0.2rem;
}

.drive-inv-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 10;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem 0.6rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--brand-line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px -18px rgba(30, 5, 35, 0.55);
}

.drive-inv-bar-note {
    font-size: 0.85rem;
    color: #71717a;
}

.dark .drive-inv-tab,
.dark .drive-inv-search,
.dark .drive-inv-list,
.dark .drive-inv-qty,
.dark .drive-inv-unit {
    background: #18181b;
    border-color: #3f3f46;
    color: #f4f4f5;
}

.dark .drive-inv-tab.is-active {
    background: var(--brand);
    border-color: var(--brand);
}

.dark .drive-inv-row.is-other-unit {
    background: rgba(234, 179, 8, 0.14);
}

.dark .drive-inv-bar {
    background: rgba(24, 24, 27, 0.96);
    border-color: #3f3f46;
}
