/* Kimoconcept ERP theme for Filament */
:root {
    --kimo-primary: #1B3A5F;
    --kimo-accent: #C4A35A;
    --kimo-gray: #c0c0c0;
    --kimo-gray-dark: #a0a0a0;
    --kimo-face: #eef2f6;
    --kimo-border: #404040;
    --kimo-inset: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
    --kimo-outset: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040, 1px 1px 0 #000;
    /* legacy aliases used below */
    --apps-face: var(--kimo-face);
    --apps-inset: var(--kimo-inset);
    --apps-outset: var(--kimo-outset);
}

html, body, .fi-body, .fi-html {
    font-family: Tahoma, "MS Sans Serif", "Segoe UI", sans-serif !important;
    background: var(--apps-face) !important;
}

.fi-body {
    background: var(--apps-face) !important;
}

.fi-sidebar {
    background: #ece9d8 !important;
    border-right: 1px solid #808080 !important;
    box-shadow: 2px 0 4px rgba(0,0,0,.12);
}

.fi-sidebar-header {
    background: #1B3A5F !important;
    color: #fff !important;
}

.fi-sidebar-header .fi-logo,
.fi-sidebar-header * {
    color: #fff !important;
}

.fi-topbar {
    background: linear-gradient(#fff, #d4d0c8) !important;
    border-bottom: 1px solid #808080 !important;
}

.fi-main, .fi-main-ctn {
    background: var(--apps-face) !important;
}

.fi-page-header-heading,
.fi-header-heading {
    font-family: Tahoma, sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1B3A5F !important;
}

/* Sections / cards */
.fi-section, .fi-ta, .fi-wi, .fi-fo-component-ctn {
    border-radius: 0 !important;
}

.fi-section {
    background: #ece9d8 !important;
    border: 1px solid #808080 !important;
    box-shadow: var(--apps-outset);
}

.fi-section-header {
    background: #1B3A5F !important;
    color: #fff !important;
    border-radius: 0 !important;
}

.fi-section-header-heading {
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.fi-section-content {
    background: #ece9d8 !important;
}

/* Labels */
.fi-fo-field-wrp-label span,
.fi-fo-field-wrp-label {
    color: #1B3A5F !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

/* Inputs — white, sharp, inset */
.fi-input,
.fi-select input,
.fi-select-input,
input.fi-input,
textarea.fi-input,
.fi-fo-text-input input,
.fi-fo-textarea textarea,
.fi-fo-date-time-picker-display input,
select,
.choices__inner,
.fi-input-wrp {
    border-radius: 0 !important;
}

.fi-input-wrp {
    background: #fff !important;
    box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff !important;
    border: 1px solid #000 !important;
}

.fi-input-wrp input,
.fi-input-wrp textarea,
.fi-input-wrp select {
    background: #fff !important;
    color: #000 !important;
    font-size: 12px !important;
}

.fi-fo-select .fi-select-wrp,
.fi-fo-select .choices {
    border-radius: 0 !important;
}

.fi-select-wrp,
.choices__inner {
    background: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: inset 1px 1px 0 #808080 !important;
    min-height: 28px !important;
}

.fi-input-wrp .fi-icon,
.fi-select-wrp .fi-icon,
.fi-fo-select .fi-input-wrp button,
.fi-fo-select .fi-dropdown-trigger {
    background: linear-gradient(#fff, #c0c0c0) !important;
    border-left: 1px solid #404040 !important;
    border-radius: 0 !important;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080 !important;
}

/* Classic combo arrow */
.fi-select-wrp:after,
.fi-fo-select .fi-input-wrp::after {
    content: "";
}

.fi-btn, button.fi-btn, a.fi-btn {
    border-radius: 0 !important;
    font-family: Tahoma, sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border: 1px solid #404040 !important;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080 !important;
    background: linear-gradient(#fff, #d4d0c8) !important;
    color: #000 !important;
}

.fi-btn-color-primary,
.fi-btn.fi-color-primary {
    background: linear-gradient(#fff, #d4d0c8) !important;
    color: #000 !important;
}

.fi-btn:active {
    box-shadow: inset 1px 1px 0 #808080 !important;
}

/* Tables */
.fi-ta-table {
    font-size: 12px !important;
    border: 1px solid #000 !important;
}

.fi-ta-header-cell {
    background: #d4d0c8 !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: 1px solid #808080 !important;
}

.fi-ta-cell {
    border: 1px solid #c0c0c0 !important;
    background: #fff !important;
}

.fi-ta-row:nth-child(even) .fi-ta-cell {
    background: #f3f3f3 !important;
}

/* Table pagination — show record range + total prominently */
.fi-ta-pagination .fi-pagination {
    row-gap: 8px !important;
}

.fi-ta-pagination .fi-pagination-overview {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1B3A5F !important;
    background: #ece9d8 !important;
    border: 1px solid #808080 !important;
    font-family: Tahoma, sans-serif !important;
}

.fi-ta-pagination .fi-pagination-records-per-page-select {
    grid-column: 2 !important;
}

.fi-ta-pagination .fi-pagination-items {
    grid-column: 3 !important;
}

/* Tabs */
.fi-tabs, .fi-tabs-item {
    border-radius: 0 !important;
}

.fi-tabs-item {
    background: #d4d0c8 !important;
    border: 1px solid #808080 !important;
    color: #000 !important;
}

.fi-tabs-item.fi-active,
.fi-tabs-item[aria-selected="true"] {
    background: #ece9d8 !important;
    border-bottom-color: #ece9d8 !important;
}

/* Modal */
.fi-modal-window {
    border-radius: 0 !important;
    border: 2px solid #1B3A5F !important;
}

.fi-modal-header {
    background: #1B3A5F !important;
    color: #fff !important;
}

/* Badges stay readable */
.fi-badge {
    border-radius: 0 !important;
}

/* Login */
.fi-simple-layout,
.fi-simple-main {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(196, 163, 90, 0.35) 0%, transparent 50%),
        linear-gradient(160deg, #1B3A5F 0%, #0f2438 100%) !important;
}

.fi-simple-card {
    border-radius: 0 !important;
    border: 1px solid #000 !important;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35) !important;
    background: #ece9d8 !important;
}

/* ===== Home launcher ===== */
.kimo-launcher {
    background:
        radial-gradient(circle at 30% 20%, rgba(196, 163, 90, 0.22), transparent 42%),
        repeating-linear-gradient(0deg, rgba(0,0,0,.04) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #1B3A5F 0%, #132b45 55%, #0f2438 100%);
    border: 2px solid #0a1a2a;
    box-shadow: inset 0 0 40px rgba(0,0,0,.25), 4px 4px 0 rgba(0,0,0,.2);
    padding: 18px 22px 28px;
    min-height: 420px;
}

.kimo-launcher-hero {
    text-align: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

.kimo-launcher-hero h1 {
    margin: 0;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 0 rgba(0,0,0,.35);
}

.kimo-launcher-hero p {
    margin: 6px 0 0;
    color: rgba(255,255,255,.82);
    font-size: 12px;
}

.kimo-launcher-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 18px;
    margin-bottom: 28px;
}

.kimo-field label {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 #000;
}

.kimo-field input,
.kimo-field select {
    height: 26px;
    min-width: 180px;
    background: #fff;
    color: #000;
    border: 1px solid #000;
    border-radius: 0;
    padding: 0 6px;
    font-size: 12px;
    font-family: Tahoma, sans-serif;
    box-shadow: inset 1px 1px 0 #808080;
}

.kimo-field-sm input {
    min-width: 70px;
    width: 70px;
}

.kimo-logoff {
    margin-left: auto;
    display: inline-block;
    padding: 4px 16px;
    background: linear-gradient(#fff, #c0c0c0);
    border: 1px solid #000;
    color: #000 !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.kimo-logoff:hover {
    background: linear-gradient(#fff, #dcdcdc);
}

.kimo-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 180px));
    gap: 28px 36px;
    justify-content: center;
    padding: 10px 0 20px;
}

.kimo-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: #fff !important;
}

.kimo-tile-icon {
    width: 92px;
    height: 92px;
    background: #fff;
    border: 2px solid #111;
    box-shadow: 3px 3px 0 rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.kimo-tile-icon svg {
    width: 78px;
    height: 78px;
}

.kimo-tile:hover .kimo-tile-icon {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 rgba(0,0,0,.4);
}

.kimo-tile-label {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
}

@media (max-width: 800px) {
    .kimo-tiles {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

/* Hide empty dashboard header spacing */
.fi-page:has(.kimo-launcher) .fi-header {
    display: none;
}

.kimo-statusbar {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    background: #ece9d8;
    border-top: 1px solid #808080;
    box-shadow: inset 0 1px 0 #fff;
    padding: 4px 12px;
    font-size: 11px;
    color: #000;
    font-family: Tahoma, sans-serif;
}
.kimo-statusbar span + span {
    border-left: 1px solid #808080;
    padding-left: 18px;
}

.kimo-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff !important;
}

.kimo-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 4px;
    background: var(--kimo-accent);
    color: #1B3A5F;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.kimo-brand-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* MIS Drill Down */
.mis-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.mis-kpi-card {
    background: #fff;
    border: 1px solid #808080;
    box-shadow: var(--apps-inset);
    padding: 8px 12px;
    font-family: Tahoma, sans-serif;
}

.mis-kpi-label {
    display: block;
    font-size: 10px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mis-kpi-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1B3A5F;
    margin-top: 2px;
}

.mis-kpi-delayed .mis-kpi-value {
    color: #b91c1c;
}

.mis-th {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #1B3A5F;
    white-space: nowrap;
    background: #ece9d8;
    border-bottom: 1px solid #808080;
}

.mis-td {
    padding: 6px 10px;
    font-size: 11px;
    vertical-align: middle;
}

.mis-table-wrap {
    border: 1px solid #808080 !important;
    border-radius: 0 !important;
}

.mis-pct-cell {
    min-width: 72px;
}

.mis-pct-clickable {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.mis-pct-clickable:hover .mis-pct-track {
    outline: 1px solid #1B3A5F;
}

.mis-pct-clickable:hover .mis-pct-label {
    color: #1B3A5F;
    font-weight: 700;
}

.mis-pct-track {
    width: 64px;
    height: 6px;
    background: #d4d0c8;
    border: 1px solid #808080;
    margin-bottom: 2px;
}

.mis-pct-fill {
    height: 100%;
}

.mis-pct-label {
    font-size: 10px;
    color: #333;
}

.mis-expand-btn {
    background: #d4d0c8;
    border: 1px solid #808080;
    width: 22px;
    height: 22px;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
}

.mis-expand-btn:hover {
    background: #ece9d8;
}

.mis-drill-stage-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #c0c0c0;
    color: #1B3A5F;
}

.mis-drill-stage-sub {
    color: #555;
    font-size: 12px;
    font-weight: 400;
}

.mis-drill-open-record {
    margin-left: auto;
    font-size: 12px;
}

.mis-drill-section-active {
    background: #fff8e1 !important;
    outline: 1px solid #c4a35a;
}

.mis-stage-pct-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.mis-stage-pct-grid > div {
    border: 1px solid #c0c0c0;
    padding: 4px 6px;
    background: #f5f5f5;
    font-size: 11px;
}

.mis-stage-pct-grid > div span {
    display: block;
    color: #666;
}

.mis-stage-pct-grid > div.active {
    background: #fff8e1;
    border-color: #c4a35a;
}

.mis-detail-grid {
    border-collapse: collapse;
    font-size: 11px;
    background: #fff;
}

.mis-detail-grid th,
.mis-detail-grid td {
    border: 1px solid #808080;
    padding: 3px 6px;
    vertical-align: top;
}

.mis-detail-grid th {
    background: #1B3A5F;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.mis-detail-grid .num {
    text-align: right;
    white-space: nowrap;
}

.mis-detail-total td {
    background: #fff8e1;
}

.mis-detail-row-active td {
    background: #e8f0fe;
}

.mis-po-detail-wrap {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #808080;
}

button.mis-status-badge {
    cursor: pointer;
}

.mis-row-expanded {
    background: #f0f4ff !important;
}

.mis-drill-panel {
    background: #ece9d8;
    border-top: 1px solid #808080;
    border-bottom: 2px solid #1B3A5F;
    padding: 12px 16px;
}

.mis-drill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.mis-drill-section h4 {
    font-size: 11px;
    font-weight: 700;
    color: #1B3A5F;
    margin: 0 0 8px;
    text-transform: uppercase;
    border-bottom: 1px solid #808080;
    padding-bottom: 4px;
}

.mis-drill-section dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    font-size: 11px;
    margin: 0;
}

.mis-drill-section dt {
    color: #555;
    font-weight: 600;
}

.mis-drill-section dd {
    margin: 0;
    color: #000;
}

.mis-drill-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mis-drill-links a {
    font-size: 11px;
    color: #1B3A5F;
    text-decoration: underline;
}

.mis-drill-note {
    font-size: 10px;
    color: #555;
    margin-top: 8px;
}

.mis-status-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    border: 1px solid #808080;
    background: #fff;
}

.mis-status-shipped { background: #dcfce7; color: #166534; }
.mis-status-in_progress { background: #fef3c7; color: #92400e; }
.mis-status-cancelled { background: #fee2e2; color: #991b1b; }

.mis-page-btn {
    min-width: 2rem;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1B3A5F;
    background: #fff;
    border: 1px solid #808080;
    border-radius: 4px;
    cursor: pointer;
}

.mis-page-btn:hover {
    background: #e8e8ff;
}

.mis-page-btn-active {
    background: #1B3A5F;
    color: #fff;
    border-color: #1B3A5F;
}

.mis-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.mis-widget-card {
    background: #fff;
    border: 1px solid #808080;
    padding: 12px;
    text-align: center;
}

.mis-widget-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #1B3A5F;
}

.mis-widget-card .label {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .mis-widget-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Status-like footer */
.fi-footer, .fi-simple-footer {
    font-size: 11px !important;
}
