/* =========================================================
   MYQDPA
   MAIN APPLICATION STYLESHEET
   ========================================================= */


/* =========================================================
   COLOURS
   ========================================================= */

:root {
    --background: #0d1726;
    --header: #101e30;

    --card: #162538;
    --card-secondary: #1b2c42;

    --border: #2c4058;

    --text: #d8dee7;
    --text-muted: #8f9bab;
    --heading: #eef2f6;

    --blue: #168cf5;
    --blue-bright: #18c8e8;
    --blue-hover: #36a4ff;

    --input: #101c2b;

    --table-header: #1d3047;
    --table-hover: #1b2e44;

    --danger: #8b3540;
    --danger-border: #a94753;
    --danger-hover: #a6404d;
}


/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}


html {
    margin: 0;
    padding: 0;
}


body {
    margin: 0;
    padding: 0;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;

    background: var(--background);
    color: var(--text);
}


/* =========================================================
   HEADER
   ========================================================= */

.app-header {
    width: 100%;

    background: var(--header);

    border-bottom: 1px solid var(--border);
}


.header-inner {
    width: 100%;
    max-width: 1200px;
    height: 76px;

    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.brand-link {
    display: flex;
    align-items: center;

    text-decoration: none;
}


.brand-logo {
    display: block;

    width: auto;
    height: 48px;

    object-fit: contain;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.main-nav {
    display: flex;
    align-items: center;

    gap: 8px;
}


.main-nav a {
    display: block;

    padding: 10px 15px;

    border-radius: 6px;

    color: var(--text-muted);

    text-decoration: none;
    font-weight: 600;
}


.main-nav a:hover {
    color: var(--heading);

    background: var(--card-secondary);
}


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

    background: #176fc0;
}


/* Logout deliberately looks like navigation rather
   than a large application button. */

.logout-form {
    margin: 0;
    padding: 0;
}


button.nav-logout {
    padding: 10px 15px;

    border: none;
    border-radius: 6px;

    background: transparent;
    color: var(--text-muted);

    font-size: 15px;
    font-weight: 600;
}


button.nav-logout:hover {
    background: var(--card-secondary);

    color: var(--heading);
}


/* =========================================================
   PAGE
   ========================================================= */

.page-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;
    padding: 32px 24px 60px 24px;
}


/* =========================================================
   HEADINGS
   ========================================================= */

h1 {
    margin: 0 0 24px 0;

    color: var(--heading);

    font-size: 28px;
}


h2 {
    margin: 32px 0 16px 0;

    color: var(--heading);

    font-size: 21px;
}


h3 {
    margin: 24px 0 12px 0;

    color: var(--heading);

    font-size: 17px;
}


.card-heading {
    margin-top: 0;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    width: 100%;

    margin: 0 0 24px 0;
    padding: 20px;

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 9px;
}


/* =========================================================
   TEXT AND LINKS
   ========================================================= */

.muted {
    color: var(--text-muted);
}


a {
    color: #56b3ff;
}


a:hover {
    color: var(--blue-bright);
}


/* =========================================================
   FORM CONTROLS
   ========================================================= */

label {
    color: var(--text);

    font-weight: 600;
}


input,
select {
    padding: 9px 10px;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--input);
    color: var(--text);

    font-family: inherit;
    font-size: 14px;
}


input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
select {
    text-align: left;
}


input[type="number"] {
    text-align: right;
}


input:focus,
select:focus {
    outline: 2px solid var(--blue);

    border-color: var(--blue);
}


/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

button {
    padding: 9px 15px;

    border: 1px solid #3178b7;
    border-radius: 5px;

    background: #176fc0;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}


button:hover {
    background: var(--blue);
}


/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.button-secondary {
    display: inline-block;

    padding: 7px 12px;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--card-secondary);
    color: var(--text);

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;

    cursor: pointer;
}


.button-secondary:hover {
    background: var(--table-hover);

    border-color: #45617e;

    color: var(--heading);
}


/* =========================================================
   DANGER BUTTON
   ========================================================= */

button.button-danger {
    background: var(--danger);

    border-color: var(--danger-border);

    color: #ffffff;
}


button.button-danger:hover {
    background: var(--danger-hover);

    border-color: #bd5360;
}


/* =========================================================
   GENERIC FORM LAYOUT
   ========================================================= */

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;

    gap: 12px;
}


.form-group {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px;
}


/* =========================================================
   TABLES
   ========================================================= */

table {
    width: 100%;

    border-collapse: collapse;

    background: var(--card-secondary);

    border: 1px solid var(--border);
}


th,
td {
    padding: 10px 12px;

    border-bottom: 1px solid var(--border);

    text-align: left;
}


th {
    background: var(--table-header);

    color: var(--heading);

    font-weight: 700;
}


th.numeric,
td.numeric {
    text-align: right;

    font-variant-numeric: tabular-nums;
}


th.date,
td.date {
    text-align: left;

    white-space: nowrap;
}


tbody tr:hover {
    background: var(--table-hover);
}


tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   MANAGE
   ========================================================= */

.field-client-name {
    width: 360px;
}


.field-client-select {
    width: 280px;
}


.field-project-name {
    width: 360px;
}


/* =========================================================
   MANAGE - INLINE EDITING
   ========================================================= */

.manage-table-wrapper {
    width: 100%;

    overflow-x: auto;
}


.manage-inline-form {
    display: flex;
    align-items: end;

    gap: 12px;

    width: 100%;
}


.manage-inline-project-form {
    display: grid;

    grid-template-columns:
        minmax(180px, 1.2fr)
        minmax(240px, 2fr)
        90px
        130px
        auto;

    align-items: end;

    gap: 12px;

    width: 100%;
}


.manage-inline-grow {
    flex: 1;
}


.manage-inline-form input,
.manage-inline-project-form input,
.manage-inline-project-form select {
    min-height: 40px;
}


.manage-inline-form .manage-inline-grow input,
.manage-inline-project-form .manage-inline-grow input {
    width: 100%;
}


.manage-inline-actions {
    display: flex;
    align-items: center;

    gap: 8px;
}


.manage-edit-row td {
    padding-top: 14px;
    padding-bottom: 14px;

    background: var(--table-hover);
}


/* =========================================================
   TIMER
   ========================================================= */

.work-selection-row {
    display: flex;
    flex-direction: column;

    width: 100%;

    gap: 16px;
}


.work-field {
    display: flex;
    flex-direction: column;

    width: 100%;

    gap: 6px;
}


.timer-input {
    width: 100%;

    min-height: 44px;
}


.time-entry-actions {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-top: 20px;
}


.timer-start-button {
    min-width: 180px;
    min-height: 46px;

    font-size: 16px;
}


/* =========================================================
   MANUAL TIME
   ========================================================= */

.manual-time-section {
    margin-top: 20px;
}


.manual-divider {
    margin-bottom: 20px;

    border-top: 1px solid var(--border);
}


.manual-time-row {
    display: grid;

    grid-template-columns:
        minmax(180px, 1.4fr)
        minmax(130px, 1fr)
        minmax(130px, 1fr);

    gap: 16px;

    max-width: 650px;
}


.manual-actions {
    display: flex;

    gap: 10px;

    margin-top: 18px;
}


/* =========================================================
   RUNNING TIMER
   ========================================================= */

.timer-status {
    margin-bottom: 12px;

    text-align: center;

    color: var(--blue-bright);

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 1.5px;
}


.running-project {
    text-align: center;

    color: var(--text-muted);

    font-size: 14px;
}


.running-project-name {
    text-align: center;

    color: var(--heading);

    font-size: 22px;
    font-weight: 700;
}


.running-description {
    margin-top: 6px;

    text-align: center;

    color: var(--text);
}


.timer-clock {
    margin: 28px 0;

    text-align: center;

    color: var(--heading);

    font-size: 42px;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
}


.timer-stop-button {
    display: block;

    width: 100%;
    min-height: 52px;

    background: var(--danger);

    border-color: var(--danger-border);

    font-size: 17px;
}


.timer-stop-button:hover {
    background: var(--danger-hover);
}


/* =========================================================
   TODAY
   ========================================================= */

.today-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 16px;
}


.today-heading h2 {
    margin: 0;
}


.today-total {
    color: var(--text-muted);
}


.today-total strong {
    margin-left: 6px;

    color: var(--heading);

    font-variant-numeric: tabular-nums;
}


.today-row {
    width: 100%;

    display: grid;

    grid-template-columns:
        1.2fr
        1.4fr
        2fr
        100px
        70px;

    column-gap: 20px;

    align-items: center;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}


.today-header {
    padding-top: 0;
    padding-bottom: 9px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}


.today-client,
.today-project,
.today-task {
    min-width: 0;

    font-size: 14px;
}


.today-project {
    font-weight: 600;
}


.today-hours {
    text-align: right;

    color: var(--heading);

    font-weight: 700;

    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}


.today-action {
    text-align: right;

    white-space: nowrap;
}


.today-entries .today-row:last-child {
    border-bottom: none;
}


/* =========================================================
   EDIT FORMS
   ========================================================= */

.edit-form-card,
.edit-danger-card {
    width: 100%;
}


.edit-form-card form {
    width: 100%;
    max-width: 720px;
}


.edit-form-group {
    display: flex;
    flex-direction: column;

    width: 100%;

    gap: 6px;

    margin-bottom: 18px;
}


.edit-form-group input,
.edit-form-group select,
.edit-input {
    width: 100%;

    min-height: 44px;
}


.edit-date-time-row {
    display: grid;

    grid-template-columns:
        1.4fr
        1fr
        1fr;

    gap: 16px;

    width: 100%;
}


.edit-form-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 24px;
}


.edit-danger-card h2 {
    margin-top: 0;
}


/* =========================================================
   SETTINGS
   ========================================================= */

.settings-card {
    max-width: 720px;
}


.settings-form {
    width: 100%;
}


.settings-field {
    display: flex;
    flex-direction: column;

    gap: 6px;

    width: 100%;
}


.settings-field select {
    width: 100%;
    min-height: 44px;
}


.settings-help {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 13px;
}


.settings-actions {
    display: flex;

    margin-top: 24px;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-container {
    display: flex;
    justify-content: center;

    width: 100%;

    padding-top: 50px;
}


.login-card {
    width: 100%;
    max-width: 420px;
}


.login-card h1 {
    margin-bottom: 5px;
}


.login-intro {
    margin-top: 0;
    margin-bottom: 22px;

    color: var(--text-muted);
}


.login-form {
    width: 100%;
}


.login-form input {
    width: 100%;
    min-height: 44px;
}


.login-button {
    width: 100%;
    min-height: 44px;

    margin-top: 18px;
}


.login-error {
    margin-bottom: 16px;
    padding: 9px 11px;

    border: 1px solid var(--danger-border);
    border-radius: 5px;

    background: rgba(139, 53, 64, 0.18);
    color: #f1c8cd;

    font-size: 14px;
}

/* =========================================================
   FORM VALIDATION ERROR
   ========================================================= */

.form-error {
    margin-bottom: 16px;
    padding: 9px 11px;

    border: 1px solid var(--danger-border);
    border-radius: 5px;

    background: rgba(139, 53, 64, 0.18);
    color: #f1c8cd;

    font-size: 14px;
}



/* =========================================================
   PHONE / SMALL TABLET
   ========================================================= */

@media screen and (max-width: 700px) {


    /* GLOBAL PHONE DENSITY */

    body {
        font-size: 14px;
        line-height: 1.4;
    }


    h1 {
        margin-bottom: 16px;

        font-size: 24px;
    }


    h2 {
        margin-top: 22px;
        margin-bottom: 11px;

        font-size: 19px;
    }


    h3 {
        margin-top: 18px;
        margin-bottom: 9px;

        font-size: 16px;
    }


    /* HEADER */

    .header-inner {
        height: auto;

        padding: 10px 12px;

        flex-direction: column;
        align-items: flex-start;

        gap: 8px;
    }


    .brand-logo {
        height: 38px;
    }


    /* NAVIGATION */

    .main-nav {
        width: 100%;

        gap: 4px;

        overflow-x: auto;
    }


    .main-nav a,
    button.nav-logout {
        padding: 6px 9px;

        font-size: 13px;

        white-space: nowrap;
    }


    /* PAGE */

    .page-container {
        padding: 16px 10px 32px 10px;
    }


    .card {
        margin-bottom: 16px;

        padding: 13px;

        border-radius: 7px;
    }


    .card-heading {
        margin-bottom: 11px;
    }


    /* FORM CONTROLS */

    label {
        font-size: 13px;
    }


    input,
    select {
        padding: 7px 9px;

        font-size: 13px;
    }


    button {
        padding: 8px 12px;

        font-size: 13px;
    }


    .button-secondary {
        padding: 6px 10px;

        font-size: 13px;
    }


    .form-row {
        flex-direction: column;

        align-items: stretch;

        gap: 9px;
    }


    .form-group {
        gap: 3px;
    }


    .actions {
        gap: 6px;
    }


    .field-client-name,
    .field-client-select,
    .field-project-name {
        width: 100%;
    }


    /* MANAGE */

    .manage-inline-form,
    .manage-inline-project-form {
        display: flex;
        flex-direction: column;

        align-items: stretch;

        width: 100%;

        gap: 9px;
    }


    .manage-inline-form .form-group,
    .manage-inline-project-form .form-group {
        width: 100%;
    }


    .manage-inline-form input,
    .manage-inline-project-form input,
    .manage-inline-project-form select {
        width: 100%;

        min-height: 38px;
    }


    .manage-inline-actions {
        width: 100%;

        gap: 6px;
    }


    .manage-inline-actions button {
        flex: 1;
    }


    .manage-edit-row td {
        padding-top: 10px;
        padding-bottom: 10px;
    }


    /* TIMER */

    .work-selection-row {
        gap: 10px;
    }


    .work-field {
        gap: 3px;
    }


    .timer-input {
        min-height: 40px;
    }


    .time-entry-actions {
        flex-direction: column;

        align-items: stretch;

        gap: 8px;

        margin-top: 13px;
    }


    .timer-start-button {
        width: 100%;

        min-height: 42px;

        font-size: 14px;
    }


    .time-entry-actions .button-secondary {
        width: 100%;

        text-align: center;
    }


    /* MANUAL TIME */

    .manual-time-section {
        margin-top: 14px;
    }


    .manual-divider {
        margin-bottom: 13px;
    }


    .manual-time-row {
        grid-template-columns: 1fr;

        gap: 9px;

        max-width: none;
    }


    .manual-actions {
        flex-direction: column;

        gap: 7px;

        margin-top: 12px;
    }


    .manual-actions button {
        width: 100%;
    }


    /* RUNNING TIMER */

    .timer-status {
        margin-bottom: 7px;

        font-size: 11px;
    }


    .running-project {
        font-size: 13px;
    }


    .running-project-name {
        font-size: 19px;
    }


    .running-description {
        margin-top: 3px;

        font-size: 13px;
    }


    .timer-clock {
        margin: 20px 0;

        font-size: 34px;
    }


    .timer-stop-button {
        min-height: 44px;

        font-size: 15px;
    }


    /* TODAY */

    .today-heading {
        gap: 10px;

        margin-bottom: 10px;
    }


    .today-total {
        font-size: 13px;
    }


    .today-header,
    .today-header > div {
        display: none !important;
    }


    .today-entries .today-row {
        display: grid;

        grid-template-columns:
            minmax(0, 1fr)
            auto;

        grid-template-rows:
            auto
            auto
            auto;

        column-gap: 10px;
        row-gap: 1px;

        padding: 11px 0;
    }


    .today-entries .today-client {
        grid-column: 1;
        grid-row: 1;

        font-size: 13px;
        font-weight: 600;
    }


    .today-entries .today-project {
        grid-column: 1;
        grid-row: 2;

        color: var(--heading);

        font-size: 13px;
    }


    .today-entries .today-task {
        grid-column: 1;
        grid-row: 3;

        color: var(--text-muted);

        font-size: 12px;
    }


    .today-entries .today-hours {
        grid-column: 2;
        grid-row: 1;

        align-self: start;

        font-size: 13px;
    }


    .today-entries .today-action {
        display: block;

        grid-column: 2;
        grid-row: 2 / 4;

        align-self: center;
    }


    /* EDIT FORMS */

    .edit-form-card form {
        max-width: none;
    }


    .edit-form-group {
        gap: 3px;

        margin-bottom: 12px;
    }


    .edit-form-group input,
    .edit-form-group select,
    .edit-input {
        min-height: 40px;
    }


    .edit-date-time-row {
        grid-template-columns: 1fr;

        gap: 0;
    }


    .edit-form-actions {
        flex-direction: column;

        align-items: stretch;

        gap: 7px;

        margin-top: 16px;
    }


    .edit-form-actions button,
    .edit-form-actions .button-secondary {
        width: 100%;

        text-align: center;
    }


    button.button-danger {
        width: 100%;
    }


    /* SETTINGS */

    .settings-card {
        max-width: none;
    }


    .settings-field {
        gap: 3px;
    }


    .settings-field select {
        min-height: 40px;
    }


    .settings-help {
        margin-top: 1px;

        font-size: 12px;
    }


    .settings-actions {
        margin-top: 16px;
    }


    .settings-actions button {
        width: 100%;
    }


    /* LOGIN */

    .login-container {
        padding-top: 25px;
    }


    .login-card {
        max-width: none;
    }


    .login-intro {
        margin-bottom: 16px;
    }


    .login-form input {
        min-height: 40px;
    }


    .login-button {
        min-height: 42px;

        margin-top: 13px;
    }


    .login-error {
        margin-bottom: 12px;

        padding: 7px 9px;

        font-size: 13px;
    }


    /* TABLES */

    table {
        font-size: 12px;
    }


    th,
    td {
        padding: 6px 7px;
    }

}

/* =========================================================
   FINISH NEXT DAY
   ========================================================= */

.manual-next-day,
.edit-next-day {
    margin-top: 10px;
}


.checkbox-label {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    min-height: 32px;

    color: var(--text);

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}


.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;

    margin: 0;

    cursor: pointer;
}

/* =========================================================
   HISTORY TABLE
   ========================================================= */

.history-table {
    font-size: 13px;
}


.history-table th,
.history-table td {
    padding-left: 8px;
    padding-right: 8px;
}
