/* EasyMaintenance web portal -- plain, professional, industrial. No
   frontend framework, no build step: this file is served as-is.

   EPS Industries corporate palette (see also README/PR description for the
   full sourcing note): derived from the real, rendered stylesheets of
   https://www.eps-industries.at/de/ (Joomla "shaper_fixter" template).

     --eps-primary       #d22e30  verified: templates/shaper_fixter/css/custom.css
                                   (site-specific override, !important) --
                                   heading color, active/hover main-nav color,
                                   primary-button background, offcanvas active item.
     --eps-primary-hover #a82526  derived: --eps-primary darkened ~20% (standard
                                   hover/pressed technique) -- the site itself
                                   doesn't define a second red for button hover.
     --eps-dark          #2f4046  verified: custom.css (default main-nav text
                                   color) and matches the template's own
                                   #sp-header background (#2f4047, effectively
                                   identical) -- this is "the" EPS anthracite.
     --eps-background    #e9e9e9  verified: templates/shaper_fixter/css/presets/
                                   preset2.css body background, not overridden
                                   by custom.css -- the real page background
                                   color rendered on the live site.
     --eps-surface        #ffffff verified: white surfaces (custom.css's own
                                   #sp-header background override, footer text
                                   color, etc.).
     --eps-border          #ededed verified: preset2.css pagination border color.
     --eps-text            #252525 verified: preset2.css body/module text color.
     --eps-text-muted      #5f5f5f derived: same neutral-gray family as the
                                   site's own muted tones (#AAAAAA / #A2A2A2,
                                   used for footer/top-bar text there), darkened
                                   for WCAG AA contrast -- the site's own
                                   ~2.3:1 contrast gray is too light for
                                   sustained reading in a data-dense app; this
                                   lands at ~5.3:1 on white / ~4.4:1+ on
                                   --eps-background.

   The site's template preset (preset2.css) also ships a stock cyan accent
   (#01D8ED) as its generic demo color -- confirmed NOT used by EPS's own
   custom.css overrides, so it is deliberately not used here.

   Fault-/priority-/status semantics (danger/warning/success/info) are kept
   fully independent of the EPS brand color so a Critical badge is never
   confused with ordinary branded UI -- see the "Status semantics" block. */

:root {
  --eps-primary: #d22e30;
  --eps-primary-hover: #a82526;
  --eps-dark: #2f4046;
  --eps-background: #e9e9e9;
  --eps-surface: #ffffff;
  --eps-border: #ededed;
  --eps-text: #252525;
  --eps-text-muted: #5f5f5f;
  --eps-sidebar-text: #cdd3d6;
  --eps-sidebar-text-strong: #ffffff;
  --eps-sidebar-hover-bg: rgba(255, 255, 255, 0.07);
  --eps-sidebar-active-bg: rgba(210, 46, 48, 0.22);

  --sidebar-width: 230px;
  --header-height: 64px;
  --content-max-width: 1600px;

  /* Status semantics -- independent of EPS branding, never repurposed for
     buttons/links/navigation. Critical/Fehler=Rot, Warnung/High=Orange,
     Erfolg/Completed=Grün, neutral=Blau/Grau. */
  --status-danger: #b3261e;
  --status-danger-bg: #fbe7e6;
  --status-warning: #a45b06;
  --status-warning-bg: #fdf0e0;
  --status-success: #1b7a43;
  --status-success-bg: #e6f4ea;
  --status-info: #1d4f91;
  --status-info-bg: #eaf1fb;
  --status-neutral: #5f5f5f;
  --status-neutral-bg: #ececec;

  --badge-low-bg: var(--status-success-bg);
  --badge-low-text: var(--status-success);
  --badge-medium-bg: var(--status-info-bg);
  --badge-medium-text: var(--status-info);
  --badge-high-bg: var(--status-warning-bg);
  --badge-high-text: var(--status-warning);
  --badge-critical-bg: var(--status-danger-bg);
  --badge-critical-text: var(--status-danger);

  --badge-open-bg: var(--status-info-bg);
  --badge-open-text: var(--status-info);
  --badge-progress-bg: var(--status-warning-bg);
  --badge-progress-text: var(--status-warning);
  --badge-done-bg: var(--status-success-bg);
  --badge-done-text: var(--status-success);
  --badge-cancelled-bg: var(--status-neutral-bg);
  --badge-cancelled-text: var(--status-neutral);

  /* Legacy aliases -- kept so any selector we didn't touch keeps working. */
  --color-bg: var(--eps-background);
  --color-surface: var(--eps-surface);
  --color-border: var(--eps-border);
  --color-text: var(--eps-text);
  --color-text-muted: var(--eps-text-muted);
  --color-primary: var(--eps-primary);
  --color-primary-dark: var(--eps-primary-hover);
  --color-danger: var(--status-danger);
  --color-success: var(--status-success);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--eps-background);
  color: var(--eps-text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--eps-primary); text-decoration: underline; text-decoration-color: transparent; transition: color 0.12s, text-decoration-color 0.12s; }
a:hover, a:focus { color: var(--eps-primary-hover); text-decoration-color: currentColor; }

/* Visible keyboard focus everywhere -- never rely on color alone. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.portal-sidebar a:focus-visible {
  outline: 2px solid var(--eps-primary);
  outline-offset: 2px;
}

.portal-header {
  height: var(--header-height);
  background: var(--eps-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.portal-header .brand-group { display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; text-decoration: none; }
.portal-header .brand { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; line-height: 1; color: #fff; }
.portal-header .brand-group:hover .brand, .portal-header .brand-group:focus .brand { color: #fff; }
.portal-header .brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eps-sidebar-text);
  line-height: 1;
}

.portal-header .who {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 0.2rem;
  font-size: 0.85rem;
  text-align: right;
  line-height: 1.1;
}
.portal-header .who .role { opacity: 0.8; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  font-size: 1.1rem;
  min-height: 40px;
  min-width: 40px;
}

.portal-body { display: flex; min-height: calc(100vh - var(--header-height)); }

.portal-sidebar {
  width: var(--sidebar-width);
  background: var(--eps-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.nav-main { display: flex; flex-direction: column; }

/* Audit/Abmelden -- pushed to the bottom of the sidebar, visually
   separated from the main navigation, via flex-column + margin-top:
   auto rather than any new permission logic. */
.nav-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Collapsible groups (Störungen/Wartung/Bereiche). Every group header is
   the existing link (reused as-is) plus a small separate toggle button,
   so clicking the name navigates and the arrow only expands/collapses. */
.nav-group-header { display: flex; align-items: stretch; }
.nav-group-header .nav-group-link { flex: 1; }

.nav-group-toggle {
  background: none;
  border: none;
  color: var(--eps-sidebar-text);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-group-toggle:hover, .nav-group-toggle:focus {
  background: var(--eps-sidebar-hover-bg);
  color: var(--eps-sidebar-text-strong);
}
/* Collapsed/expanded indicator -- Unicode arrows, no icon font/library. */
.nav-group-toggle::after { content: "\25B8"; font-size: 0.75rem; }
.nav-group.open .nav-group-toggle::after { content: "\25BE"; }

/* The group is marked "section-active" (server-rendered, from the
   current URL name) whenever the user is on one of its subpages -- the
   group starts expanded and its header text is highlighted, independent
   of and in addition to the normal .active styling on the exact page's
   own link/sub-link. */
.nav-group.section-active > .nav-group-header .nav-group-link {
  color: var(--eps-sidebar-text-strong);
  font-weight: 600;
}

.nav-group-items { display: none; flex-direction: column; }
.nav-group.open .nav-group-items { display: flex; }

.portal-sidebar a.nav-sub {
  padding-left: 2.1rem;
  font-size: 0.86rem;
  font-weight: 400;
}

.portal-sidebar a {
  display: flex;
  align-items: center;
  padding: 0.7rem 1.2rem 0.7rem 1.05rem;
  color: var(--eps-sidebar-text);
  text-decoration: none;
  border-left: 4px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  min-height: 44px;
}

/* Hover: a subtle, neutral lightening -- must stay visually lighter/less
   emphatic than .active so the two states are never confused. */
.portal-sidebar a:hover,
.portal-sidebar a:focus {
  background: var(--eps-sidebar-hover-bg);
  color: var(--eps-sidebar-text-strong);
}

/* Active: the current page -- EPS-red left accent, a tinted-red
   background (not just a neutral dark shade), bold white text. Wins over
   :hover so moving the mouse over the active item never makes it look
   like every other row. */
.portal-sidebar a.active,
.portal-sidebar a.active:hover,
.portal-sidebar a.active:focus {
  background: var(--eps-sidebar-active-bg);
  border-left-color: var(--eps-primary);
  color: var(--eps-sidebar-text-strong);
  font-weight: 700;
}

.portal-sidebar form { padding: 0.4rem 1.2rem; }
.portal-sidebar button.link-button {
  background: none; border: none; padding: 0.3rem 0; margin: 0;
  color: var(--eps-sidebar-text); font: inherit; cursor: pointer; min-height: 40px;
}
.portal-sidebar button.link-button:hover, .portal-sidebar button.link-button:focus { color: var(--eps-sidebar-text-strong); }

.portal-main { flex: 1; padding: 1.25rem 1.75rem; max-width: var(--content-max-width); }

.card {
  background: var(--eps-surface);
  border: 1px solid var(--eps-border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.05);
}

.card h2 { margin-top: 0; font-size: 1.05rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

/* Plain white/bordered like every other card -- EPS-red stays on the
   number itself (branding), not on a top bar that would read as a
   warning/alert regardless of what the figure actually means. */
.stat-card {
  background: var(--eps-surface);
  border: 1px solid var(--eps-border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.05);
}
/* Neutral by default -- EPS-red is a branding color (nav/buttons/links/
   focus), not a "this number is bad" signal, so a plain metric (e.g.
   "Aktive Maschinen") must not read as an alarm. Only the two cards whose
   meaning is inherently a warning/critical signal get a status color via
   the modifier classes below -- everything else stays neutral without
   needing any per-card logic. */
.stat-card .value { font-size: 1.7rem; font-weight: 700; color: var(--eps-dark); }
.stat-card .value.value-danger { color: var(--status-danger); }
.stat-card .value.value-warning { color: var(--status-warning); }
.stat-card .label { color: var(--eps-text-muted); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--eps-border); font-size: 0.92rem; }
th {
  color: var(--eps-text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--eps-border);
}
tr:hover td { background: var(--eps-background); }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-low { background: var(--badge-low-bg); color: var(--badge-low-text); }
.badge-medium { background: var(--badge-medium-bg); color: var(--badge-medium-text); }
.badge-high { background: var(--badge-high-bg); color: var(--badge-high-text); }
.badge-critical { background: var(--badge-critical-bg); color: var(--badge-critical-text); }

.badge-open { background: var(--badge-open-bg); color: var(--badge-open-text); }
.badge-in_progress { background: var(--badge-progress-bg); color: var(--badge-progress-text); }
.badge-resolved, .badge-completed, .badge-active { background: var(--badge-done-bg); color: var(--badge-done-text); }
.badge-cancelled, .badge-inactive, .badge-decommissioned { background: var(--badge-cancelled-bg); color: var(--badge-cancelled-text); }
.badge-maintenance { background: var(--badge-progress-bg); color: var(--badge-progress-text); }

/* KVP has its own status semantics (e.g. "in Umsetzung" = info/blue, not
   the warning/orange used for Fault's "in Bearbeitung") -- prefixed so it
   never collides with the shared badge-<value> classes above, several of
   which reuse the exact same internal status strings for other models. */
.badge-kvp-new { background: var(--status-neutral-bg); color: var(--status-neutral); }
.badge-kvp-under_review { background: var(--status-info-bg); color: var(--status-info); }
.badge-kvp-approved { background: var(--status-info-bg); color: var(--status-info); }
.badge-kvp-in_progress { background: var(--status-info-bg); color: var(--status-info); }
.badge-kvp-completed { background: var(--status-success-bg); color: var(--status-success); }
.badge-kvp-rejected { background: var(--status-neutral-bg); color: var(--status-neutral); }
.badge-kvp-cancelled { background: var(--eps-border); color: var(--eps-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  border: 1px solid var(--eps-primary);
  background: var(--eps-primary);
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
}
.btn:hover, .btn:focus { background: var(--eps-primary-hover); border-color: var(--eps-primary-hover); color: #fff; }
.btn-secondary {
  background: var(--eps-surface);
  color: var(--eps-dark);
  border-color: var(--eps-dark);
}
.btn-secondary:hover, .btn-secondary:focus { background: var(--eps-dark); color: #fff; }
.btn-danger { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #8f1e18; border-color: #8f1e18; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; align-items: end; }
.filters label { display: block; font-size: 0.8rem; color: var(--eps-text-muted); margin-bottom: 0.25rem; font-weight: 600; }
.filters input, .filters select {
  padding: 0.45rem 0.6rem; border: 1px solid var(--eps-border); border-radius: 5px; min-height: 40px;
}

.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 700; margin-bottom: 0.3rem; font-size: 0.88rem; color: var(--eps-text); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--eps-border);
  border-radius: 5px;
  font: inherit;
  min-height: 44px;
  background: var(--eps-surface);
  color: var(--eps-text);
}
.form-row textarea { min-height: 88px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--eps-primary);
  box-shadow: 0 0 0 3px rgba(210, 46, 48, 0.18);
}
.form-row .errorlist { color: var(--status-danger); font-size: 0.85rem; padding-left: 1rem; }
.form-row select:disabled {
  background: var(--eps-background);
  color: var(--eps-text-muted);
  cursor: not-allowed;
}

/* KVP form only -- three textareas of deliberately different heights
   (Beschreibung stays the largest), scoped to #kvp-form so the shared
   .form-row textarea min-height elsewhere (Fault, Handover, ...) is
   untouched. */
#kvp-form textarea#id_proposed_solution { min-height: 68px; }
#kvp-form textarea#id_expected_benefit { min-height: 52px; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: 0.65rem 0.95rem; border-radius: 5px; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; }
.messages .success { background: var(--status-success-bg); color: var(--status-success); }
.messages .error { background: var(--status-danger-bg); color: var(--status-danger); }

.checklist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem 1rem; }

/* KVP attachments -- compact card grid, images and PDFs alike. auto-fill
   (same pattern as .stat-grid/.checklist-grid above) gives several cards
   side by side on desktop and a sensible wrap on small screens without any
   extra breakpoints. */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.attachment-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--eps-border);
  border-radius: 8px;
  padding: 0.7rem;
  min-width: 0; /* lets long filenames actually wrap instead of overflowing the grid cell */
}
.attachment-preview { display: block; margin-bottom: 0.5rem; }
.attachment-thumb {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover; /* fills the box without stretching/distorting the image */
  border-radius: 5px;
  background: var(--eps-background);
}
.attachment-preview-file {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 150px;
  border-radius: 5px;
  background: var(--eps-background);
  margin-bottom: 0.5rem;
}
.attachment-file-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--eps-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.attachment-info { flex: 1; min-width: 0; }
.attachment-filename {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--eps-text);
  margin: 0 0 0.2rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.attachment-meta { font-size: 0.75rem; margin: 0.1rem 0; }
.attachment-actions { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; }
.attachment-actions .btn { width: 100%; }
.btn-small { padding: 0.3rem 0.7rem; min-height: 30px; font-size: 0.8rem; }

.attachment-upload-section {
  border-top: 1px solid var(--eps-border);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
.attachment-subheading { margin: 0 0 0.6rem; font-size: 0.92rem; font-weight: 700; color: var(--eps-text); }

.text-muted { color: var(--eps-text-muted); }
.mt-0 { margin-top: 0; }

/* Login page */
.login-shell {
  max-width: 400px;
  margin: 4.5rem auto;
  padding: 0 1rem;
}
.login-shell .login-brand { text-align: center; margin-bottom: 1.25rem; }
.login-shell .login-brand .brand { font-weight: 700; font-size: 1.5rem; color: var(--eps-dark); }
.login-shell .login-brand .brand-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eps-text-muted);
  margin-top: 0.15rem;
}
.login-shell .card { border-top: 4px solid var(--eps-primary); }
.login-shell .btn { width: 100%; }

/* Jahreswartungsplan -- reuses the existing badge color semantics (info/
   warning/success/neutral/danger), never --eps-primary (brand red is not a
   status color, see the file header note). */
.year-plan-nav { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.year-plan-nav a, .year-plan-nav span.current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  color: var(--eps-text);
}
.year-plan-nav a:hover { background: var(--eps-background); }
.year-plan-nav span.current { background: var(--eps-dark); color: #fff; }
.year-plan-nav-arrow {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--eps-text-muted);
  border: 1px solid var(--eps-border);
}
.year-plan-nav-arrow:hover { border-color: var(--eps-dark); color: var(--eps-text); }

.year-plan-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.6rem; margin-bottom: 0.5rem; align-items: center; }
.year-plan-legend .year-plan-entry { cursor: default; margin: 0; }
.year-plan-legend-note { color: var(--eps-text-muted); font-size: 0.78rem; margin-top: 0; margin-bottom: 1.1rem; }

.year-plan-filter-checkbox { display: flex; align-items: center; }
.year-plan-filter-checkbox label { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.year-plan-filter-checkbox input { width: auto; min-height: 0; }

.year-plan-table th, .year-plan-table td { text-align: center; white-space: nowrap; }
.year-plan-table th:first-child, .year-plan-table td:first-child { text-align: left; white-space: normal; }
.year-plan-current-month { background: var(--eps-background); }

.year-plan-row-title a { font-weight: 700; }
.year-plan-row-machine { display: block; font-size: 0.78rem; font-weight: 400; color: var(--eps-text-muted); }

.year-plan-entry {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  margin: 0.1rem;
  border: 1px solid transparent;
  line-height: 1.3;
}
.year-plan-entry-open, .year-plan-entry-planned {
  background: var(--status-info-bg); color: var(--status-info); border-color: var(--status-info);
}
.year-plan-entry-in_progress {
  background: var(--status-warning-bg); color: var(--status-warning); border-color: var(--status-warning);
}
.year-plan-entry-completed {
  background: var(--status-success-bg); color: var(--status-success); border-color: var(--status-success);
}
.year-plan-entry-cancelled {
  background: var(--status-neutral-bg); color: var(--status-neutral); border-color: var(--status-neutral);
}
.year-plan-entry-forecast {
  background: var(--eps-surface);
  color: var(--status-neutral);
  border-color: var(--status-neutral);
  border-style: dashed;
}
.year-plan-entry-overdue { background: var(--status-danger-bg); color: var(--status-danger); border-color: var(--status-danger); }
.year-plan-entry-multi { background: var(--eps-dark); color: #fff; border-color: var(--eps-dark); }

.year-plan-hours-table td:nth-child(n+3) { text-align: right; }

/* Meine Aufgaben -- unified task cards, reuses the year-plan entry badges
   for "Überfällig"/"Heute fällig" and the existing priority/status badge
   colors, so nothing here introduces a new color. */
.task-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.task-card {
  display: flex;
  flex-direction: column;
  background: var(--eps-surface);
  border: 1px solid var(--eps-border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.05);
}
.task-card p { margin: 0.3rem 0; font-size: 0.88rem; }
.task-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.task-type-badge { background: var(--eps-dark); color: #fff; }
.task-card-machine { font-size: 0.8rem; font-weight: 600; }
.task-card-title { margin: 0 0 0.5rem; font-size: 1rem; }
.task-card-open { margin-top: 0.75rem; width: 100%; min-height: 44px; }

@media (max-width: 820px) {
  .task-list { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .portal-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.15s ease-in-out;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
    z-index: 9;
    width: min(var(--sidebar-width), 82vw);
    overflow-y: auto;
  }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-main { padding: 1rem; }
  .btn { width: 100%; }
  .card { padding: 1rem; }
  .login-shell { margin-top: 2.5rem; }
}
