/* Muthugala Enterprises ERP — custom admin theme
   Dark navy sidebar + orange accent, light content area, card-based dashboard. */

:root {
    --mte-navy-900: #0f1b33;
    --mte-navy-800: #16213e;
    --mte-navy-700: #1c2b4f;
    --mte-navy-600: #253a63;
    --mte-orange: #f5a623;
    --mte-orange-dark: #e0900f;
    --mte-content-bg: #f3f4f6;
}

/* ---------- Content area background ---------- */
.fi-body {
    background-color: var(--mte-content-bg);
}

.dark .fi-body {
    background-color: #0b1120;
}

/* ---------- Sidebar ---------- */
.fi-sidebar {
    background: linear-gradient(180deg, var(--mte-navy-800) 0%, var(--mte-navy-900) 100%) !important;
    border-inline-end: none !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.fi-sidebar-header {
    background: transparent !important;
    border-inline-end: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fi-sidebar-header .fi-logo {
    color: #fff;
    font-weight: 700;
}

.fi-sidebar-nav {
    background: transparent !important;
    padding-top: 0.5rem;
}

.fi-sidebar-group-label {
    color: rgba(255, 255, 255, 0.68) !important;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.fi-sidebar-group-collapse-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

.fi-sidebar-item-btn {
    color: rgba(255, 255, 255, 0.94) !important;
    border-radius: 0.65rem !important;
}

.fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.82) !important;
}

.fi-sidebar-item-label {
    color: inherit !important;
}

.fi-sidebar-item-btn:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}

.fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background: linear-gradient(90deg, var(--mte-orange) 0%, var(--mte-orange-dark) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(245, 166, 35, 0.35);
}

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

.fi-sidebar-group-items {
    border-inline-start: none !important;
}

/* Collapse/close icon buttons in sidebar */
.fi-sidebar-close-btn,
.fi-sidebar-header .fi-icon-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ---------- Sidebar profile card (injected via render hook) ---------- */
.mte-sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.75rem 1rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

.mte-sidebar-profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--mte-orange) 0%, var(--mte-orange-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}

.mte-sidebar-profile-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.mte-sidebar-profile-email {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
}

/* ---------- Topbar ---------- */
.fi-topbar {
    background-color: rgba(255, 255, 255, 0.85) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .fi-topbar {
    background-color: rgba(17, 24, 39, 0.85) !important;
}

/* ---------- Cards / sections everywhere ---------- */
.fi-section {
    border-radius: 1.1rem !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.fi-wi-stats-overview-stat {
    border-radius: 1.1rem !important;
}

/* ---------- Custom dashboard cards ---------- */
.mte-card {
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 1.25rem 1.4rem;
}

.dark .mte-card {
    background: #1e293b;
}

.mte-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mte-stat-card-dark {
    background: linear-gradient(135deg, var(--mte-navy-800) 0%, var(--mte-navy-900) 100%);
    color: #fff;
}

.mte-stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mte-stat-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
}

.mte-stat-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mte-stat-card-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
}

.mte-badge-orange { background: rgba(245, 166, 35, 0.15); color: var(--mte-orange-dark); }
.mte-badge-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.mte-badge-green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.mte-badge-red { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.mte-check-now-btn {
    background: linear-gradient(90deg, var(--mte-orange) 0%, var(--mte-orange-dark) 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 3px 8px rgba(245, 166, 35, 0.35);
    text-decoration: none;
    white-space: nowrap;
}

.mte-check-now-btn:hover {
    filter: brightness(1.05);
}

.mte-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 0.85rem;
}

.dark .mte-list-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.mte-list-row:last-child {
    border-bottom: none;
}

/* ---------- Dashboard quick actions ---------- */
.mte-quick-actions-grid {
    display: grid;
    gap: 1.25rem;
}

@media (max-width: 760px) {
    .mte-quick-actions-grid { grid-template-columns: 1fr !important; }
}

.mte-quick-action {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.4rem;
    border-radius: 1.1rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

.mte-quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.28);
}

.mte-quick-action-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.mte-quick-action-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.mte-quick-action-navy {
    background: linear-gradient(135deg, var(--mte-navy-700) 0%, var(--mte-navy-900) 100%);
}

.mte-quick-action-orange {
    background: linear-gradient(135deg, var(--mte-orange) 0%, var(--mte-orange-dark) 100%);
}

.mte-quick-action-special {
    background: linear-gradient(135deg, var(--mte-navy-900) 0%, var(--mte-orange-dark) 100%);
}

/* ---------- Dashboard cheque due alert ---------- */
.mte-cheque-alert {
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.04);
}

.dark .mte-cheque-alert {
    background: rgba(220, 38, 38, 0.08);
}

.mte-cheque-alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* ---------- Sold vehicle rows (Vehicles table) ---------- */
.mte-sold-row > td {
    background-color: rgba(34, 197, 94, 0.12);
}

.dark .mte-sold-row > td {
    background-color: rgba(34, 197, 94, 0.16);
}

/* ---------- Login page: two-panel layout ---------- */
.fi-simple-layout {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(245, 166, 35, 0.08), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(28, 43, 79, 0.12), transparent 55%),
        var(--mte-content-bg) !important;
    display: flex;
    align-items: center;
}

.fi-simple-main-ctn {
    width: 100%;
}

.fi-simple-main {
    max-width: 62rem !important;
    padding: 0 !important;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 70px -30px rgba(15, 27, 51, 0.35);
}

.fi-simple-page {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    grid-template-rows: 1fr;
}

@media (max-width: 760px) {
    .fi-simple-page { grid-template-columns: 1fr; }
    .mte-auth-side { display: none; }
}

/* Explicit placement, not auto-flow - Filament renders an (empty, for this page) actions-modal
   wrapper between the form and our injected panel, which would otherwise consume the second
   grid cell via auto-placement and push our content into a new row instead. */
.fi-simple-page-content {
    grid-column: 1;
    grid-row: 1;
    background: linear-gradient(160deg, var(--mte-navy-800) 0%, var(--mte-navy-900) 100%);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fi-simple-header {
    margin-bottom: 1.75rem;
}

.fi-simple-header .fi-logo {
    color: #f5c876;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* The brand logo <img> carries the .fi-logo class directly (it is not wrapped),
   so it must be targeted on its own, not as a descendant. */
img.fi-logo {
    height: 2.75rem !important;
    width: 2.75rem !important;
    max-width: 2.75rem !important;
    object-fit: contain;
    background: #fff;
    border-radius: 0.6rem;
    padding: 0.3rem;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.4);
}

.fi-simple-header-heading {
    color: #eef0f6 !important;
    font-size: 1.9rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
}

.fi-simple-header-subheading {
    color: #b7c0d6 !important;
    font-size: 0.9rem !important;
    margin-top: 0.4rem !important;
}

/* Form labels/links need to read against the dark panel background.
   Filament sets an explicit dark color on the inner label-content span itself,
   which is not inherited from the parent <label>, so it must be targeted directly. */
.fi-simple-page-content .fi-fo-field-label,
.fi-simple-page-content .fi-fo-field-label-content,
.fi-simple-page-content label {
    color: #eef0f6 !important;
    font-weight: 600 !important;
}

.fi-simple-page-content a {
    color: var(--mte-orange) !important;
}

.fi-simple-page-content .fi-btn {
    background: var(--mte-orange) !important;
    border-color: var(--mte-orange) !important;
    color: #2a1a00 !important;
    font-weight: 700 !important;
}

.fi-simple-page-content .fi-btn:hover {
    background: var(--mte-orange-dark) !important;
}

/* Injected right-side panel (see AdminPanelProvider's SIMPLE_PAGE_END render hook) */
.mte-auth-side {
    grid-column: 2;
    grid-row: 1;
    background: #ffffff;
    padding: 3rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mte-auth-side-logo {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 24px -10px rgba(22, 33, 62, 0.35);
    margin-bottom: 16px;
}

.mte-auth-side-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--mte-navy-900);
}

.mte-auth-side-subname {
    font-size: 12px;
    font-weight: 600;
    color: var(--mte-orange-dark);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.mte-auth-side-desc {
    font-size: 13px;
    color: #5b6478;
    line-height: 1.6;
    max-width: 26ch;
    margin: 6px 0 22px;
}

.mte-auth-side-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--mte-content-bg);
    border: 1px solid rgba(22, 33, 62, 0.08);
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 12.5px;
    color: var(--mte-navy-900);
}

.mte-auth-side-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.mte-auth-side-row svg {
    width: 13px;
    height: 13px;
    flex: none;
    color: var(--mte-orange-dark);
}

.dark .mte-auth-side {
    background: #0b1220;
}

.dark .mte-auth-side-name {
    color: #eef0f6;
}

.dark .mte-auth-side-subname {
    color: var(--mte-orange);
}

.dark .mte-auth-side-desc {
    color: #a3adc2;
}

.dark .mte-auth-side-contact {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #eef0f6;
}
