/* ─── Skyttedagbok — Delad responsiv CSS ────────────────────────────────────
   Inkludera med: <link rel="stylesheet" href="responsive.css">
   efter Google Fonts-länken i varje fil.
──────────────────────────────────────────────────────────────────────────── */

/* ── Touch-targets ── */
button, a, select, input[type="submit"] {
    min-height: 44px;
}
.btn-add, .btn-edit, .btn-del-akt, .btn-del,
.modal-close, .exp-close, .filter-btn {
    min-height: 36px;
}

/* ── Globalt ── */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img  { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════════════════
   LOGIN & REGISTER
══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .card { padding: 0 4px; }
    .box  { padding: 24px 18px; border-radius: 12px; }
    .logo-wrap { margin-bottom: 20px; }
    .logo-wrap img { width: 100% !important; }
}

/* ══════════════════════════════════════════════════════
   INDEX — Formulär
══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* Header */
    .header { flex-direction: column; align-items: center; gap: 12px; }
    .header-bottom { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
    .logga-img { width: 100% !important; max-width: 100% !important; }

    /* Formulärrutnät: en kolumn */
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }

    /* Typ-toggle: full bredd */
    .typ-toggle label { padding: 14px 8px; font-size: 15px; }

    /* Submit-rad */
    .submit-row {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }
    .submit-row button[type="submit"] { width: 100%; padding: 16px; font-size: 20px; }
    .submit-note { text-align: center; }

    /* Sektionsetiketter */
    .section-label { margin-top: 24px; }

    /* Knappar vid fält-headers */
    .field-header { flex-wrap: wrap; gap: 6px; }
    .btn-add { font-size: 11px; padding: 3px 8px; }

    /* Visa aktiviteter-knapp */
    .btn-aktiviteter { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════
   AKTIVITETER
══════════════════════════════════════════════════════ */
@media (max-width: 700px) {
    /* Header */
    .header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .header-right { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
    .btn-export { flex: 1; justify-content: center; }

    /* Stats: 2 kolumner */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Toolbar: wrap */
    .toolbar { flex-wrap: wrap; }
    .search-wrap { min-width: 100%; order: -1; }
    .filter-btn  { flex: 1; text-align: center; justify-content: center; }

    /* Aktivitetskort: kompaktare */
    .akt-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px 14px;
        padding: 14px 16px;
    }
    .akt-sep { display: none; }
    .akt-right {
        grid-column: 2;
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
        padding-top: 0;
        flex-wrap: wrap;
    }
    .akt-right .tid   { font-size: 13px; }
    .akt-right .langd { margin-top: 0; }
    .btn-edit, .btn-del-akt { margin-top: 0; padding: 6px 12px; }
    .akt-meta { gap: 4px 10px; font-size: 12px; }
    .akt-rubrik { font-size: 14px; }
}

/* ══════════════════════════════════════════════════════
   PLATSER / VAPEN / AMMUNITION / ADMIN — Tabeller
══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Header */
    .header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .btn-back { align-self: flex-start; }

    /* Tabeller: horisontell scroll */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 480px; }
    thead th, tbody td { padding: 10px 12px; font-size: 13px; }

    /* Admin-åtgärder: stapla */
    .actions { flex-direction: column; gap: 4px; }
    .btn-sm  { width: 100%; text-align: center; }
}

/* ══════════════════════════════════════════════════════
   MODALER — alla sidor
══════════════════════════════════════════════════════ */
@media (max-width: 560px) {
    .modal, .exp-modal {
        padding: 20px 16px;
        border-radius: 12px;
        max-height: 95vh;
    }
    .modal .grid-2,
    .exp-row { grid-template-columns: 1fr !important; }
    .modal-footer, .exp-footer { flex-direction: column; }
    .modal-footer .btn-primary,
    .modal-footer .btn-ghost,
    .exp-btn-primary,
    .exp-btn-ghost { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════
   EXPORT-MODAL
══════════════════════════════════════════════════════ */
@media (max-width: 560px) {
    .exp-overlay { padding: 8px; }
    .exp-section-title { font-size: 10px; }
}

/* ══════════════════════════════════════════════════════
   EXTRA LITET (320px — iPhone SE etc.)
══════════════════════════════════════════════════════ */
@media (max-width: 360px) {
    body { padding: 20px 10px 60px; font-size: 14px; }
    .header-text h1 { font-size: 28px; }
    .stat-card .num { font-size: 24px; }
    .akt-date .day  { font-size: 22px; }
}
