/* ============================================================
   Backa Scoutkår – Ekonomisystem
   css/app.css – Grafisk profil
   Ladda upp till: www/ekonomi/css/app.css

   Färger hämtade från Backa Scoutkårs logotyp:
   Mörkblå: #1F4F6D  (kårmärkets kontur, Scouterna blå)
   Mellanblå: #479CD0 (kårmärkets bakgrund)
   Ljusblå:  #67D3FF (detaljer)
   Vit:      #FFFFFF
   ============================================================ */

/* --- Reset & grund ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-dark:   #1F4F6D;   /* Primär – mörk scoutblå */
    --blue-mid:    #2a6a93;   /* Hover-blå */
    --blue-light:  #479CD0;   /* Accentblå */
    --blue-pale:   #e8f4fb;   /* Bakgrundston */
    --blue-border: #b8d9ee;   /* Kanter */
    --white:       #ffffff;
    --gray-50:     #f8fafc;
    --gray-100:    #f0f4f8;
    --gray-200:    #e2eaf1;
    --gray-400:    #94a3b8;
    --gray-600:    #475569;
    --gray-800:    #1e293b;
    --green:       #15803d;
    --red:         #b91c1c;
    --orange:      #c2410c;
    --radius:      8px;
    --radius-lg:   12px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
}

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* --- NAVBAR ----------------------------------------------- */
.navbar {
    background: var(--white);
    color: var(--blue-dark);
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 3px solid var(--blue-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--blue-dark);
    flex-shrink: 0;
}

.nav-logo {
    height: 36px;
    width: auto;
    /* Loggan visas i originalfärger mot vit bakgrund */
}

.nav-brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: var(--blue-dark);
}

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: var(--blue-dark);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--blue-pale);
    color: var(--blue-dark);
}

.nav-link.active {
    background: var(--blue-dark);
    color: var(--white);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-username {
    font-size: 13px;
    color: var(--blue-dark);
}

.nav-role {
    font-size: 12px;
    color: var(--gray-400);
}

.btn-logout {
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.30);
    padding: 4px 12px;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.btn-logout:hover {
    color: var(--white);
    border-color: var(--white);
    background: rgba(255,255,255,0.10);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--blue-dark);
    font-size: 22px;
    cursor: pointer;
    margin-left: auto;
}

/* --- MAIN ------------------------------------------------- */
.main-content {
    flex: 1;
    padding: 28px 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- SIDHUVUD --------------------------------------------- */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue-dark);
}

.page-header p {
    color: var(--gray-600);
    font-size: 14px;
    margin-top: 4px;
}

/* --- KORT ------------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--blue-pale);
}

/* --- STATISTIKKORT --------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    border-left: 4px solid var(--blue-light);
}

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue-dark);
}

.stat-card.positive .stat-value { color: var(--green); }
.stat-card.negative .stat-value { color: var(--red); }
.stat-card.neutral  .stat-value { color: var(--blue-light); }

/* --- SNABBMENY ------------------------------------------- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200);
    padding: 18px;
    text-decoration: none;
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}

.action-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-light);
    transform: translateY(-2px);
}

.action-card .ac-icon  { font-size: 24px; }
.action-card .ac-title { font-size: 14px; font-weight: 600; color: var(--blue-dark); }
.action-card .ac-desc  { font-size: 12px; color: var(--gray-600); }

/* --- TABELLER -------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data-table th {
    background: var(--blue-dark);
    color: var(--white);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

table.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

table.data-table tbody tr:hover { background: var(--blue-pale); }
table.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-table .group-row td {
    background: var(--blue-pale);
    font-weight: 700;
    color: var(--blue-dark);
    font-size: 13px;
}

/* --- FORMULÄR -------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.15s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(71,156,208,0.15);
}

textarea { resize: vertical; min-height: 80px; }

/* --- KNAPPAR --------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--blue-dark);
    color: var(--white);
}
.btn-primary:hover { background: var(--blue-mid); }

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}
.btn-secondary:hover { background: var(--gray-400); }

.btn-danger {
    background: #fee2e2;
    color: var(--red);
}
.btn-danger:hover { background: #fecaca; }

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

/* --- ALERTS ---------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: var(--red);   border: 1px solid #fecaca; }
.alert-info    { background: var(--blue-pale); color: var(--blue-dark); border: 1px solid var(--blue-border); }
.alert-warning { background: #fff7ed; color: var(--orange); border: 1px solid #fed7aa; }

/* --- UPPLADDNING ----------------------------------------- */
.upload-area {
    border: 2px dashed var(--blue-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    background: var(--blue-pale);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--blue-light);
    background: #d4eaf7;
}

.upload-area input[type="file"] { display: none; }
.upload-area .upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-area p { color: var(--gray-600); font-size: 14px; }
.upload-area strong { color: var(--blue-dark); }

.attachment-list {
    list-style: none;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-100);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
}

.attachment-item .att-icon { font-size: 20px; }
.attachment-item .att-name { flex: 1; color: var(--blue-dark); font-weight: 500; }
.attachment-item .att-size { color: var(--gray-400); font-size: 12px; }
.attachment-item .att-del  { color: var(--red); cursor: pointer; background: none; border: none; font-size: 16px; }

/* --- FOOTER ---------------------------------------------- */
.site-footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,0.50);
    padding: 14px 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 24px;
    opacity: 0.7;
}

/* --- BADGES ---------------------------------------------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.badge-blue   { background: var(--blue-pale); color: var(--blue-dark); }
.badge-green  { background: #f0fdf4; color: var(--green); }
.badge-red    { background: #fef2f2; color: var(--red); }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* --- INLOGGNINGSSIDA ------------------------------------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--blue-dark) 0%, #2a6a93 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.20);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img { height: 80px; margin-bottom: 14px; }

.login-logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1.3;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* --- VERIFIKATIONSRADER ---------------------------------- */
.ver-lines { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ver-lines th {
    background: var(--blue-pale);
    color: var(--blue-dark);
    font-size: 12px;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
}
.ver-lines td { padding: 5px; border-bottom: 1px solid var(--gray-200); }
.ver-lines tfoot td { background: var(--gray-50); font-weight: 600; }

/* --- MOBIL ----------------------------------------------- */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 3px solid var(--blue-dark);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-brand-text { display: none; }
    .nav-user { display: none; }

    .form-grid { grid-template-columns: 1fr; }
    .main-content { padding: 16px 12px; }
    .card { padding: 16px; }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .action-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: 1fr; }
}
