/* ==========================================================================
   BRAND HEADER — dark emerald (Smart Aviation identity)
   ========================================================================== */

/* Topbar */
.fi-topbar,
.fi-topbar-ctn {
    background: linear-gradient(to right, #065f46, #064e3b) !important;
    border-bottom: 1px solid #047857 !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2) !important;
}
/* Sidebar header */
.fi-sidebar-header,
.fi-sidebar-header-ctn {
    background: linear-gradient(to right, #065f46, #064e3b) !important;
    border-bottom: 1px solid #047857 !important;
}
/* Icons/buttons in topbar — white for dark header */
.fi-topbar svg {
    stroke: rgba(255, 255, 255, 0.85) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
/* Explicit transparent so no stray circular backgrounds appear */
.fi-topbar button,
.fi-topbar .fi-icon-btn {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
.fi-topbar button:hover,
.fi-topbar .fi-icon-btn:hover,
.fi-topbar a:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
}

/* ── Brand component (logo + text) ── */
.fi-logo {
    height: auto !important;
}
.aoc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.aoc-brand-logo {
    background: #ffffff;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.aoc-brand-logo:hover {
    background: #f3f4f6;
}
.aoc-brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.aoc-brand-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}
.aoc-brand-line1 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0em;
}
.aoc-brand-line2 {
    font-size: 16px;
    font-weight: 700;
    color: #34d399;
    letter-spacing: 0em;
}

/* ── User menu button ── */
.fi-topbar .fi-user-menu-trigger {
    background-color: rgba(5, 150, 105, 0.5) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    color: rgba(255, 255, 255, 0.9) !important;
}
.fi-topbar .fi-user-menu-trigger:hover {
    background-color: #059669 !important;
}
.fi-topbar .fi-user-avatar,
.fi-topbar .fi-avatar.fi-user-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
    object-fit: cover !important;
}
.fi-topbar .fi-user-menu-trigger-text {
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}
.fi-topbar .fi-user-menu-trigger svg {
    width: 16px !important;
    height: 16px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    stroke: rgba(255, 255, 255, 0.7) !important;
}

/* ==========================================================================
   DASHBOARD STAT CARDS (KPI tiles) — shared across every dashboard tab
   ========================================================================== */
.aoc-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .aoc-stat-grid { grid-template-columns: repeat(5, 1fr); }
}
.aoc-stat-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) {
    .aoc-stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
}
.aoc-stat-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .aoc-stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.aoc-stat-grid-6 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .aoc-stat-grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .aoc-stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
}

.aoc-stat-card {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aoc-stat-card:hover {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.aoc-stat-card-clickable {
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.aoc-stat-card-clickable:hover {
    border-color: #a7f3d0;
}
.aoc-stat-card-clickable:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}
.aoc-stat-card-active {
    border-top-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.35), 0 2px 6px rgba(15, 23, 42, 0.08);
}
.aoc-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.aoc-stat-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aoc-stat-icon svg {
    width: 16px;
    height: 16px;
}
.aoc-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.aoc-stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #111827;
}

/* Icon tint — flat, no gradients: same red/amber/green vocabulary already
   used by Aircraft::STATUS_COLORS and DueStatusService::color() elsewhere
   in the app, so these tiles read as the same system, not a new palette. */
.aoc-stat-icon-neutral { background-color: #f3f4f6; color: #6b7280; }
.aoc-stat-icon-success { background-color: #d1fae5; color: #059669; }
.aoc-stat-icon-warning { background-color: #fef3c7; color: #ca8a04; }
.aoc-stat-icon-urgent  { background-color: #ffedd5; color: #ea580c; }
.aoc-stat-icon-danger  { background-color: #fee2e2; color: #dc2626; }

.aoc-stat-card-neutral { border-top-color: #cbd5e1; }
.aoc-stat-card-success { border-top-color: #059669; }
.aoc-stat-card-warning { border-top-color: #ca8a04; }
.aoc-stat-card-urgent  { border-top-color: #ea580c; }
.aoc-stat-card-danger  { border-top-color: #dc2626; }

/* Only the truly critical tier gets a colored number — everything else
   stays neutral so the eye is drawn to what actually needs action. */
.aoc-stat-value-danger { color: #dc2626; }

/* Per-table client-side search box (dashboard tabs). Same compact filter
   input pattern as smart-finance-rebuild's `.sf-report-select` family —
   plain `type="text"` on purpose, never `type="search"`, which pulls in
   browser/OS-native search-field chrome (oversized pill shape, a native
   clear button) that fights the rest of this design system. */
.aoc-table-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 16rem;
}

.aoc-table-search-icon {
    position: absolute;
    top: 50%;
    left: 11px;
    display: flex;
    color: #9ca3af;
    pointer-events: none;
    transform: translateY(-50%);
}

.aoc-table-search-input {
    display: block;
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    font-size: 14px;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.aoc-table-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Dashboard presentation mode. The fullscreen toggle requests fullscreen
   on #aoc-dashboard-root (the page content, not html/body), which already
   excludes Filament's sidebar/topbar for free. This rule just makes that
   fullscreen surface look intentional instead of a stray inset box still
   shrink-wrapped to its normal in-page width. */
#aoc-dashboard-root:fullscreen,
#amo-dashboard-root:fullscreen {
    overflow-y: auto;
    background-color: #f9fafb;
    padding: 2rem 3rem;
}

/* Slide-style transition each time the active tab changes. wire:key on the
   tab panel forces Livewire to swap in a fresh DOM node per tab, so this
   animation (which only fires on element insertion) replays on every
   switch instead of just on first paint. */
@keyframes aoc-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aoc-slide-in {
    animation: aoc-slide-in 0.3s ease-out;
}
