*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #222;
    min-height: 100vh;
}

.container { max-width: 680px; margin: 0 auto; padding: 16px; }

/* ── Login ── */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 16px;
}
.login-box {
    background: #fff; border-radius: 12px; padding: 32px 28px;
    width: 100%; max-width: 360px; box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 24px; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: #555; }
.field input {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 1rem;
}
.field input:focus { outline: none; border-color: #007aff; }
.error { color: #d00; font-size: .85rem; margin-bottom: 12px; }

/* ── Buttons ── */
.btn {
    display: inline-block; padding: 10px 18px; border-radius: 8px;
    font-size: .9rem; font-weight: 600; border: none; cursor: pointer;
    text-decoration: none; text-align: center;
}
.btn-primary { background: #007aff; color: #fff; width: 100%; padding: 12px; }
.btn-secondary { background: #eee; color: #333; }
.btn-danger { background: #ff3b30; color: #fff; font-size: .8rem; padding: 6px 12px; }
.btn-edit { background: #007aff; color: #fff; font-size: .8rem; padding: 6px 12px; }
.btn-pdf { background: #34c759; color: #fff; }

/* ── Header ── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0 16px; gap: 8px; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.2rem; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.logout-link { font-size: .85rem; color: #888; text-decoration: none; }

/* ── Issue cards ── */
.issue-list { display: flex; flex-direction: column; gap: 12px; }
.issue-card {
    background: #fff; border-radius: 12px; padding: 12px;
    display: flex; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.issue-thumb {
    width: 90px; height: 80px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0;
}
.issue-body { flex: 1; min-width: 0; }
.issue-note { font-size: .95rem; line-height: 1.4; word-break: break-word; }
.issue-note.empty { color: #aaa; font-style: italic; }
.issue-meta { font-size: .75rem; color: #999; margin: 4px 0 8px; }
.issue-actions { display: flex; gap: 6px; }
.empty-state { text-align: center; color: #aaa; padding: 48px 16px; font-size: 1rem; }

/* ── Add/Edit form ── */
.form-card {
    background: #fff; border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.photo-input-wrap { margin-bottom: 16px; }
.photo-input-wrap label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; color: #555; }
.photo-input-wrap input[type=file] { width: 100%; }
.photo-preview {
    width: 100%; max-height: 260px; object-fit: contain;
    border-radius: 8px; margin-top: 10px; display: none;
}
.existing-photo { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-bottom: 10px; }
.note-wrap { margin-bottom: 16px; }
.note-wrap label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; color: #555; }
.note-wrap textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 1rem; resize: vertical; min-height: 100px;
}
.note-wrap textarea:focus { outline: none; border-color: #007aff; }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn { flex: 1; }

@media (max-width: 400px) {
    .topbar { flex-direction: column; align-items: flex-start; }
}
