@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;
@import '../../../../vendor/filament/filament/resources/css/base.css';

@config 'tailwind.config.js';

/* ─────────────────────────────────────────────────────────────────────────
   PPSA Admin — Filament v3 Custom Theme
   Overrides are written OUTSIDE @layer so they beat all layered utilities
   (CSS unlayered rules always win over @layer utilities / @layer components).
   ───────────────────────────────────────────────────────────────────────── */

/* ── Input wrapper ──────────────────────────────────────────────────────── */
.fi-input-wrp {
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04) !important;
    background-color: #fff !important;
    transition: all 150ms !important;
}
.fi-input-wrp:focus-within {
    --tw-ring-color: rgb(22 163 74 / 0.4) !important;
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
    box-shadow: var(--tw-ring-shadow) !important;
}

/* ── The actual input / textarea ────────────────────────────────────────── */
.fi-input,
.fi-fo-textarea-input {
    font-size: 0.875rem !important;
    color: #111827 !important;
}
.fi-input::placeholder,
.fi-fo-textarea-input::placeholder {
    color: #9ca3af !important;
}

/* ── Select ─────────────────────────────────────────────────────────────── */
.fi-select-input {
    border-radius: 0.75rem !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    background-color: #fff !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04) !important;
    transition: all 150ms !important;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
}
.fi-select-input:focus {
    outline: none !important;
    --tw-ring-color: rgb(22 163 74 / 0.4) !important;
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
    box-shadow: var(--tw-ring-shadow) !important;
}

/* ── Labels ─────────────────────────────────────────────────────────────── */
.fi-fo-field-wrp-label .fi-label {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.375rem !important;
}
.fi-fo-field-wrp-hint {
    font-size: 0.75rem !important;
    color: #9ca3af !important;
    margin-top: 0.25rem !important;
}

/* ── Validation error messages ──────────────────────────────────────────── */
.fi-fo-field-wrp-validation-messages {
    margin-top: 0.375rem !important;
}
.fi-fo-field-wrp-validation-messages p {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: rgb(var(--danger-600)) !important;
}
.fi-fo-field-wrp.fi-fo-field-wrp-has-errors .fi-input-wrp {
    --tw-ring-color: rgb(var(--danger-500) / 0.5) !important;
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
    box-shadow: var(--tw-ring-shadow) !important;
    background-color: rgb(var(--danger-50) / 0.3) !important;
}

/* ── Toggle ──────────────────────────────────────────────────────────────── */
.fi-toggle {
    transition: all 200ms !important;
}
.fi-fo-toggle .fi-toggle-label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

/* ── Section cards ───────────────────────────────────────────────────────── */
.fi-section {
    border-radius: 1rem !important;
    overflow: visible !important;   /* must NOT be hidden — clips Select dropdowns */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07) !important;
    border: 1px solid rgb(229 231 235 / 0.8) !important;
}
.fi-section-header {
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    background-color: rgb(249 250 251 / 0.7) !important;
    border-radius: 1rem 1rem 0 0 !important; /* replicate top rounding without overflow:hidden */
}
.fi-section-header-heading {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
}
.fi-section-content {
    padding: 1.25rem 1.5rem !important;
    border-radius: 0 0 1rem 1rem !important;
}
.fi-section-content-ctn:last-child .fi-section-content {
    border-radius: 0 0 1rem 1rem !important;
}

/* ── Form field row spacing ──────────────────────────────────────────────── */
.fi-fo-field-wrp {
    row-gap: 0.25rem !important;
}

/* ── Primary buttons ────────────────────────────────────────────────────── */
.fi-btn-color-primary {
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
}
.fi-btn-color-gray {
    border-radius: 0.75rem !important;
}

/* ── Table header cells ──────────────────────────────────────────────────── */
.fi-ta-header-cell {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #4b5563 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.fi-wi-stats-overview-stat {
    border-radius: 1rem !important;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07) !important;
    border: 1px solid rgb(229 231 235 / 0.6) !important;
}
.fi-wi-stats-overview-stat-value {
    font-size: 1.75rem !important;
    font-weight: 900 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em !important;
}
.fi-wi-stats-overview-stat-label {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #6b7280 !important;
}

/* ── Sidebar nav items ───────────────────────────────────────────────────── */
.fi-sidebar-item-button {
    border-radius: 0.75rem !important;
    transition: all 150ms !important;
}
.fi-sidebar-group-label {
    font-size: 0.625rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: #9ca3af !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.fi-header-heading {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #111827 !important;
}

/* ── Notifications ───────────────────────────────────────────────────────── */
.fi-no-notification {
    border-radius: 1rem !important;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.fi-modal-content {
    border-radius: 1rem !important;
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.fi-badge {
    font-weight: 600 !important;
    border-radius: 9999px !important;
    padding: 0.125rem 0.625rem !important;
    font-size: 0.75rem !important;
}

/* ── Table rows ──────────────────────────────────────────────────────────── */
.fi-ta-row:hover td {
    background-color: rgb(249 250 251) !important;
}

/* ── Widget card wrappers ────────────────────────────────────────────────── */
.fi-wi {
    border-radius: 1rem !important;
    overflow: visible !important;  /* must NOT be hidden — clips Select dropdowns */
}
