/* CallOff - Dyna-Mix WV
----------------------------------------------------------*/

:root {
    --ink: #1f2933;
    --muted: #616e7c;
    --line: #e4e7eb;
    --bg: #f2f4f7;
    --card: #ffffff;
    --brand: #1f2a37;
    --accent: #c99a2e;
    --link: #1d5fbf;
    --new: #b54708;
    --new-bg: #fef0c7;
    --open: #175cd3;
    --open-bg: #d1e9ff;
    --closed: #067647;
    --closed-bg: #d3f8df;
    --danger: #b42318;
    --app: #1f6f8b;
    --app-dark: #17546a;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* PRIMARY LAYOUT
----------------------------------------------------------*/

.page { max-width: 1440px; margin: 0 auto; padding: 0 12px; }

.header {
    background: var(--brand);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}

.header .bar {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header img { height: 34px; display: block; }
.header a.homelink { display: block; }
.header .apptitle { font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.header .apptitle a { color: #fff; }
.header .apptitle a:hover { text-decoration: none; }
.header .sub { color: #cbd2d9; font-size: 13px; }
.header .spacer { flex: 1; }
@media (max-width: 700px) { .header .sub { display: none; } }
.header .appmark { width: 32px; height: 32px; border-radius: 7px; background: var(--app); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }

.main { padding: 20px 0 30px 0; }

.footer {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 20px 24px 20px;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

/* BUTTONS AND INPUTS
----------------------------------------------------------*/

.btn, a.btn {
    display: inline-block;
    border: 1px solid #cbd2d9;
    background: #fff;
    color: var(--ink);
    padding: 7px 14px;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    text-decoration: none;
}

.btn:hover, a.btn:hover { background: #f5f7fa; text-decoration: none; }
.btn-primary, a.btn-primary { background: var(--link); border-color: var(--link); color: #fff; }
.btn-primary:hover, a.btn-primary:hover { background: #174ea6; }
.btn-accent, a.btn-accent { background: var(--app); border-color: var(--app); color: #fff; }
.btn-accent:hover, a.btn-accent:hover { background: var(--app-dark); }
.btn-danger, a.btn-danger { color: var(--danger); border-color: #fda29b; }
.btn-danger:hover, a.btn-danger:hover { background: #fef3f2; }
.btn-success, a.btn-success { background: var(--closed); border-color: var(--closed); color: #fff; }
.btn-success:hover, a.btn-success:hover { background: #05603a; }
.btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

input[type="text"], input[type="date"], input[type="number"], select, textarea {
    font: inherit;
    color: var(--ink);
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    padding: 7px 9px;
    background: #fff;
    max-width: 100%;
}

input[type="text"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
    outline: 2px solid #84adff;
    outline-offset: 0;
    border-color: #84adff;
}

textarea { width: 100%; resize: vertical; }

.invalid { background: #fffbe6 !important; border-color: #f79009 !important; }

/* LIST PAGE
----------------------------------------------------------*/

.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; margin: 0; font-weight: 600; }
.pagehead .spacer { flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.current { color: var(--ink); border-bottom-color: var(--app); }

.count {
    background: #e4e7eb;
    color: var(--ink);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
}

.tabs a.current .count { background: var(--app); color: #fff; }

.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.filters .search { width: 280px; }
.filters .spacer { flex: 1; }
.filters .jump { width: 90px; }

.resultinfo { color: var(--muted); margin: 0 0 8px 2px; font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); }
table.grid th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    background: #f8f9fb;
    border-bottom: 1px solid var(--line);
    padding: 9px 6px;
    white-space: nowrap;
}
table.grid th a { color: var(--muted); }
table.grid th.sortable a { display: inline-flex; align-items: center; gap: 5px; }
table.grid th.sortable a:after { content: ""; width: 8px; height: 12px; flex: none; opacity: .45;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1 4.5L4 1.5L7 4.5M1 7.5L4 10.5L7 7.5' fill='none' stroke='%23616e7c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center; }
table.grid th.sortable a:hover { color: var(--ink); text-decoration: none; }
table.grid th.sortable a:hover:after { opacity: 1; }
table.grid th.sorted-asc, table.grid th.sorted-desc { background: #eef2f6; }
table.grid th.sorted-asc a, table.grid th.sorted-desc a { color: var(--ink); }
table.grid th.sorted-asc a:after { opacity: 1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1 7.5L4 4.5L7 7.5' fill='none' stroke='%23c2491f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
table.grid th.sorted-desc a:after { opacity: 1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1 4.5L4 7.5L7 4.5' fill='none' stroke='%23c2491f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
table.grid td { padding: 9px 6px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.grid tr.row:hover td { background: #f5f8ff; cursor: pointer; }
table.grid td.num { font-weight: 600; white-space: nowrap; }
table.grid td.nowrap { white-space: nowrap; }
table.grid td.clip { color: var(--muted); }
@media (max-width: 1200px) { table.grid td { white-space: normal; } table.grid td.clip { max-width: 260px; } }
table.grid .empty td { text-align: center; color: var(--muted); padding: 30px; }
table.grid tr.pager td { background: #f8f9fb; text-align: center; border-bottom: 0; }
table.grid tr.pager table { margin: 0 auto; }
table.grid tr.pager td td { padding: 4px 8px; background: transparent; }

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}

.pill-NEW { color: var(--new); background: var(--new-bg); }
.pill-OPEN { color: var(--open); background: var(--open-bg); }
.pill-CLOSED { color: var(--closed); background: var(--closed-bg); }
.flag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--danger); background: #fef3f2; border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.age { white-space: nowrap; }
.age-warn { color: var(--new); font-weight: 600; }
.age-late { color: var(--danger); font-weight: 700; }
table.grid tr.row-new td:first-child { box-shadow: inset 3px 0 0 var(--app); }

/* DETAIL PAGE
----------------------------------------------------------*/

.crumb { margin-bottom: 12px; }
a.backlink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand); background: #fff; border: 1px solid #cbd2d9; border-radius: 6px; padding: 6px 12px 6px 10px; }
a.backlink:hover { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }

.detailhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.detailhead h1 { font-size: 24px; margin: 0; font-weight: 600; }
.detailhead .spacer { flex: 1; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.section { padding: 16px 18px; margin-bottom: 16px; }
.section h2 { font-size: 15px; margin: 0 0 12px 0; font-weight: 600; }
.section .text { white-space: pre-wrap; line-height: 1.5; }

dl.facts { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-tool, a.btn-tool { display: inline-flex; align-items: center; gap: 6px; }
.btn-tool svg { color: var(--muted); }

.section .issuetext { font-size: 15px; }

dl.factgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
dl.factgrid > div { min-width: 0; }
dl.factgrid .span2 { grid-column: span 2; }
dl.factgrid .span4 { grid-column: 1 / -1; }
dl.factgrid dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
dl.factgrid dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
dl.factgrid dd:empty:before { content: "-"; color: #cbd2d9; }
@media (max-width: 1100px) { dl.factgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .pair { grid-template-columns: 1fr; gap: 0; } }

.resolution { border-left: 4px solid var(--closed); }

dl.factrow + dl.factrow { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

.actionlist { display: flex; flex-direction: column; gap: 8px; }
.actionlist .btn { display: block; text-align: center; padding: 9px 14px; }
.btn-success.btn-tool svg { color: #fff; }

.printhead { display: none; }

.panel { border: 1px solid #b2ccff; background: #f5f8ff; border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 12px 0; }
.panel .buttons { margin-top: 12px; display: flex; gap: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--line); padding: 2px 0 14px 14px; position: relative; }
.timeline li:before { content: ""; position: absolute; left: -7px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--app); }
.timeline .who { font-weight: 600; }
.timeline .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.timeline .what { white-space: pre-wrap; margin-top: 3px; line-height: 1.45; }
.muted { color: var(--muted); }

/* FORMS
----------------------------------------------------------*/

.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.formgrid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .formgrid { grid-template-columns: 1fr; } }

.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field label .req { color: var(--danger); }
.field input[type="text"], .field input[type="date"], .field select { width: 100%; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.checks.vertical { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 8px; align-items: start; }
.checks.vertical input { width: auto; margin: 3px 0 0 0; }
.checks.vertical label { display: block; cursor: pointer; }

/* Add / edit form: everything on one screen */
.editcard { padding: 16px 18px; }
.editgrid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start; }
.fields6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 16px; }
.fields6 .span2 { grid-column: span 2; }
.fields6 .span3 { grid-column: span 3; }
.fields6 .span6 { grid-column: 1 / -1; }
.fields6 .field input[type="text"], .fields6 .field select { padding: 6px 8px; }
.fields6 .field textarea { min-height: 96px; }
.flagbox { background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.flagbox h2 { font-size: 14px; margin: 0 0 10px 0; font-weight: 600; }
.flagbox .field select { width: 100%; }
.editcard .formbar { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) {
    .editgrid { grid-template-columns: 1fr; }
    .fields6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fields6 .span3 { grid-column: 1 / -1; }
}
.checks label { font-weight: 500; }

.formbar { display: flex; gap: 8px; margin-top: 18px; }

/* Phone pages: sign-in and call-off
----------------------------------------------------------*/

.phone { max-width: 480px; margin: 0 auto; }
.phone .card { padding: 18px 16px; margin-bottom: 14px; }
.phone h1 { font-size: 20px; margin: 0 0 4px 0; }
.phone .lead { color: var(--muted); margin: 0 0 16px 0; }
.phone .field { margin-bottom: 14px; }
.phone .field label { font-size: 14px; }
.phone .field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.phone input[type="text"], .phone input[type="password"], .phone input[type="date"], .phone input[type="time"], .phone select, .phone textarea {
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    width: 100%;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    padding: 10px 11px;
    background: #fff;
}
.phone input:focus, .phone select:focus, .phone textarea:focus { outline: 2px solid var(--app); outline-offset: 0; border-color: var(--app); }
.phone textarea { min-height: 90px; resize: vertical; }
.phone .btn { font-size: 16px; padding: 11px 16px; }
.phone .btn-block { display: block; width: 100%; }
.phone .who { display: flex; align-items: center; gap: 10px; }
.phone .who .name { font-weight: 700; font-size: 17px; }
.phone .who .spacer { flex: 1; }

/* Call type as three big choices */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choices input { position: absolute; opacity: 0; }
.choices label { display: block; text-align: center; border: 1px solid #cbd2d9; border-radius: 6px; padding: 11px 4px; font-weight: 600; cursor: pointer; background: #fff; }
.choices input:checked + label { background: var(--app); border-color: var(--app); color: #fff; }
.choices input:focus-visible + label { outline: 2px solid var(--app-dark); outline-offset: 2px; }

.checkline { display: flex; gap: 10px; align-items: flex-start; }
.checkline input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

.notice { border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; }
.notice-error { background: #fee4e2; color: var(--danger); }
.notice-ok { background: #d3f8df; color: #054f31; }

.confirm { text-align: center; }

table.mine { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mine th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.mine td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
table.mine .void td { color: var(--muted); text-decoration: line-through; }
table.grid tr.void td { color: var(--muted); text-decoration: line-through; }

/* HR to-do actions and the weekly list's day rows */
td.todo-actions { white-space: nowrap; }
td.todo-actions .btn { margin: 2px 4px 2px 0; }
.hoursbox { width: 70px !important; display: inline-block !important; margin-right: 4px; }
table.grid tr.dayrow th { background: #eef1f5; text-align: left; font-size: 14px; padding-top: 10px; }
table.grid tr.dayrow th .muted { font-weight: 400; margin-left: 6px; }
table.grid tr.none td { color: var(--muted); font-style: italic; }

/* Bot trap field on the sign-in forms: off screen, not display:none, which some bots skip */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
