/* Shared styles of the app (linked from pwa_head.php, which every app page includes in its <head>). */

/* Action buttons: add class="btn" to any button or submit input.
   Font size = the browser default (13.33px) + 4px. Pages that need a different
   size, padding or shape add a modifier class (see .btn-timer, .sa-submit, ...). */
.btn {
    font-size: 17.33px;
    padding: 6px 16px;
    color: #ffffff;
    background-color: #138741;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn:hover:not(:disabled) {
    background-color: #0f6d34;
}

.btn:focus-visible {
    outline: 3px solid #8fd6ac;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Time entry (timer start / stop / cancel): was 1.1em, now 1.1em + 4px */
.btn.btn-timer {
    font-size: calc(1.1em + 4px);
    padding: 8px 22px;
    border-radius: 4px;
}

/* Tiles: same look as the dashboard quadrants (thin border, rounded corners, light shadow).
   .app-tiles lays tiles out in two columns, one on phones. */
.app-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin: 20px auto 40px;
    padding: 0 16px;
    box-sizing: border-box;
    text-align: left;
}

.app-tile {
    padding: 16px 20px;
    border: 1px solid #e0d4ea;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(28, 16, 38, 0.08);
    box-sizing: border-box;
    color: #000000;
    font-size: 20px;
}

.app-tile h2 {
    margin: 0 0 6px;
    font-size: 1.2em;
    color: #000000;
}

.app-tile-intro {
    margin: 0 0 14px;
    color: #555555;
}

/* Form fields inside a tile: label above the field */
.app-field {
    margin: 0 0 12px;
}

.app-field > label,
.app-field > .app-field-label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    color: #1c1026;
}

.app-tile input[type=text],
.app-tile input[type=email],
.app-tile input[type=date],
.app-tile input[type=time],
.app-tile input[type=number],
.app-tile select,
.app-tile textarea {
    box-sizing: border-box;
    max-width: 100%;
    padding: 7px 10px;
    font-size: 18px;
    border: 1px solid #d8cde0;
    border-radius: 6px;
    background-color: #ffffff;
}

.app-tile input:focus,
.app-tile select:focus,
.app-tile textarea:focus {
    border-color: #7b2d8b;
    outline: 2px solid #eadcf0;
}

.app-field-wide {
    width: 100%;
}

/* A label and its field, kept together when the line wraps */
.app-field-pair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Several small fields on one line (wraps on phones) */
.app-field-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.app-field-hint {
    font-size: 0.9em;
    color: #666666;
}

.app-tile-actions {
    margin-top: 16px;
    text-align: center;
}

/* Six PIN boxes (one digit each), filled by app/pin_input.js */
.pin-container {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.pin-box {
    width: 46px;
    height: 58px;
    font-size: 28px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 8px;
}
.pin-box:focus {
    border-color: #7b2d8b;
    outline: none;
}
.app-notice-ok { color: #138741; font-weight: bold; }
.app-notice-error { color: #b00020; font-weight: bold; }
