/** * Copyright since 2025 Mifos Initiative * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // ── Variables ────────────────────────────────────────────────────────────── $brand: #0f4f3c; $brand-light: #e6f4f0; $primary: #4a6cf7; $success: #16a34a; $success-bg: #f0fdf4; $danger: #dc2626; $danger-bg: #fef2f2; $warning: #d97706; $warning-bg: #fffbeb; $text-dark: #0f172a; $text-mid: #475569; $text-soft: #94a3b8; $border: #e2e8f0; $bg-page: #f1f5f9; $bg-white: #fff; $radius: 12px; $shadow-sm: 0 1px 4px rgb(0 0 0 / 6%); $shadow-md: 0 4px 16px rgb(0 0 0 / 9%); :host { display: block; } // ── Page shell ───────────────────────────────────────────────────────────── .dri { display: flex; flex-direction: column; min-height: 100vh; background: $bg-page; /* Opened as a popup rather than a full page — sizes to its own content (capped so a long entries table still scrolls inside the dialog) instead of stretching to the viewport. */ &--dialog { min-height: 0; max-height: 85vh; overflow-y: auto; width: min(760px, 92vw); border-radius: 10px; } } // ── Nav bar ──────────────────────────────────────────────────────────────── .cashier-nav { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: $bg-white; border-bottom: 1px solid $border; box-shadow: $shadow-sm; &__esc-hint { margin-left: auto; font-size: 12px; color: $text-soft; cursor: pointer; padding: 6px 12px; border-radius: 6px; transition: all 0.15s; font-weight: 500; &:hover { background: $bg-page; color: $text-mid; } } } .dri-header-title { font-size: 14px; font-weight: 700; color: $text-mid; } // ── Loading / empty ──────────────────────────────────────────────────────── .dri-loading { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 80px 24px; font-size: 15px; color: $text-soft; &__icon { font-size: 32px; width: 32px; height: 32px; color: $text-soft; } } // ── Body ─────────────────────────────────────────────────────────────────── .dri-body { padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 14px; max-width: 920px; margin: 0 auto; width: 100%; } // ── Cards ────────────────────────────────────────────────────────────────── .dri-card { background: $bg-white; border-radius: $radius; border: 1px solid $border; box-shadow: $shadow-sm; overflow: hidden; transition: box-shadow 0.15s; &:hover { box-shadow: $shadow-md; } &--header { border-left: 4px solid $brand; box-shadow: $shadow-md; } &--approved { border-left: 4px solid $success; } &--rejected { border-left: 4px solid $danger; } &--failed { border-left: 4px solid $danger; background: $danger-bg; } &--processing { border-left: 4px solid $warning; background: $warning-bg; } } // ── Header card ──────────────────────────────────────────────────────────── .dri-card-header { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; &__left { display: flex; align-items: center; gap: 12px; } &__meta { display: flex; flex-wrap: wrap; gap: 14px; color: $text-mid; padding-top: 4px; border-top: 1px solid $border; } } .dri-voucher { font-family: 'Courier New', monospace; font-size: 22px; font-weight: 700; color: $brand; letter-spacing: 0.06em; background: $brand-light; padding: 4px 14px; border-radius: 8px; } .dri-status { display: inline-flex; align-items: center; padding: 4px 14px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; &--pending { background: $warning-bg; color: $warning; border: 1px solid #fde68a; } &--approved { background: $success-bg; color: $success; border: 1px solid #bbf7d0; } &--rejected { background: $danger-bg; color: $danger; border: 1px solid #fecaca; } &--processing { background: $warning-bg; color: $warning; border: 1px solid #fde68a; } &--failed { background: $danger-bg; color: $danger; border: 1px solid #fecaca; } } .dri-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: $text-mid; font-weight: 500; mat-icon { font-size: 15px; width: 15px; height: 15px; color: $text-soft; } } // ── Section title ────────────────────────────────────────────────────────── .dri-section-title { display: flex; align-items: center; gap: 9px; padding: 13px 22px; font-size: 11px; font-weight: 800; color: $text-mid; text-transform: uppercase; letter-spacing: 0.07em; border-bottom: 1px solid $border; background: linear-gradient(90deg, #f8fafc 0%, $bg-white 100%); mat-icon { font-size: 16px; width: 16px; height: 16px; color: $brand; } } // ── Detail grid ──────────────────────────────────────────────────────────── .dri-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 18px 22px; gap: 16px 28px; } .dri-detail-item { display: flex; flex-direction: column; gap: 4px; &--full { grid-column: 1 / -1; } } .dri-detail-label { font-size: 10.5px; font-weight: 700; color: $text-soft; text-transform: uppercase; letter-spacing: 0.06em; } .dri-detail-value { font-size: 14.5px; color: $text-dark; font-weight: 500; line-height: 1.3; } .dri-amount { font-weight: 800; font-size: 22px; color: $danger; letter-spacing: -0.3px; } // ── Entries table ────────────────────────────────────────────────────────── .dri-cr-table { width: 100%; border-collapse: collapse; font-size: 13.5px; th, td { padding: 11px 18px; text-align: left; border-bottom: 1px solid #f1f5f9; } th { font-size: 10.5px; font-weight: 800; color: $text-soft; text-transform: uppercase; letter-spacing: 0.07em; background: #f8fafc; } tbody tr:hover { background: #fafbff; } tbody tr:last-of-type td { border-bottom: none; } .num { text-align: right; } } .dri-cr-idx { width: 36px; color: $text-soft; font-size: 12px; font-weight: 600; } .dri-type-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; background: #eff6ff; border: 1px solid #bfdbfe; font-size: 10.5px; font-weight: 700; color: #1d4ed8; text-transform: uppercase; letter-spacing: 0.04em; } .dri-cr-amount { font-weight: 700; color: $success; font-size: 14px; } .dri-cr-total-row { background: $success-bg; td { border-top: 2px solid #bbf7d0; padding: 12px 18px; } } .dri-cr-total-label { font-weight: 700; color: $success; text-align: right; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; } .dri-cr-total-amount { font-weight: 800; color: $success; font-size: 16px; } // ── Status texts ─────────────────────────────────────────────────────────── .dri-processing-text { padding: 10px 22px 16px; margin: 0; font-size: 13.5px; color: $warning; font-weight: 500; } .dri-rejection-text { padding: 14px 22px; margin: 0; font-size: 13.5px; color: $danger; font-style: italic; font-weight: 500; } .dri-txn-refs { padding: 14px 22px; margin: 0; font-size: 13px; color: $success; font-weight: 600; font-family: 'Courier New', monospace; background: $success-bg; border-radius: 0 0 $radius $radius; } // ── Action buttons ───────────────────────────────────────────────────────── .dri-actions { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0 8px; } .dri-btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; border: none; transition: all 0.15s; padding: 11px 24px; letter-spacing: 0.01em; mat-icon { font-size: 18px; width: 18px; height: 18px; } &:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; } &--approve { background: linear-gradient(135deg, $brand 0%, #1a7a5e 100%); color: #fff; box-shadow: 0 4px 14px rgb(15 79 60 / 35%); &:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(15 79 60 / 45%); } } &--reject { background: $danger-bg; color: $danger; border: 1.5px solid #fca5a5; &:hover:not(:disabled) { background: #fee2e2; } } &--ghost { background: #f1f5f9; color: $text-mid; border: 1px solid $border; &:hover:not(:disabled) { background: #e2e8f0; color: $text-dark; } } } // ── Reject form ──────────────────────────────────────────────────────────── .dri-reject-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 520px; background: $danger-bg; border: 1.5px solid #fca5a5; border-radius: $radius; padding: 18px 20px; } .dri-reject-label { font-size: 12px; font-weight: 800; color: $danger; text-transform: uppercase; letter-spacing: 0.06em; } .dri-reject-textarea { width: 100%; padding: 10px 12px; border: 1.5px solid #fca5a5; border-radius: 8px; font-family: inherit; font-size: 13.5px; resize: vertical; color: $text-dark; outline: none; background: $bg-white; box-sizing: border-box; transition: border-color 0.15s; &:focus { border-color: $danger; box-shadow: 0 0 0 3px rgb(220 38 38 / 10%); } } .dri-reject-actions { display: flex; gap: 8px; } // ── Mono ─────────────────────────────────────────────────────────────────── .cell-mono { font-family: 'Courier New', monospace; letter-spacing: 0.02em; }