/*
 * Crosswind Technologies helpdesk styles.
 * Loaded AFTER ../css/styles.css and uses the same colors and fonts as the
 * main site (navy + coral, Sora headings, Manrope text). If the main
 * stylesheet is missing, the fallback colors after each comma are used.
 */
:root {
    --hd-navy: var(--navy, #1e3c72);
    --hd-navy-deep: var(--navy-deep, #0f172a);
    --hd-blue: var(--blue, #2a5298);
    --hd-indigo: var(--indigo, #667eea);
    --hd-coral: var(--coral, #ff6b6b);
    --hd-coral-dark: #d63c3c;          /* coral dark enough for white button text */
    --hd-light: var(--light, #f7f8fc);
    --hd-shadow: var(--shadow, 0 20px 40px rgba(15, 23, 42, 0.18));
    --hd-shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.08);

    --hd-border: rgba(15, 23, 42, 0.14);
    --hd-muted: #55607a;
    --hd-row-alt: #f7f8fc;
    --hd-urgent-bg: #fff1f1;
    --hd-warn-bg: #fff8eb;
    --hd-red: #c0262d;
    --hd-orange: #c2410c;
    --hd-green: #0f7a4f;
    --hd-amber: #b45309;
    --hd-gray: #475467;
}

body.hd-body {
    margin: 0;
    font-family: "Manrope", "Raleway", system-ui, sans-serif;
    color: var(--hd-navy-deep);
    background: var(--hd-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.hd-body h1, .hd-body h2, .hd-body h3 { font-family: "Sora", "Raleway", sans-serif; line-height: 1.2; }
.hd-body a { color: var(--hd-blue); }
.hd-body a:hover { color: var(--hd-coral-dark); }

/* ---- Header ---- */
.hd-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.hd-header-inner {
    max-width: 1200px; margin: 0 auto; padding: 10px 6vw;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
}
.hd-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--hd-navy-deep) !important; }
.hd-logo img { display: block; width: 120px; height: auto; }
.hd-logo-label {
    font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--hd-coral-dark); border-left: 2px solid var(--hd-border); padding-left: 14px;
}
.hd-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-weight: 600; }
.hd-menu a {
    text-decoration: none; color: var(--hd-navy-deep); padding: 8px 14px; border-radius: 999px;
    transition: background .2s ease, color .2s ease;
}
.hd-menu a:hover { background: rgba(255, 107, 107, 0.12); color: var(--hd-coral-dark); }
.hd-menu a.hd-active { background: rgba(30, 60, 114, 0.08); color: var(--hd-navy); }
.hd-menu a.hd-phone { background: var(--hd-coral-dark); color: #fff; margin-left: 6px; }
.hd-menu a.hd-phone:hover { background: var(--hd-navy); color: #fff; }

/* ---- Main area ---- */
main.hd { flex: 1; width: 100%; box-sizing: border-box; max-width: 1200px; margin: 0 auto; padding: 32px 6vw 56px; }
.hd h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 1rem; }
.hd h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
.hd-signed-in { text-align: right; color: var(--hd-muted); font-size: .85rem; margin: -16px 0 8px; }

.hd-intro { margin-bottom: 1.5rem; }
.hd-intro h1 { margin-bottom: .4rem; }
.hd-intro p { margin: 0; color: var(--hd-muted); font-size: 1.1rem; }
.hd-eyebrow { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; font-size: .8rem; color: var(--hd-indigo) !important; margin: 0 0 .5rem !important; }

.hd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.hd-aside { display: grid; gap: 16px; position: sticky; top: 100px; }
.hd-aside .hd-card h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.hd-aside .hd-card p { margin: 0 0 .5rem; }
.hd-aside address { font-style: normal; line-height: 1.7; }

.hd-center { text-align: center; }
.hd-muted { color: var(--hd-muted); }
.hd-big { font-size: 1.4rem; }
.hd-req { color: var(--hd-red); }
.hd-help { color: var(--hd-muted); font-size: .9rem; margin: .35rem 0 0; }
.hd-num { text-align: right !important; white-space: nowrap; }
.hd-pre { white-space: pre-wrap; }           /* keeps line breaks people typed */

/* ---- Cards ---- */
.hd-card {
    background: #fff; border-radius: 18px; padding: 20px 22px;
    box-shadow: var(--hd-shadow-soft); border: 1px solid rgba(15, 23, 42, 0.06);
}
.hd-card h2 { margin-top: 0; font-size: 1.15rem; }
.hd-card-accent { background: var(--hd-navy-deep); color: #fff; border: 0; }
.hd-card-accent p { color: rgba(255, 255, 255, 0.85); }
.hd-card-accent .hd-button { width: 100%; box-sizing: border-box; text-align: center; }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 16px; }

/* ---- Forms ---- */
.hd-form fieldset {
    background: #fff; border: 1px solid rgba(15, 23, 42, 0.06); border-radius: 18px;
    padding: 8px 22px 22px; margin: 0 0 20px; box-shadow: var(--hd-shadow-soft);
}
.hd-form legend {
    font-family: "Sora", sans-serif; font-weight: 700; padding: 6px 14px; border-radius: 999px;
    background: var(--hd-navy-deep); color: #fff; font-size: .9rem;
}
.hd-form label, .hd-label { display: block; margin: 1rem 0 .35rem; font-weight: 600; }
.hd-form input[type="text"], .hd-form input[type="email"], .hd-form input[type="tel"],
.hd-form input[type="password"], .hd-form input[type="number"], .hd-form input[type="date"],
.hd-form select, .hd-form textarea {
    width: 100%; box-sizing: border-box; padding: 11px 14px; font: inherit;
    border: 1px solid rgba(15, 23, 42, 0.18); border-radius: 10px; background: #fff; color: inherit;
}
.hd-form input:focus, .hd-form select:focus, .hd-form textarea:focus,
.hd-filters input:focus, .hd-filters select:focus {
    outline: 3px solid rgba(255, 107, 107, 0.35); outline-offset: 1px; border-color: var(--hd-coral);
}
.hd-form-narrow { max-width: 26rem; }
.hd-form-medium { max-width: 42rem; }
.hd-form .hd-checkbox, .hd-checkbox { font-weight: 500; margin: .5rem 0; display: flex; gap: .5rem; align-items: flex-start; }
.hd-checkbox input { margin-top: .3rem; accent-color: var(--hd-coral-dark); }
.hd-radios .hd-checkbox { margin: .35rem 0; }
.hd-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }

/* Buttons: form submit buttons and .hd-button links look the same */
.hd input[type="submit"], .hd button, .hd-button {
    display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
    padding: 12px 26px; border: 0; border-radius: 999px;
    background: var(--hd-coral-dark); color: #fff !important; text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.hd input[type="submit"]:hover, .hd button:hover, .hd-button:hover {
    transform: translateY(-1px); box-shadow: 0 10px 22px rgba(214, 60, 60, 0.3);
}
.hd-form input[type="submit"] { margin-top: .5rem; }
.hd-filters input[type="submit"], .hd-filters button, .hd-inline-form input[type="submit"] { padding: 8px 18px; }
.hd button[type="button"] { background: var(--hd-navy); }

/* Spam trap: moved off screen so people never see it. */
.hd-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Filter bars above lists */
.hd-filters {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem;
    background: #fff; padding: 12px 14px; border-radius: 14px; box-shadow: var(--hd-shadow-soft);
}
.hd-filters input[type="search"], .hd-filters input[type="month"], .hd-filters select {
    font: inherit; padding: 7px 10px; border: 1px solid rgba(15, 23, 42, 0.18); border-radius: 8px; background: #fff;
}
.hd-filters input[type="search"] { min-width: 14rem; }
.hd-spacer { flex: 1; }
.hd-inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.hd-inline-form label { font-weight: 600; }
.hd-inline-form select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(15, 23, 42, 0.18); }

/* ---- Messages ---- */
.hd-alert { padding: .8rem 1rem; border-radius: 12px; margin: 0 0 1.25rem; border: 1px solid; }
.hd-alert p, .hd-alert ul { margin: .25rem 0; }
.hd-alert-error { background: var(--hd-urgent-bg); border-color: var(--hd-red); color: var(--hd-red); }
.hd-alert-ok { background: #ecfdf3; border-color: var(--hd-green); color: var(--hd-green); }
.hd-alert-warn { background: var(--hd-warn-bg); border-color: #f0b35a; color: #7a2e0e; }
.hd-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* ---- Tables ---- */
.hd-table-wrap { overflow-x: auto; background: #fff; border-radius: 14px; box-shadow: var(--hd-shadow-soft); }
.hd-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hd-table th, .hd-table td { padding: .65rem .75rem; border-bottom: 1px solid rgba(15, 23, 42, 0.08); text-align: left; vertical-align: top; }
.hd-table thead th {
    background: var(--hd-navy-deep); color: #fff; white-space: nowrap;
    font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
}
.hd-table tfoot th { border-top: 2px solid var(--hd-navy-deep); background: var(--hd-row-alt); }
.hd-table tbody tr:nth-child(even) { background: var(--hd-row-alt); }
.hd-table tbody tr.hd-urgent { background: var(--hd-urgent-bg); }
.hd-table tbody tr:hover { background: rgba(102, 126, 234, 0.07); }
.hd-table tr.hd-inactive td { color: var(--hd-muted); }
.hd-table a { font-weight: 700; }

/* ---- Badges ---- */
.hd-badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
    color: #fff; background: var(--hd-gray); vertical-align: middle; white-space: nowrap; font-family: "Manrope", sans-serif;
}
.hd-status-open { background: var(--hd-blue); }
.hd-status-working { background: var(--hd-amber); }
.hd-status-waitingoncustomer { background: var(--hd-gray); }
.hd-status-closed { background: var(--hd-green); }
.hd-priority-down { background: var(--hd-red); }
.hd-priority-high { background: var(--hd-orange); }
.hd-priority-normal { background: #e4e7ec; color: #344054; }
.hd-priority-low { background: #f2f4f7; color: var(--hd-muted); }

/* ---- Ticket page ---- */
.hd-details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.hd-details dt { font-weight: 700; }
.hd-details dd { margin: 0; overflow-wrap: anywhere; }
.hd-timebar { background: #fff; border-left: 4px solid var(--hd-coral); padding: .75rem 1rem; border-radius: 10px; margin: 1rem 0 0; box-shadow: var(--hd-shadow-soft); }

.hd-notes { list-style: none; padding: 0; }
.hd-notes li { background: #fff; border-left: 4px solid var(--hd-border); padding: .6rem 1rem; margin-bottom: .75rem; border-radius: 0 10px 10px 0; }
.hd-notes li.hd-note-customer { border-left-color: var(--hd-blue); }
.hd-note-meta { color: var(--hd-muted); font-size: .88rem; margin-bottom: .25rem; }

.hd-invoice { break-inside: avoid; }

/* ---- Footer ---- */
.hd-footer { background: var(--hd-navy-deep); color: rgba(255, 255, 255, 0.85); }
.hd-footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 32px 6vw;
    display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; justify-content: space-between;
}
.hd-footer img { width: 130px; height: auto; display: block; }
.hd-footer address { font-style: normal; line-height: 1.7; }
.hd-footer strong { color: #fff; }
.hd-footer a { color: #fff; }
.hd-footer a:hover { color: var(--hd-coral); }
.hd-footer-links { display: flex; flex-direction: column; gap: 6px; }
.hd-footer-links span { color: rgba(255, 255, 255, 0.6); font-size: .85rem; margin-top: 6px; }

/* Letterhead only shows on paper */
.hd-letterhead { display: none; }

/* ---- Small screens ---- */
@media (max-width: 900px) {
    .hd-layout { grid-template-columns: 1fr; }
    .hd-aside { position: static; }
}
@media (max-width: 600px) {
    .hd-details { grid-template-columns: 1fr; }
    .hd-details dd { margin-bottom: .5rem; }
    .hd-logo-label { display: none; }
    .hd-header { position: static; }
    .hd-menu a { padding: 6px 10px; }
    .hd-form fieldset { padding: 6px 14px 16px; }
    .hd-footer-inner { flex-direction: column; }
}

/* ---- Printing (billing report, tickets) ---- */
@media print {
    body.hd-body { background: #fff; display: block; }
    .hd-noprint { display: none !important; }
    .hd-letterhead {
        display: flex; gap: 20px; align-items: center; padding: 0 0 12px; margin: 0 0 16px;
        border-bottom: 2px solid #000; font-size: .9rem; line-height: 1.5;
    }
    .hd-letterhead img { width: 150px; height: auto; }
    main.hd { padding: 0; max-width: none; }
    .hd a { color: inherit; text-decoration: none; }
    .hd-table-wrap, .hd-card, .hd-filters, .hd-timebar { box-shadow: none; }
    .hd-table-wrap { overflow: visible; }
    .hd-table thead th { background: #eee; color: #000; }
    .hd-invoice { page-break-before: always; }
}
