/* =========================================================
   ALL ABOUT ROOFING — COMPANY DEVICE SYSTEM
   2000s corporate-intranet inspired interface
   ========================================================= */

:root {
    --navy: #003366;
    --medium-blue: #336699;
    --light-blue: #d6e4f0;
    --lighter-blue: #eef5fb;
    --page-gray: #cfcfcf;
    --border: #7f9db9;
    --dark-border: #666666;
    --light-gray: #eeeeee;
    --yellow: #ffffdd;
    --green: #006600;
    --red: #990000;
    --text: #111111;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--page-gray);
    font-family: Verdana, Arial, Helvetica, sans-serif;
}

button,
input {
    font: inherit;
}

.site-shell {
    width: 780px;
    max-width: calc(100% - 20px);
    margin: 14px auto;
    background: #ffffff;
    border: 1px solid var(--dark-border);
    box-shadow: 1px 1px 0 #ffffff;
}

.site-header {
    padding: 11px 14px 10px;
    color: #ffffff;
    background: var(--navy);
    border-bottom: 4px solid #6699cc;
}

.company-name {
    font-size: 20px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 1px;
}

.system-name {
    margin-top: 3px;
    color: #dceaf7;
    font-size: 10px;
    letter-spacing: 0.2px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    background: #e6e6e6;
    border-bottom: 1px solid #888888;
}

.main-nav a {
    display: block;
    padding: 6px 11px;
    color: #000066;
    border-right: 1px solid #aaaaaa;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.main-nav a:hover {
    background: #d6e4f0;
    text-decoration: underline;
}

.main-nav a.active {
    color: #000000;
    background: #ffffff;
}

.utility-strip {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 9px;
    background: var(--yellow);
    border-bottom: 1px solid #cccc99;
    font-size: 9px;
}

.main-content {
    padding: 10px;
}

.panel {
    margin: 0 0 10px;
    background: #ffffff;
    border: 1px solid var(--border);
}

.panel-title {
    padding: 4px 7px;
    color: var(--navy);
    background: var(--light-blue);
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
}

.panel-body {
    padding: 10px;
    font-size: 10px;
    line-height: 1.55;
}

.panel-body.no-padding {
    padding: 0;
}

.panel-body p:first-child {
    margin-top: 0;
}

.panel-body p:last-child {
    margin-bottom: 0;
}

.small-text {
    color: #555555;
    font-size: 9px;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.status-table th {
    padding: 5px 6px;
    background: #eeeeee;
    border-right: 1px solid #aaaaaa;
    border-bottom: 1px solid #aaaaaa;
    text-align: left;
}

.status-table td {
    padding: 6px;
    border-right: 1px solid #dddddd;
    border-bottom: 1px solid #dddddd;
}

.status-table tr:last-child td {
    border-bottom: 0;
}

.status {
    font-weight: 700;
}

.status-green {
    color: var(--green);
}

.status-blue {
    color: #004c99;
}

.status-red {
    color: var(--red);
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.classic-button {
    min-height: 38px;
    padding: 6px 9px;
    color: #111111;
    background: #eeeeee;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #666666;
    border-bottom: 2px solid #666666;
    border-radius: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.classic-button:hover {
    background: #dceaf7;
}

.classic-button:active {
    border-top-color: #666666;
    border-left-color: #666666;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

.primary-button {
    background: #d6e4f0;
}

.system-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 4px 8px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 9px;
    color: #555555;
    background: #eeeeee;
    border-top: 1px solid #aaaaaa;
    font-size: 8px;
}

/* ---------------- LOGIN / SETUP ---------------- */

.login-page {
    background: #bcbcbc;
}

.login-shell {
    width: 620px;
    margin-top: 55px;
}

.login-main {
    min-height: 330px;
    padding: 35px 50px 45px;
    background: #f7f7f7;
}

.login-panel,
.setup-panel {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.notice-box,
.error-box,
.success-box {
    margin-bottom: 12px;
    padding: 7px 8px;
    border: 1px solid;
    font-size: 9px;
    line-height: 1.45;
}

.notice-box {
    color: #333333;
    background: #ffffe8;
    border-color: #c8c88a;
}

.error-box {
    color: #660000;
    background: #fff0f0;
    border-color: #cc7777;
}

.success-box {
    color: #004d00;
    background: #efffef;
    border-color: #77aa77;
}

.login-form {
    margin: 14px 0 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 135px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-row label {
    font-size: 10px;
    font-weight: 700;
    text-align: right;
}

.form-row input {
    width: 100%;
    height: 27px;
    padding: 3px 5px;
    color: #000000;
    background: #ffffff;
    border-top: 2px solid #777777;
    border-left: 2px solid #777777;
    border-right: 2px solid #dddddd;
    border-bottom: 2px solid #dddddd;
    border-radius: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}

.form-row input:focus {
    outline: 1px dotted #000000;
    outline-offset: 1px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
}

.form-actions .classic-button {
    min-width: 90px;
    min-height: 30px;
}

.login-help {
    margin-top: 16px;
    padding: 7px 8px;
    color: #555555;
    background: #eeeeee;
    border: 1px solid #cccccc;
    font-size: 8px;
    line-height: 1.55;
}

.text-link {
    color: #000099;
}

.text-link:hover {
    text-decoration: none;
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 620px) {
    body,
    .login-page {
        background: #ffffff;
    }

    .site-shell,
    .login-shell {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        box-shadow: none;
    }

    .company-name {
        font-size: 17px;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-nav a {
        padding: 9px 10px;
        border-bottom: 1px solid #aaaaaa;
    }

    .utility-strip {
        flex-direction: column;
        gap: 2px;
    }

    .main-content {
        padding: 8px;
    }

    .login-main {
        min-height: auto;
        padding: 30px 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .form-row label {
        text-align: left;
    }

    .form-row input {
        min-height: 42px;
        font-size: 16px; /* prevents iPhone Safari auto-zoom */
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .classic-button {
        flex: 1;
        min-height: 44px;
        font-size: 12px;
    }

    .button-grid {
        grid-template-columns: 1fr;
    }

    .classic-button {
        min-height: 48px;
        font-size: 11px;
    }

    .system-grid {
        grid-template-columns: 105px 1fr;
    }

    .site-footer {
        flex-direction: column;
        gap: 2px;
    }

    .status-table {
        font-size: 9px;
    }
}

/* =========================================================
   VERSION 0.2 — EMPLOYEE ACCOUNT ADMINISTRATION
   ========================================================= */

a.action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.employee-form {
    margin-top: 8px;
}

.employee-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.employee-form-grid label {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
}

.employee-form-grid input,
.employee-form-grid select,
.pin-mini-input {
    width: 100%;
    min-height: 29px;
    padding: 4px 5px;
    color: #000000;
    background: #ffffff;
    border-top: 2px solid #777777;
    border-left: 2px solid #777777;
    border-right: 2px solid #dddddd;
    border-bottom: 2px solid #dddddd;
    border-radius: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
}

.employee-create-action {
    margin-top: 12px;
}

.account-table-wrap {
    overflow-x: auto;
}

.account-table {
    min-width: 720px;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.pin-mini-input {
    width: 92px;
    min-height: 25px;
    font-size: 9px;
}

.mini-button {
    min-height: 25px;
    padding: 3px 6px;
    color: #111111;
    background: #eeeeee;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #666666;
    border-bottom: 1px solid #666666;
    border-radius: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.mini-button:hover {
    background: #dceaf7;
}

.danger-button {
    color: #8b0000;
    background: #f4dada;
    border-top-color: #fff3f3;
    border-left-color: #fff3f3;
    border-right-color: #7a0000;
    border-bottom-color: #7a0000;
}

.danger-button:hover {
    color: #ffffff;
    background: #a00000;
}

@media (max-width: 620px) {
    .employee-form-grid {
        grid-template-columns: 1fr;
    }

    .employee-form-grid input,
    .employee-form-grid select {
        min-height: 42px;
        font-size: 16px;
    }
}

/* =========================================================
   VERSION 0.3 — DEVICES / SCANNER / CHECKOUT WORKFLOW
   ========================================================= */

.page-actions,
.lookup-row,
.scan-row,
.filters-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.lookup-row input,
.scan-row input,
.filters-row input,
.filters-row select,
.device-form-grid input,
.device-form-grid select,
.device-form-grid textarea,
.checkout-form textarea,
.return-form textarea,
.checkout-form select {
    min-height: 30px;
    padding: 4px 5px;
    border-top: 2px solid #777777;
    border-left: 2px solid #777777;
    border-right: 2px solid #dddddd;
    border-bottom: 2px solid #dddddd;
    border-radius: 0;
    background: #ffffff;
    color: #000000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
}

.lookup-row input,
.scan-row input {
    flex: 1 1 320px;
}

.device-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
}

.device-form-grid .full-width {
    grid-column: 1 / -1;
}

.device-form-grid label,
.checkout-form label,
.return-form label {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
}

.device-form-grid input,
.device-form-grid select,
.device-form-grid textarea,
.checkout-form textarea,
.checkout-form select,
.return-form textarea {
    width: 100%;
}

.device-form-grid textarea,
.checkout-form textarea,
.return-form textarea {
    min-height: 70px;
    resize: vertical;
}

.scan-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.scanner-panel {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #999999;
    background: #f0f0f0;
}

#qr-reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
}

.scan-status {
    margin-top: 6px;
    padding: 5px 6px;
    border: 1px solid #cccccc;
    background: #f4f4f4;
    font-size: 9px;
}

.scan-ok {
    color: #005500;
    background: #efffef;
    border-color: #77aa77;
    font-weight: 700;
}

.scan-warn {
    color: #664400;
    background: #fffbe6;
    border-color: #c9b65b;
}

.scan-error {
    color: #770000;
    background: #fff0f0;
    border-color: #cc7777;
}

.classic-button:disabled,
.mini-button:disabled {
    color: #777777;
    background: #dddddd;
    cursor: not-allowed;
}

.inventory-table-wrap,
.history-table-wrap {
    overflow-x: auto;
}

.inventory-table,
.history-table {
    min-width: 850px;
}

.code-text {
    font-family: "Courier New", Courier, monospace;
    font-size: 9px;
    word-break: break-all;
}

.device-card {
    padding: 9px;
    border: 1px solid #aaaaaa;
    background: #f8f8f8;
}

.device-card-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 8px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.checkbox-row input {
    width: auto;
}

.note-muted {
    color: #666666;
    font-size: 8px;
}

@media (max-width: 620px) {
    .device-form-grid {
        grid-template-columns: 1fr;
    }

    .device-form-grid .full-width {
        grid-column: auto;
    }

    .lookup-row,
    .scan-row,
    .filters-row {
        align-items: stretch;
        flex-direction: column;
    }

    .lookup-row input,
    .scan-row input,
    .filters-row input,
    .filters-row select,
    .device-form-grid input,
    .device-form-grid select,
    .device-form-grid textarea,
    .checkout-form textarea,
    .checkout-form select,
    .return-form textarea {
        min-height: 42px;
        font-size: 16px;
    }

    .device-card-grid {
        grid-template-columns: 1fr;
    }
}
