/* Copyright (c) 2026, Filip informatika d.o.o. All rights reserved. */
/* Customer portal of filipinf in the Adriatic look (15.6.0): dashboard tiles, lists of tickets,
   tasks and projects as rows with a state stripe, detail pages as cards, Gantt chart.
   Colours: the portal menu colours of adriatic_theme (--adriatic-portal-*) and the list header
   colours of Sidebar Settings (--fp-head-*, set by js/filipinf_portal.js). */

.fp {
    --fp-accent: var(--adriatic-portal-bg, var(--primary, #1587ff));
    --fp-head-bg: #daecff;
    --fp-head-fg: #0050a5;
    --fp-line: var(--border-color, #d1d8dd);
    --fp-muted: var(--text-muted, #6b7280);
    --fp-card: var(--card-bg, #fff);
    --fp-sunk: var(--subtle-fg, #f4f6f9);
    --fp-done: #12b76a; --fp-work: #2e90fa; --fp-late: #d92d20; --fp-paused: #7a5af8; --fp-wait: #d0d5dd; --fp-cancelled: #98a2b3;
    display: grid; gap: 18px; padding-block: 8px 32px; min-width: 0;
}
.fp h1, .fp h2, .fp h3 { margin: 0; }
.fp-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.fp-title h1 { font-size: 1.5rem; font-weight: 700; }
.fp-title .fp-sub { color: var(--fp-muted); font-size: .85rem; }

/* dashboard tiles */
.fp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.fp-tile { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--fp-line); border-top: 3px solid var(--fp-accent);
    border-radius: 8px; background: var(--fp-card); color: inherit; text-decoration: none; }
.fp-tile:hover { text-decoration: none; color: inherit; box-shadow: 0 2px 8px rgba(20, 30, 50, .10); }
.fp-tile .fp-n { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fp-tile .fp-k { font-size: .82rem; color: var(--fp-muted); }
.fp-tile .fp-alert { font-size: .8rem; color: var(--fp-late); font-weight: 600; }

/* filters */
.fp-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fp-bar input, .fp-bar select { max-width: 240px; font-size: .85rem; }

/* row lists */
.fp-list { border: 1px solid var(--fp-line); border-radius: 8px; overflow: hidden; background: var(--fp-card); }
.fp-list-head { display: flex; justify-content: space-between; gap: 8px; padding: 7px 14px; background: var(--fp-head-bg);
    color: var(--fp-head-fg); font-weight: 600; font-size: .82rem; }
.fp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 16px; padding: 10px 14px 10px 18px;
    border-top: 1px solid var(--fp-line); box-shadow: inset 4px 0 0 var(--fp-s, var(--fp-wait)); color: inherit; text-decoration: none; }
.fp-list-head + .fp-row { border-top: 0; }
.fp-row:hover { background: var(--fp-sunk); text-decoration: none; color: inherit; }
.fp-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-width: 0; }
.fp-subject { font-weight: 600; }
.fp-id { font-size: .75rem; color: var(--fp-muted); font-family: var(--font-stack-monospace, monospace); }
.fp-line { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: .78rem; color: var(--fp-muted); }
.fp-line b { color: var(--text-color, #1f272e); font-weight: 500; }
.fp-pill { font-weight: 600; color: var(--fp-s, var(--fp-muted)); }
.fp-side { grid-row: 1 / span 2; grid-column: 2; display: grid; justify-items: end; align-content: start; gap: 2px; font-size: .78rem;
    color: var(--fp-muted); text-align: right; }
.fp-side .fp-big { font-size: .9rem; font-weight: 600; color: var(--text-color, #1f272e); font-variant-numeric: tabular-nums; }
.fp-empty { padding: 18px 14px; color: var(--fp-muted); font-size: .9rem; }
.fp-sum { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--fp-line); background: var(--fp-sunk); font-size: .8rem; color: var(--fp-muted); }
.fp-sum b { color: var(--text-color, #1f272e); }

.fp-s-done { --fp-s: var(--fp-done); } .fp-s-work { --fp-s: var(--fp-work); } .fp-s-late { --fp-s: var(--fp-late); }
.fp-s-paused { --fp-s: var(--fp-paused); } .fp-s-wait { --fp-s: var(--fp-wait); } .fp-s-cancelled { --fp-s: var(--fp-cancelled); }
.fp-s-wait .fp-pill, .fp-s-cancelled .fp-pill { color: var(--fp-muted); }

/* detail pages */
.fp-head { border: 1px solid var(--fp-line); border-radius: 8px; background: var(--fp-card); padding: 14px 16px 14px 20px;
    box-shadow: inset 5px 0 0 var(--fp-s, var(--fp-accent)); display: grid; gap: 6px; }
.fp-head h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.fp-head .fp-line { font-size: .82rem; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; }
.fp-card { border: 1px solid var(--fp-line); border-radius: 8px; background: var(--fp-card); padding: 12px 16px; display: grid; gap: 10px; min-width: 0; }
.fp-card > h2 { font-size: .95rem; font-weight: 600; }
.fp-f { display: grid; gap: 1px; min-width: 0; }
.fp-f > span:first-child { font-size: .72rem; color: var(--fp-muted); text-transform: uppercase; letter-spacing: .04em; }
.fp-f > :last-child { overflow-wrap: anywhere; }
.fp-text { overflow-wrap: anywhere; }
.fp-text:empty::before { content: "—"; color: var(--fp-muted); }
.fp-progress { height: 6px; border-radius: 999px; background: var(--fp-sunk); overflow: hidden; }
.fp-progress > i { display: block; height: 100%; background: var(--fp-accent); }
.fp-items { width: 100%; border-collapse: collapse; font-size: .85rem; }
.fp-items th { background: var(--fp-head-bg); color: var(--fp-head-fg); font-weight: 600; font-size: .75rem; padding: 5px 8px; text-align: left; }
.fp-items td { padding: 5px 8px; border-top: 1px solid var(--fp-line); }
.fp-items .r { text-align: right; font-variant-numeric: tabular-nums; }

/* Gantt */
.fp-gantt { overflow-x: auto; }
.fp-gantt-in { min-width: 640px; display: grid; grid-template-columns: 200px minmax(0, 1fr); font-size: .78rem; }
.fp-gantt .fp-gh { background: var(--fp-head-bg); color: var(--fp-head-fg); font-weight: 600; padding: 4px 8px; }
.fp-gantt .fp-ticks { position: relative; background: var(--fp-head-bg); color: var(--fp-head-fg); height: 24px; }
.fp-gantt .fp-ticks span { position: absolute; top: 4px; padding-left: 4px; border-left: 1px solid rgba(255, 255, 255, .8); white-space: nowrap; }
.fp-gantt .fp-gl { padding: 5px 8px; border-top: 1px solid var(--fp-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.fp-gantt .fp-gb { position: relative; border-top: 1px solid var(--fp-line); min-height: 26px; }
.fp-gantt .fp-bar { position: absolute; top: 6px; height: 14px; border-radius: 3px; background: var(--fp-s, var(--fp-work)); opacity: .9; }
.fp-gantt .fp-bar.fp-s-wait { background: #8fb2e6; }
.fp-gantt .fp-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fp-late); }
.fp-gantt .fp-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--fp-line); }
.fp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .75rem; color: var(--fp-muted); }
.fp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 575px) {
    .fp-row { grid-template-columns: minmax(0, 1fr); }
    .fp-side { grid-row: auto; grid-column: 1; justify-items: start; text-align: left; display: flex; gap: 10px; }
    .fp-gantt-in { grid-template-columns: 130px minmax(0, 1fr); }
}
