
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f0f3f8;
    color: #17263c;
    font: 16px system-ui, sans-serif;
}

/* Company header */

header {
    background: #10264b;
    color: white;
    padding: 18px max(16px, calc((100% - 1100px) / 2));
    border-bottom: 5px solid #c52232;
}

header strong {
    font-size: 24px;
    letter-spacing: 1px;
}

header strong span {
    color: #ff6672;
}

header small {
    display: block;
    margin: 4px 0 14px;
}

/* Navigation */

nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 7px;
}

button,
.button {
    border: 0;
    background: #c52232;
    color: #fff;
    padding: 11px 15px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

nav button,
.secondary {
    background: #203b63;
}

nav button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
}

button:disabled {
    opacity: .5;
    cursor: wait;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #d88630;
    outline-offset: 2px;
}

/* Main page */

main {
    max-width: 1100px;
    margin: auto;
    padding: 18px;
}

section,
details,
.panel {
    background: white;
    border: 1px solid #dce2eb;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 14px;
    box-shadow: 0 2px 6px #10264b0a;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
}

h1 {
    font-size: 26px;
}

h2 {
    font-size: 20px;
}

/* Forms */

label {
    display: block;
    font-weight: 600;
    margin: 10px 0 4px;
}

input,
select,
textarea {
    width: 100%;
    font: inherit;
    padding: 10px;
    border: 1px solid #aeb9c9;
    border-radius: 7px;
    background: #fff;
    color: #17263c;
}

input[type="checkbox"] {
    width: auto;
}

textarea {
    min-height: 85px;
}

form button {
    margin-top: 12px;
}

/* Dashboard layout */

.grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 230px), 1fr)
    );
    gap: 12px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.spread {
    justify-content: space-between;
}

.muted {
    color: #52637b;
    font-size: 14px;
}

/* Employee time clock */

.clock {
    font-size: 42px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.big {
    width: 100%;
    padding: 20px;
    font-size: 21px;
}

.green {
    background: #16834a;
}

.danger {
    background: #a41424;
}

/* Photos and tables */

.thumb {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
}

.scroll {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    padding: 9px;
    text-align: left;
    border-bottom: 1px solid #e1e6ed;
    white-space: nowrap;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

/* Blueprint and photo viewer */

.viewer {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    background: white;
}

.viewer canvas,
.viewer img {
    display: block;
    max-width: 100%;
    height: auto;
}

.viewer .overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Advanced drawing toolbar */

.markup-tools {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(130px, 1fr)
    );
    gap: 10px;
    margin: 10px 0;
}

.markup-tools input[type="color"] {
    height: 44px;
    padding: 4px;
}

.drawing-scroll {
    overflow: auto;
    max-height: 75vh;
    background: #e3e8ef;
    overscroll-behavior: contain;
}

.drawing-scroll .viewer {
    display: block;
    width: 100%;
    max-width: none;
}

.drawing-scroll .viewer canvas {
    width: 100%;
    max-width: none;
    height: auto;
}

.drawing-scroll .viewer .overlay {
    height: 100%;
}

.drawing-sheet {
    padding: 6px;
}

/* Notifications */

#notice {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    max-width: 600px;
    margin: auto;
    background: #10264b;
    color: white;
    padding: 12px;
    border-radius: 8px;
    display: none;
    z-index: 10;
}

.pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Animated company logo */

.company-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.company-brand picture {
    display: block;
    flex: 0 0 auto;
    width: 190px;
    height: 80px;
    overflow: hidden;
    background: white;
    border-radius: 8px;
}

.company-logo {
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(-29%);
}

.company-brand strong {
    display: block;
    font-size: 19px;
    letter-spacing: 0;
}

.company-brand small {
    margin: 4px 0 0;
    color: #d5dfec;
}

/* Contractor license */

.logo-lockup {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.license-number {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .25px;
}

/* PDF report logo */

.report-logo {
    display: block;
    width: 190px;
    height: 80px;
    object-fit: cover;
    object-position: center;
    margin-bottom: 12px;
    border-radius: 5px;
}

/* Mobile optimization */

@media (max-width: 600px) {
    header {
        padding: 14px 12px;
    }

    header strong {
        font-size: 20px;
    }

    nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    nav button {
        font-size: 12px;
        padding: 7px 3px;
    }

    main {
        padding: 12px;
    }

    .clock {
        font-size: 36px;
    }

    .company-brand {
        gap: 12px;
    }

    .company-brand picture {
        width: 150px;
        height: 66px;
    }

    .company-brand strong {
        font-size: 15px;
    }

    .company-brand small {
        font-size: 12px;
    }

    .license-number {
        font-size: 12px;
    }
}

/* Printable reports and drawings */

@media print {
    header,
    button,
    form,
    .no-print,
    #notice {
        display: none !important;
    }

    body {
        background: white;
    }

    section {
        box-shadow: none;
        break-inside: avoid;
    }

    main {
        max-width: none;
    }

    .drawing-scroll {
        overflow: visible;
        max-height: none;
    }

    .drawing-scroll .viewer {
        width: 100% !important;
    }

    .drawing-sheet {
        border: 0;
        padding: 0;
    }
}
