/* === Mobile-first Check Writer === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* === Header === */
.app-header {
    background: #336699;
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.header-nav {
    display: flex;
    gap: 4px;
}
.header-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.header-nav a.active, .header-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* === Container === */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
}

/* === Flash Messages === */
.flash {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.flash-info { background: #d1ecf1; color: #0c5460; }

/* === Login === */
.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    margin-top: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.login-card h1 {
    font-size: 1.5rem;
    color: #336699;
    margin-bottom: 8px;
}
.login-desc {
    color: #888;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* === Form Card === */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* === Forms === */
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 16px; /* Prevents iOS zoom */
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: #336699;
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(51,102,153,0.1);
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.amount-words {
    font-size: 0.8rem;
    color: #336699;
    font-style: italic;
    min-height: 1.2rem;
    margin-top: 4px;
}

/* === Toggle rows === */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    cursor: pointer;
}
.toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* === Signature Pad === */
.sig-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}
.sig-container {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    touch-action: none; /* Prevent scroll while signing */
}
.sig-container canvas {
    display: block;
    width: 100%;
    height: 150px;
    cursor: crosshair;
}
.sig-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, transform 0.1s;
    -webkit-appearance: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #336699; color: white; }
.btn-primary:hover { background: #2a5580; }
.btn-secondary { background: #e9ecef; color: #555; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; display: block; }
.btn-large { padding: 16px; font-size: 1.1rem; font-weight: 600; }

/* === Page title === */
.page-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 12px;
}

/* === Check History List === */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.check-item.voided { opacity: 0.5; }
.check-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.check-num { font-weight: 700; color: #336699; font-size: 0.9rem; }
.check-amount { font-weight: 700; font-size: 1.1rem; }
.check-item-mid { margin: 4px 0; }
.check-payee { font-size: 0.95rem; }
.check-item-bot {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}
.badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-printed { background: #d4edda; color: #155724; }
.badge-cleared { background: #d1ecf1; color: #0c5460; }
.badge-voided { background: #f8d7da; color: #721c24; }

.empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 0.95rem;
}
