/*
 * ekdosi panel utilities — a no-build supplement for the Filament admin panel.
 *
 * The panel ships ONLY Filament's component CSS (.fi-*); it exposes NO general
 * Tailwind utility layer, and the app registers no custom Tailwind theme / runs
 * no asset build. So utility classes used in our custom blade pages (grids,
 * spacing, tables, colours) were unstyled. This file hand-defines exactly the
 * utilities those pages use, with standard Tailwind values + .dark / responsive
 * variants, and is injected into the panel via FilamentAsset::register — no npm,
 * no Vite. Republished on every deploy by `filament:assets` (composer post-install).
 *
 * Maintenance: if a new blade page uses a utility not defined here, add it below.
 * Colours track the standard Tailwind palette (= Filament's defaults).
 */

/* ── display / layout ─────────────────────────────────────────────────── */
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.items-baseline { align-items: baseline; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.overflow-hidden { overflow: hidden; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* gaps */
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-y-1 { row-gap: .25rem; }
.gap-y-4 { row-gap: 1rem; }

/* space-between children */
.space-y-0\.5 > * + * { margin-top: .125rem; }
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* dividers */
.divide-y > * + * { border-top-width: 1px; border-top-style: solid; }
.divide-gray-100 > * + * { border-color: #f3f4f6; }
.divide-gray-200 > * + * { border-color: #e5e7eb; }

/* sizes */
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; } .h-6 { height: 1.5rem; }
.w-40 { width: 10rem; } .h-40 { height: 10rem; }
.w-full { width: 100%; }

/* ── spacing ──────────────────────────────────────────────────────────── */
.p-2 { padding: .5rem; }
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-1\.5 { padding-top: .375rem; padding-bottom: .375rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-1 { padding-top: .25rem; }
.pt-2 { padding-top: .5rem; }
.pt-4 { padding-top: 1rem; }
.pl-3 { padding-left: .75rem; }
.pr-3 { padding-right: .75rem; }
.pr-4 { padding-right: 1rem; }
.ps-4 { padding-inline-start: 1rem; }
.mt-0\.5 { margin-top: .125rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }

/* ── typography ───────────────────────────────────────────────────────── */
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.leading-relaxed { line-height: 1.625; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.break-all { word-break: break-all; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-line { white-space: pre-line; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.align-top { vertical-align: top; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }
.cursor-pointer { cursor: pointer; }

/* ── borders / radius ─────────────────────────────────────────────────── */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-t-2 { border-top-width: 2px; border-top-style: solid; }
.border-dashed { border-style: dashed; }
.rounded { border-radius: .25rem; }
.rounded-lg { border-radius: .5rem; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-warning-200 { border-color: #fde68a; }

/* ── colours: text ────────────────────────────────────────────────────── */
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-success-500 { color: #22c55e; }
.text-success-600 { color: #16a34a; }
.text-success-700 { color: #15803d; }
.text-danger-500 { color: #ef4444; }
.text-danger-600 { color: #dc2626; }
.text-danger-700 { color: #b91c1c; }
.text-warning-500 { color: #f59e0b; }
.text-warning-600 { color: #d97706; }
.text-warning-700 { color: #b45309; }
.text-info-700 { color: #1d4ed8; }
.text-primary-500 { color: #f59e0b; }
.text-primary-600 { color: #d97706; }
.text-amber-500 { color: #f59e0b; }

/* ── colours: background ──────────────────────────────────────────────── */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-success-50 { background-color: #f0fdf4; }
.bg-danger-50 { background-color: #fef2f2; }
.bg-warning-50 { background-color: #fffbeb; }
.bg-info-50 { background-color: #eff6ff; }

/* ── hover ────────────────────────────────────────────────────────────── */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:underline:hover { text-decoration-line: underline; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:items-center { align-items: center; }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-3 { grid-column: span 3 / span 3; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── dark mode (Filament toggles .dark on <html>) ─────────────────────── */
.dark .dark\:text-gray-100 { color: #f3f4f6; }
.dark .dark\:text-gray-200 { color: #e5e7eb; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:text-gray-400 { color: #9ca3af; }
.dark .dark\:text-gray-500 { color: #6b7280; }
.dark .dark\:text-success-300 { color: #86efac; }
.dark .dark\:text-success-400 { color: #4ade80; }
.dark .dark\:text-danger-200 { color: #fecaca; }
.dark .dark\:text-danger-400 { color: #f87171; }
.dark .dark\:text-warning-200 { color: #fde68a; }
.dark .dark\:text-warning-300 { color: #fcd34d; }
.dark .dark\:text-warning-400 { color: #fbbf24; }
.dark .dark\:text-info-300 { color: #93c5fd; }
.dark .dark\:text-primary-400 { color: #fbbf24; }
.dark .dark\:bg-gray-800 { background-color: #1f2937; }
.dark .dark\:bg-gray-900 { background-color: #111827; }
.dark .dark\:bg-white\/5 { background-color: rgba(255, 255, 255, .05); }
.dark .dark\:bg-success-950\/40 { background-color: rgba(5, 46, 22, .4); }
.dark .dark\:bg-danger-950\/40 { background-color: rgba(69, 10, 10, .4); }
.dark .dark\:bg-warning-950\/40 { background-color: rgba(69, 26, 3, .4); }
.dark .dark\:bg-info-950\/40 { background-color: rgba(23, 37, 84, .4); }
.dark .dark\:border-gray-600 { border-color: #4b5563; }
.dark .dark\:border-gray-700 { border-color: #374151; }
.dark .dark\:border-gray-800 { border-color: #1f2937; }
.dark .dark\:border-warning-800 { border-color: #92400e; }
.dark .dark\:border-white\/5 { border-color: rgba(255, 255, 255, .05); }
.dark .dark\:border-white\/10 { border-color: rgba(255, 255, 255, .1); }
.dark .dark\:border-white\/20 { border-color: rgba(255, 255, 255, .2); }
.dark .dark\:divide-gray-700 > * + * { border-color: #374151; }
.dark .dark\:divide-white\/10 > * + * { border-color: rgba(255, 255, 255, .1); }
.dark .dark\:hover\:bg-gray-800\/50:hover { background-color: rgba(31, 41, 55, .5); }

/* ── round 2: utilities the first pass missed (in @class()/ternaries) ──── */
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.overflow-x-auto { overflow-x: auto; }
.gap-x-2 { column-gap: .5rem; }
.gap-x-3 { column-gap: .75rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-x-6 { column-gap: 1.5rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.py-0\.5 { padding-top: .125rem; padding-bottom: .125rem; }
.rounded-full { border-radius: 9999px; }
.text-gray-900 { color: #111827; }
.text-gray-100 { color: #f3f4f6; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-800\/50 { background-color: rgba(31, 41, 55, .5); }
.bg-gray-900 { background-color: #111827; }
.bg-success-100 { background-color: #dcfce7; }
.bg-warning-100 { background-color: #fef3c7; }
.bg-danger-100 { background-color: #fee2e2; }
.bg-info-100 { background-color: #dbeafe; }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
}

.dark .dark\:bg-gray-950 { background-color: #030712; }

/* ── Filament fixes (overrides of .fi-* component CSS) ─────────────────── */
/*
 * Page header actions overflow on narrow viewports. Filament's
 * .fi-header-actions-ctn is `display:flex; flex-shrink:0` with no wrap, so a
 * page with many header actions (e.g. the Καρτέλα: Νέο Παραστατικό, εισπράξεις,
 * πληρωμές, εξαγωγή…) keeps the row at full width and the right-most buttons
 * fall off the edge — no wrap, no scrollbar. Let the container shrink and wrap
 * its actions onto a second row instead (the inner .fi-ac already wraps once
 * it's given a constrained width).
 */
.fi-header-actions-ctn {
    min-width: 0;
    flex-shrink: 1;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── AI «Βοηθός» chat (page + floating widget) ────────────────────────── */
.self-end { align-self: flex-end; }
.overflow-y-auto { overflow-y: auto; }
.bg-primary-50 { background-color: #fffbeb; }      /* primary = Amber */
.dark .dark\:bg-primary-400\/10 { background-color: rgba(251, 191, 36, .1); }

.ai-widget-fab {
    position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 40;
    display: flex; align-items: center; justify-content: center;
    width: 3.25rem; height: 3.25rem; border-radius: 9999px;
    background-color: #f59e0b; color: #fff; border: none; cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.2), 0 4px 6px -4px rgba(0,0,0,.2);
}
.ai-widget-fab:hover { background-color: #d97706; }
.ai-widget-panel {
    position: fixed; bottom: 5rem; right: 1.25rem; z-index: 40;
    width: 22rem; max-width: calc(100vw - 2rem);
    display: flex; flex-direction: column;
    background-color: #fff; border: 1px solid #e5e7eb; border-radius: .75rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,.2), 0 8px 10px -6px rgba(0,0,0,.2);
}
.dark .ai-widget-panel { background-color: #111827; border-color: rgba(255,255,255,.1); }
.ai-widget-log { min-height: 12rem; max-height: 24rem; overflow-y: auto; }
.ai-link { color: #d97706; text-decoration: underline; font-weight: 500; }
.dark .ai-link { color: #fbbf24; }
.ai-confirm-card { display: flex; flex-direction: column; gap: .5rem; padding: .625rem .75rem; border: 1px solid #fcd34d; border-radius: .5rem; background-color: #fffbeb; }
.dark .ai-confirm-card { border-color: rgba(251,191,36,.3); background-color: rgba(120,53,15,.2); }
