/* Hausmeister-Tickets – Frontend-Styles
   Nach Josefspflege-Styleguide (docs/STYLEGUIDE.md):
   - Theme-freundlich (Theme-Variablen für Text/Hintergrund, Fallbacks)
   - feste Akzentfarbe Gold #f0c84c, dunkler Text auf Gold (#2a2410)
   - eckig (border-radius:0), Ausnahme nur Status-Pillen
   - Schrift vom Theme geerbt, luftiges Layout, dezente Linien
*/

.hmt-app,
.hmt-form,
.hmt-board,
.hmt-detail,
.hmt-my-tickets,
.hmt-magic-card {
	/* Theme-Anbindung: Text/Hintergrund aus dem Theme, mit Fallback. */
	--ink: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, #1c2530));
	--ink-soft: #5a6675;
	--line: #e6e9ee;
	--line-strong: #d4dae1;
	--paper: var(--wp--preset--color--base, var(--wp--preset--color--background, #ffffff));
	/* Akzentfarbe fest auf Gold (Styleguide), dunkler Text auf Gold. */
	--brand: #f0c84c;
	--brand-dark: #d9b22f;
	--brand-soft: #fdf6e0;
	--on-brand: #2a2410;
	--brand-ink: #2a2410; /* Alias, identisch zu --on-brand */
	/* Statusfarben */
	--st-offen: #1f5f5b;     --st-offen-bg: #eaf3f2;
	--st-bearb: #c97b00;     --st-bearb-bg: #fdf4e7;
	--st-rueck: #c0392b;     --st-rueck-bg: #fbecea;
	--st-erled: #3f7d4f;     --st-erled-bg: #e9f3ec;
	--radius: 0px; /* eckig statt abgerundet */

	color: var(--ink);
	font-family: inherit;
}

/* Ueberschriften: KEINE eigene font-family setzen, damit die Theme-Regel
   (h1..h4 -> Heading-Schrift, z. B. Merriweather) greift - identisch zum Fahrtkostentool. */
.hmt-form h2, .hmt-form h3, .hmt-form h4,
.hmt-board h2, .hmt-board h3, .hmt-board h4,
.hmt-detail h2, .hmt-detail h4,
.hmt-my-tickets h3,
.hmt-magic-card h1, .hmt-magic-card h2, .hmt-magic-card h4 {
	font-weight: 700;
	color: var(--ink);
}

/* Labels: kleine, gesperrte Grossbuchstaben in gedaempftem Graublau */
.hmt-field > label,
.hmt-filter-group label,
.hmt-side-box label,
.hmt-facts th {
	text-transform: uppercase;
	letter-spacing: .07em;
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-soft);
}

/* Notices */
.hmt-notice { padding:12px 16px; border-radius:var(--radius); margin:0 0 18px; font-size:14px;
	display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.hmt-notice-text { flex:1 1 auto; }
.hmt-notice-action { flex:0 0 auto; }
.hmt-notice-success { background:var(--st-erled-bg); color:var(--st-erled); }
.hmt-notice-error { background:var(--st-rueck-bg); color:#9a3412; }
.hmt-notice-info { background:var(--st-offen-bg); color:var(--st-offen); }

/* Form: luftig, randlos gegliedert */
.hmt-form { max-width:760px; }
.hmt-field { margin:0 0 28px; }
.hmt-field > label { display:block; margin:0 0 10px; }
.hmt-field input[type="text"],
.hmt-field input[type="email"],
.hmt-field input[type="url"],
.hmt-field input[type="number"],
.hmt-field input[type="date"],
.hmt-field select,
.hmt-field textarea {
	width:100%; padding:12px 14px; border:1px solid var(--line-strong);
	border-radius:var(--radius); font-size:15px; line-height:1.5; background:var(--paper);
	box-sizing:border-box; color:var(--ink); font-family:inherit; transition:border-color .15s, box-shadow .15s;
}
/* Selects brauchen eine garantierte Höhe, sonst beschneiden manche Themes den Text. */
.hmt-field select {
	height:auto; min-height:48px; line-height:1.5; appearance:auto; -webkit-appearance:menulist; -moz-appearance:menulist;
}
.hmt-field input:focus,
.hmt-field select:focus,
.hmt-field textarea:focus {
	outline:none; border-color:var(--brand);
	box-shadow:0 0 0 3px var(--brand-soft);
}
.hmt-field textarea { resize:vertical; line-height:1.6; }
.hmt-readonly { padding:12px 14px; background:color-mix(in srgb, var(--ink) 4%, #fff); border-radius:var(--radius); font-size:14px; color:var(--ink-soft); }
.hmt-hint { font-size:12.5px; color:var(--ink-soft); margin:7px 0 0; }
.hmt-hint-inline { text-transform:none; letter-spacing:0; font-weight:400; font-size:12.5px; color:var(--ink-soft); }

/* Buttons */
.hmt-btn { display:inline-block; padding:11px 20px; border-radius:var(--radius); font-size:14px;
	border:1px solid transparent; cursor:pointer; text-decoration:none; line-height:1.2; font-family:inherit;
	background:color-mix(in srgb, var(--ink) 6%, #fff); color:var(--ink); transition:.15s; }
.hmt-btn:hover { background:color-mix(in srgb, var(--ink) 10%, #fff); }
.hmt-btn-primary { background:var(--brand); color:var(--brand-ink); border-color:var(--brand); }
.hmt-btn-primary:hover { background:var(--brand-dark); }
.hmt-btn-success { background:var(--st-erled); color:#fff; }
.hmt-btn-success:hover { filter:brightness(.94); }
.hmt-btn-danger { background:transparent; color:var(--st-rueck); border-color:var(--line-strong); }
.hmt-btn-danger:hover { background:var(--st-rueck-bg); }
.hmt-btn-light { background:var(--paper); border-color:var(--line-strong); color:var(--ink); }
.hmt-btn-light:hover { background:color-mix(in srgb, var(--ink) 4%, #fff); }
.hmt-btn-sm { padding:6px 13px; font-size:13px; }
.hmt-btn-block { display:block; width:100%; text-align:center; }
.hmt-btn:disabled { opacity:.45; cursor:not-allowed; }
.hmt-actions { margin-top:10px; }

/* Upload */
.hmt-upload-row { display:flex; gap:10px; flex-wrap:wrap; }
.hmt-file-input { display:none; }
.hmt-preview { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.hmt-preview-item { width:92px; text-align:center; font-size:11px; color:var(--ink-soft); }
.hmt-preview-item img { width:92px; height:92px; object-fit:cover; border-radius:var(--radius); display:block; margin-bottom:5px; border:1px solid var(--line); }

/* Dringlichkeitsfaehnchen */
.hmt-flags { display:flex; gap:8px; }
.hmt-flag { display:flex; flex-direction:column; align-items:center; gap:3px; padding:10px 12px;
	border:1px solid var(--line-strong); border-radius:var(--radius); cursor:pointer; min-width:50px; background:var(--paper); transition:.15s; }
.hmt-flag input { display:none; }
.hmt-flag-icon { font-size:21px; color:#cdd3da; line-height:1; }
.hmt-flag-num { font-size:12px; color:var(--ink-soft); }
.hmt-flag.is-on .hmt-flag-icon { color:var(--brand); }
.hmt-flag.is-on[data-level="4"] .hmt-flag-icon,
.hmt-flag.is-on[data-level="5"] .hmt-flag-icon { color:var(--st-rueck); }
.hmt-flag:has(input:checked) { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }

/* Karten (eigene Auftraege) */
.hmt-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:16px; }
.hmt-card { border:1px solid var(--line); border-radius:var(--radius); padding:16px; background:var(--paper); }
.hmt-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.hmt-card-title { font-weight:600; margin-bottom:7px; color:var(--ink); }
.hmt-card-meta { display:flex; flex-wrap:wrap; gap:8px; font-size:12.5px; color:var(--ink-soft); }
.hmt-card-meta span:not(:last-child)::after { content:"·"; margin-left:8px; color:var(--line-strong); }
.hmt-count { display:inline-block; background:color-mix(in srgb, var(--ink) 7%, #fff); border-radius:0; padding:1px 10px; font-size:13px; color:var(--ink-soft); vertical-align:middle; font-family:inherit; }
.hmt-mt { margin-top:32px; }
.hmt-empty { color:var(--ink-soft); font-style:italic; }

/* Badges */
.hmt-badge { display:inline-block; padding:3px 11px; border-radius:20px; font-size:12px; font-weight:600; }
.hmt-badge-offen { background:var(--st-offen-bg); color:var(--st-offen); }
.hmt-badge-bearbeitung { background:var(--st-bearb-bg); color:var(--st-bearb); }
.hmt-badge-rueckfrage { background:var(--st-rueck-bg); color:var(--st-rueck); }
.hmt-badge-erledigt { background:var(--st-erled-bg); color:var(--st-erled); }

/* Dringlichkeit inline */
.hmt-urgency { color:var(--brand); font-weight:600; white-space:nowrap; }
.hmt-urgency.hmt-u4, .hmt-urgency.hmt-u5 { color:var(--st-rueck); }

/* Board-Filter: dezente Leiste statt Kasten */
.hmt-filters { display:flex; gap:20px; flex-wrap:wrap; margin:0 0 22px; padding:0 0 18px; border-bottom:1px solid var(--line); }
.hmt-filter-group { display:flex; flex-direction:column; gap:5px; }
.hmt-filter-group select { padding:9px 11px; border:1px solid var(--line-strong); border-radius:var(--radius); background:var(--paper); color:var(--ink); font-family:inherit; }

/* Tabelle */
.hmt-table { width:100%; border-collapse:collapse; font-size:14px; background:transparent !important; }
.hmt-table th, .hmt-table td { background:transparent !important; background-color:transparent !important; }
.hmt-table th { text-align:left; padding:11px 12px; border-bottom:1px solid var(--line-strong); font-size:11.5px; color:var(--ink-soft) !important; text-transform:uppercase; letter-spacing:.07em; font-weight:600; }
.hmt-table td { padding:13px 12px; border-bottom:1px solid var(--line); vertical-align:middle; color:var(--ink); }
.hmt-table tr:hover td { background:color-mix(in srgb, var(--ink) 3%, #fff) !important; }
.hmt-table-compact td, .hmt-table-compact th { padding:8px 12px; }
.hmt-link { color:var(--ink); text-decoration:none; font-weight:600; }
.hmt-link:hover { color:var(--brand-dark); text-decoration:underline; }
.hmt-row.hmt-u5 td:first-child, .hmt-row.hmt-u4 td:first-child { box-shadow:inset 3px 0 0 var(--st-rueck); }
.hmt-pill { display:inline-block; padding:1px 9px; border-radius:20px; font-size:11px; font-weight:600; margin-left:7px; }
.hmt-pill-reply { background:var(--brand-soft); color:var(--brand-dark); }

/* Detailansicht */
.hmt-back { display:inline-block; margin-bottom:16px; color:var(--ink-soft); text-decoration:none; font-size:14px; }
.hmt-back:hover { color:var(--brand-dark); }
.hmt-detail-head { display:flex; align-items:center; gap:14px; margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid var(--line-strong); }
.hmt-detail-head h2 { margin:0; }
.hmt-detail-grid { display:grid; grid-template-columns:1fr 290px; gap:28px; align-items:start; }
.hmt-facts { width:100%; border-collapse:collapse; margin-bottom:18px; background:transparent !important; }
.hmt-facts tr,
.hmt-facts th,
.hmt-facts td {
	background:transparent !important;
	background-color:transparent !important;
	border:none !important;
	box-shadow:none !important;
}
.hmt-facts th { text-align:left; padding:7px 14px 7px 0; font-weight:600; white-space:nowrap; vertical-align:top; width:160px; color:var(--ink-soft) !important; text-transform:uppercase; letter-spacing:.07em; font-size:12px; }
.hmt-facts td { padding:7px 0; font-size:14px; color:var(--ink) !important; }
.hmt-description h4, .hmt-images h4, .hmt-thread h4, .hmt-notes h4 { margin:22px 0 10px; font-size:15px; }
.hmt-description p { background:color-mix(in srgb, var(--ink) 3.5%, #fff); padding:14px; border-radius:var(--radius); margin:0; }
.hmt-image-grid { display:flex; flex-wrap:wrap; gap:10px; }
.hmt-image-grid img { width:124px; height:124px; object-fit:cover; border-radius:var(--radius); border:1px solid var(--line); }

/* Thread / Notizen */
.hmt-thread-list, .hmt-notes-list { display:flex; flex-direction:column; gap:11px; margin-bottom:14px; }
.hmt-msg { border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; background:var(--paper); }
.hmt-msg-staff { box-shadow:inset 3px 0 0 var(--brand); }
.hmt-msg-requester { box-shadow:inset 3px 0 0 var(--st-rueck); background:var(--brand-soft); }
.hmt-msg-head, .hmt-note-head { font-size:12px; color:var(--ink-soft); margin-bottom:5px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.hmt-msg-head strong, .hmt-note-head strong { color:var(--ink); }
.hmt-msg-role { background:color-mix(in srgb, var(--ink) 7%, #fff); padding:1px 8px; border-radius:0; }
.hmt-msg-time { margin-left:auto; }
.hmt-note { border:1px dashed var(--ink-soft); border-left:4px solid var(--ink-soft); background:color-mix(in srgb, var(--ink) 5%, #fff); padding:12px 14px; }
.hmt-note-tag { background:var(--ink-soft); color:#fff; padding:1px 8px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.hmt-thread-add textarea, .hmt-notes-add textarea { width:100%; padding:12px; border:1px solid var(--line-strong); border-radius:var(--radius); box-sizing:border-box; margin-bottom:9px; resize:vertical; font-family:inherit; color:var(--ink); background:var(--paper); }

/* Detail-Sidebar */
.hmt-detail-side { display:flex; flex-direction:column; gap:16px; }
.hmt-side-box { border:1px solid var(--line); border-radius:var(--radius); padding:16px; background:var(--paper); }
.hmt-side-box label { display:block; margin-bottom:8px; }
.hmt-side-box select { width:100%; padding:10px 11px; border:1px solid var(--line-strong); border-radius:var(--radius); background:var(--paper); color:var(--ink); font-family:inherit; }

/* Wiederkehrende Aufgaben */
.hmt-recurring { margin-top:38px; padding-top:24px; border-top:1px solid var(--line-strong); }
.hmt-recurring-actions { display:flex; gap:7px; }
.hmt-recurring-add { margin-top:18px; }
.hmt-recurring-add summary { display:inline-block; list-style:none; }
.hmt-recurring-add summary::-webkit-details-marker { display:none; }
.hmt-form-inline { margin-top:18px; max-width:100%; }
.hmt-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.hmt-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.hmt-inline-2 { display:flex; gap:8px; }

/* Magic-Link-Seite */
.hmt-magic-page { background:color-mix(in srgb, var(--ink, #1c2530) 5%, #fff); margin:0;
	font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; color:#1c2530; }
.hmt-magic-wrap { max-width:700px; margin:48px auto; padding:0 16px; }
.hmt-magic-card { background:#fff; border-radius:0; padding:32px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.hmt-magic-card h1 { font-size:17px; color:#5a6675; margin:0 0 4px; font-weight:600; text-transform:uppercase; letter-spacing:.07em; }
.hmt-magic-card h2 { font-size:24px; margin:0 0 20px; }
.hmt-magic-reply { margin-top:24px; padding-top:24px; border-top:1px solid #e6e9ee; }

/* Responsive */
@media (max-width:782px) {
	.hmt-detail-grid { grid-template-columns:1fr; }
	.hmt-grid-3, .hmt-grid-2 { grid-template-columns:1fr; }
	.hmt-filters { gap:12px; }
	.hmt-table thead { display:none; }
	.hmt-table, .hmt-table tbody, .hmt-table tr, .hmt-table td { display:block; width:100%; box-sizing:border-box; }
	.hmt-table tr { border:1px solid var(--line); border-radius:var(--radius); margin-bottom:11px; padding:7px; }
	.hmt-table td { border:none; padding:6px 9px; }
}

/* Seitenkopf + Tabs (wie Fahrtkostentool) */
.hmt-app { color:var(--ink); }
.hmt-pagehead { display:flex; justify-content:space-between; align-items:flex-start; gap:20px;
	padding:0 0 20px; border-bottom:2px solid var(--ink); margin-bottom:0; }
.hmt-pagetitle {
	font-size:30px; font-weight:700; margin:0 0 4px; color:var(--ink); line-height:1.15; }
.hmt-pagesub { margin:0; color:var(--ink-soft); font-size:15px; }
.hmt-userbadge { border:1px solid var(--line-strong); border-radius:var(--radius); padding:12px 18px;
	text-align:right; white-space:nowrap; }
.hmt-userbadge-name { display:block; font-weight:600; color:var(--ink); font-size:14px; }
.hmt-userbadge-mail { display:block; color:var(--ink-soft); font-size:13px; margin-top:2px; }

.hmt-tabs { display:flex; gap:0; border-bottom:1px solid var(--line); margin:0 0 28px; }
.hmt-tab { padding:13px 22px; text-decoration:none; color:var(--ink-soft); font-size:14px; font-weight:600;
	border-bottom:3px solid transparent; margin-bottom:-1px; transition:.15s; }
.hmt-tab:hover { color:var(--ink); }
.hmt-tab.is-active { background:var(--brand); color:var(--brand-ink); border-bottom-color:var(--brand-dark);
	border-top-left-radius:0; border-top-right-radius:0; }

@media (max-width:600px) {
	.hmt-pagehead { flex-direction:column; }
	.hmt-userbadge { text-align:left; }
	.hmt-tabs { overflow-x:auto; }
}

/* View-Umschalter (Aufträge / Papierkorb) */
.hmt-viewswitch { display:flex; gap:8px; margin:0 0 16px; }
.hmt-switch { padding:7px 16px; text-decoration:none; font-size:13px; font-weight:600; color:var(--ink-soft);
	border:1px solid var(--line-strong); background:var(--paper); }
.hmt-switch.is-active { background:var(--brand); color:var(--brand-ink); border-color:var(--brand-dark); }

/* Tagesplan-Leiste */
.hmt-todobar { display:flex; align-items:center; gap:12px; margin:0 0 14px; padding:10px 14px;
	background:var(--brand-soft); border:1px solid var(--brand); }
.hmt-todobar-info { font-size:14px; font-weight:600; color:var(--ink); margin-right:auto; }
.hmt-col-check { width:34px; text-align:center; }
.hmt-col-check input { width:17px; height:17px; cursor:pointer; }

/* Tagesplan-Adressfeld */
.hmt-todo-mailto { padding:7px 11px; border:1px solid var(--line-strong); background:var(--paper);
	color:var(--ink); font-family:inherit; font-size:13px; min-width:200px; }
.hmt-todo-mailto:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }

/* Abstand der Hausmeister-„abweichender Auftraggeber"-Box */
.hmt-staff-requester { margin:0 0 28px; }
.hmt-staff-requester summary { display:inline-block; list-style:none; margin-bottom:4px; }
.hmt-staff-requester summary::-webkit-details-marker { display:none; }
.hmt-staff-requester[open] { padding-bottom:8px; border-bottom:1px solid var(--line); }

/* Bild-Buttons (Lightbox-Trigger) - wie Thumbnails, kein Button-Look */
.hmt-image-btn { padding:0; border:1px solid var(--line); background:none; cursor:pointer; line-height:0; }
.hmt-image-btn img { width:124px; height:124px; object-fit:cover; display:block; }
.hmt-image-btn:hover { border-color:var(--brand); }

/* Lightbox-Overlay */
.hmt-lightbox { position:fixed; inset:0; background:rgba(0,0,0,.82); display:flex; align-items:center;
	justify-content:center; z-index:99999; cursor:zoom-out; padding:24px; }
.hmt-lightbox img { max-width:92%; max-height:92%; object-fit:contain; box-shadow:0 4px 30px rgba(0,0,0,.5); }
.hmt-lightbox-close { position:absolute; top:16px; right:24px; color:#fff; font-size:38px; line-height:1;
	cursor:pointer; font-family:Arial,sans-serif; }

/* kleiner oberer Abstand für Buttons (z. B. Übernehmen unter dem Status-Select) */
.hmt-mt-sm { margin-top:10px; }

/* Sortierbare Tabellenköpfe */
.hmt-table th.hmt-sortable { padding:0; }
.hmt-table th.hmt-sortable a { display:block; padding:11px 12px; color:var(--ink-soft); text-decoration:none;
	font-size:11.5px; text-transform:uppercase; letter-spacing:.07em; font-weight:600; white-space:nowrap; }
.hmt-table th.hmt-sortable a:hover { color:var(--ink); background:color-mix(in srgb, var(--ink) 4%, #fff); }
.hmt-table th.hmt-sortable.is-sorted a { color:var(--ink); }

/* Toast-Meldung: schwebt oben rechts, blendet sich aus */
.hmt-notice.hmt-toast {
	position:fixed; top:24px; right:24px; z-index:100000; max-width:360px;
	box-shadow:0 6px 24px rgba(28,37,48,.18); cursor:pointer;
	animation:hmt-toast-in .25s ease-out;
}
.hmt-notice.hmt-toast-hide { opacity:0; transform:translateY(-8px); transition:opacity .4s, transform .4s; }
@keyframes hmt-toast-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:600px) {
	.hmt-notice.hmt-toast { left:12px; right:12px; top:12px; max-width:none; }
}

/* Anklickbare Auftragskarten (Meine Aufträge) */
a.hmt-card-link { display:block; text-decoration:none; color:inherit; transition:border-color .15s, box-shadow .15s; }
a.hmt-card-link:hover { border-color:var(--brand); box-shadow:0 2px 10px rgba(28,37,48,.08); }
.hmt-card-open { display:inline-block; margin-top:10px; font-size:13px; font-weight:600; color:var(--brand-dark); }
