:root {
    --primary: #1e3a5f;
    --primary-dark: #14293f;
    --accent: #b8912f;
    --accent-light: #e3c465;
    --danger: #dc2626;
    --success: #16a34a;
    --bg: #f4f5f3;
    --card-bg: #ffffff;
    --text: #1f2937;
    --border: #e6e3db;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
h1, h2, h3, .topnav .brand {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    color: #16202f;
}
h1 { font-size: 1.55rem; margin: 0 0 6px; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.topnav {
    background: var(--card-bg);
    border-bottom: 2px solid var(--accent-light);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(16,24,39,0.04);
}
.topnav .brand { font-size: 1.2rem; color: #16202f; text-decoration: none; }
.topnav-bar { display: contents; } /* pa efekt ne desktop: brand+toggle mbesin bij direkte te .topnav si me pare */
.nav-toggle {
    display: none; /* i fshehur ne desktop, shfaqet vetem ne media query me poshte */
    background: none; border: 1px solid var(--border); border-radius: 8px;
    font-size: 1.25rem; line-height: 1; padding: 6px 10px; cursor: pointer; color: var(--text);
}
.nav-right { display: flex; gap: 6px; align-items: center; }
.nav-right a { color: var(--text); text-decoration: none; }
.nav-right a:hover { color: var(--accent); }
.nav-user { color: #6b7280; font-size: 0.82rem; white-space: nowrap; padding: 0 4px; }

/* Ikonat e thjeshta ne krye (Kalendari, Kerko) */
.nav-icon-link {
    font-size: 1.05rem; padding: 6px 8px; border-radius: 8px; line-height: 1;
}
.nav-icon-link:hover { background: #f0f2f5; }

/* Butoni "Dil" - dallon pak nga linqet e tjera */
.nav-logout {
    font-size: 0.85rem; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
    margin-left: 4px;
}
.nav-logout:hover { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* Dropdown "☰ Menyja" - grupon Skadencat/Kujtesat/Datat/Kontaktet/Financat/Admin */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    color: var(--text); font-size: 0.88rem; padding: 6px 12px; display: flex; align-items: center; gap: 4px;
    font-family: inherit;
}
.nav-dropdown-btn:hover { background: #f0f2f5; }
.nav-dropdown .caret { font-size: 0.7rem; transition: transform 0.15s; }
.nav-dropdown.open .caret { transform: rotate(180deg); }
.nav-dropdown-panel {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,24,39,0.12); min-width: 210px; padding: 6px; flex-direction: column; gap: 2px;
}
.nav-dropdown.open .nav-dropdown-panel { display: flex; }
.nav-dropdown-panel a { padding: 9px 12px; border-radius: 7px; font-size: 0.9rem; white-space: nowrap; }
.nav-dropdown-panel a:hover { background: #f0f2f5; color: var(--text); }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: 5px 2px; }

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

.login-box, .form-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    max-width: 480px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
label { font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
input, select, textarea {
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    width: 100%;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.12);
}
.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { background: #f0f2f5; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; }

.alert { padding: 12px 16px; border-radius: 8px; margin: 10px 0; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info { background: #dbeafe; color: #1e40af; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.member-profile-head { display: flex; align-items: center; gap: 16px; }
.member-profile-photo { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #eef1f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.member-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-profile-photo .photo-placeholder { font-size: 1.8rem; }
.photo-upload-form { margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 10px; }

.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.member-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; text-align: center; text-decoration: none; color: var(--text);
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.member-card:hover { box-shadow: 0 8px 20px rgba(16,24,39,.09); transform: translateY(-2px); border-color: var(--accent-light); }
.member-photo { width: 80px; height: 80px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #eef1f5, #e4e8ee); display: flex; align-items: center; justify-content: center; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { font-size: 2rem; }
.member-name { font-weight: 600; }
.member-phone { color: #6b7280; font-size: 0.85rem; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.extra-info { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }

.section-label {
    margin: 24px 0 10px; color: #6b7280; font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.section-label::before { content: ""; width: 14px; height: 2px; background: var(--accent); display: inline-block; }
.hint-text { color: #6b7280; font-size: 0.85rem; margin: -8px 0 12px; }
.pdf-editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.pdf-editor-toolbar label { margin: 0; font-size: 0.85rem; }
.pdf-editor-toolbar select, .pdf-editor-toolbar input[type=number] { padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
.pdf-editor-toolbar input[type=color] { width: 36px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; cursor: pointer; }
.toolbar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.pdf-ann-box {
    position: absolute; min-width: 30px; min-height: 1.2em; padding: 4px 18px 4px 6px;
    cursor: move; outline: none; white-space: pre-wrap; line-height: 1.2;
    border: 1px dashed transparent; border-radius: 3px; background: rgba(255,255,255,0.01);
}
.pdf-ann-box:hover { border-color: #93c5fd; background: rgba(219,234,254,0.3); }
.pdf-ann-box.selected { border: 1px dashed #2563eb; background: rgba(219,234,254,0.4); }
.pdf-ann-delete {
    position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; line-height: 18px;
    text-align: center; background: #dc2626; color: #fff; border-radius: 50%; font-size: 11px;
    cursor: pointer; display: none;
}
.pdf-ann-box:hover .pdf-ann-delete, .pdf-ann-box.selected .pdf-ann-delete { display: block; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 20px; }
.icon-tile {
    background: var(--card-bg); border: 1px solid transparent; border-radius: 8px;
    padding: 10px 6px; text-align: center; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px; user-select: none;
}
.icon-tile:hover { background: #f6f2e6; border-color: var(--accent-light); }
.icon-tile-glyph { font-size: 2rem; line-height: 1; position: relative; }
.expiry-badge { position: absolute; top: -4px; right: -8px; font-size: 0.85rem; }
.icon-tile-name {
    font-size: 0.78rem; word-break: break-word; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%;
}
.icon-tile-protocol { font-size: 0.68rem; color: var(--muted, #777); }

.page-head-actions { display: flex; gap: 8px; align-items: center; }

/* Menyja e klikimit te djathte, si ne file explorer te kompjuterit */
.context-menu {
    display: none; position: absolute; z-index: 1100; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 6px; min-width: 160px; flex-direction: column;
}
.context-menu.open { display: flex; }
.context-menu a {
    padding: 8px 12px; text-decoration: none; color: var(--text); border-radius: 6px; font-size: 0.9rem;
}
.context-menu a:hover { background: #f0f2f5; }

/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(17,24,39,0.55);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--card-bg); border-radius: 12px; max-width: 480px; width: 100%;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-box-large { max-width: 800px; }
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-bg);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #6b7280; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.upload-section h4 { margin: 0 0 8px; font-size: 0.9rem; }
.stacked-form { display: flex; flex-direction: column; gap: 8px; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.preview-content { display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: 60vh; overflow: auto; background: #f0f2f5; border-radius: 8px; margin-bottom: 10px; }
.preview-content img, .preview-content video { max-width: 100%; max-height: 60vh; object-fit: contain; }
.preview-content audio { width: 100%; }
.preview-content .pdf-frame { width: 100%; height: 60vh; border: 0; }
.file-name { font-weight: 600; font-size: 0.9rem; word-break: break-word; }
.file-note { font-size: 0.8rem; color: #6b7280; margin: 6px 0; }
.file-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 20px; }
.inline-form { display: flex; gap: 8px; align-items: center; }

.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.balance-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.balance-card.income strong { color: var(--success); }
.balance-card.expense strong { color: var(--danger); }

.table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.table th { background: #f9fafb; }
.row-income td:nth-child(2) { color: var(--success); }
.row-expense td:nth-child(2) { color: var(--danger); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.admin-card {
    background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid transparent;
    border-radius: 10px; padding: 20px; text-decoration: none; color: var(--text);
    transition: box-shadow .18s, transform .18s, border-top-color .18s;
}
.admin-card:hover { box-shadow: 0 8px 20px rgba(16,24,39,.09); transform: translateY(-2px); border-top-color: var(--accent); }

.plugin-banner { margin-bottom: 16px; }

/* Kambana e Njoftimeve (🔔) */
.bell-btn {
    position: relative; background: none; border: none; font-size: 1.15rem; cursor: pointer;
    color: var(--text); padding: 4px 2px;
}
.bell-badge {
    position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff;
    font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border);
}
.notif-item.notif-unseen { background: #fffbeb; border-color: #fde68a; }
.notif-item.notif-seen { opacity: 0.6; }
.notif-icon { font-size: 1.3rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 0.9rem; }
.notif-meta { font-size: 0.78rem; color: #6b7280; }

/* Dokument Ligjor i Kufizuar */
.legal-badge { position: absolute; bottom: -4px; right: -8px; font-size: 0.85rem; }

/* ============================================================
   "📊 Performanca e Serverit" — kuadrante ne forme sahati
   (0% jeshile -> 50% verdhe -> 100% kuqe), lexim-vetem
   ============================================================ */
.gauge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.gauge-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; text-align: center;
}
.gauge-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 14px; }
.gauge {
    position: relative; width: 150px; height: 150px; margin: 0 auto 16px;
    border-radius: 50%;
}
.gauge-needle {
    position: absolute; left: 50%; top: 50%; width: 4px; height: 58px;
    background: #1f2937; border-radius: 2px 2px 0 0;
    transform-origin: 50% 100%;
    margin-left: -2px; margin-top: -58px;
}
.gauge-hub {
    position: absolute; left: 50%; top: 50%; width: 12px; height: 12px;
    background: #1f2937; border-radius: 50%; transform: translate(-50%, -50%); z-index: 2;
}
.gauge-hole {
    position: absolute; inset: 18px; background: var(--card-bg); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px var(--border);
}
.gauge-percent { font-size: 1.6rem; font-weight: 700; }
.gauge-sub { font-size: 0.8rem; color: #6b7280; line-height: 1.5; }

@media (max-width: 480px) {
    .gauge { width: 130px; height: 130px; }
    .gauge-needle { height: 50px; margin-top: -50px; }
    .gauge-percent { font-size: 1.35rem; }
}

details summary { cursor: pointer; font-size: 0.85rem; margin-bottom: 4px; }

/* ============================================================
   FAQET E HYRJES — "Trezori Familjar"
   (login.php, verify_otp.php, forgot_password.php, reset_password.php)
   Qellimisht me identitet vizual te vetin, i ndare nga pjesa e brendshme
   e sistemit (nuk perdor .topnav/.container) — shih includes/auth_header.php
   ============================================================ */
.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background:
        radial-gradient(circle at 50% -10%, rgba(227, 196, 101, 0.18), transparent 55%),
        linear-gradient(165deg, #101826 0%, #16202f 55%, #1b2436 100%);
    background-color: #101826;
    position: relative;
    overflow-x: hidden;
}
.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}
.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-emblem { display: block; width: 62px; height: 62px; max-width: 62px; margin-bottom: 16px; flex-shrink: 0; }
.auth-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 1.85rem;
    font-weight: 600;
    color: #f5f3ee;
    margin: 0 0 8px;
    text-align: center;
}
.auth-subtitle {
    color: #a7b0c0;
    font-size: 0.93rem;
    text-align: center;
    margin: 0 0 26px;
    max-width: 300px;
    line-height: 1.5;
}
.auth-card {
    background: #fffdf9;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 28px 26px;
    width: 100%;
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.45);
}
.auth-card .alert { margin: 0 0 16px; font-size: 0.87rem; }
.auth-hint { color: #6b7280; font-size: 0.85rem; margin: -4px 0 16px; }
.auth-reset-for { font-size: 0.9rem; margin: -4px 0 16px; }
.auth-field { margin-bottom: 16px; }
.auth-field:last-of-type { margin-bottom: 20px; }
.auth-field label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    color: #4b5162;
    margin-bottom: 6px;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
    opacity: 0.5;
    pointer-events: none;
}
.auth-input-wrap input {
    width: 100%;
    padding: 10px 38px 10px 36px;
    border: 1px solid #e2e2df;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}
.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.15);
}
.auth-input-wrap .auth-toggle-pass {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.55;
    padding: 6px;
    line-height: 1;
}
.auth-input-wrap .auth-toggle-pass:hover { opacity: 0.9; }
.otp-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e2df;
    border-radius: 8px;
    background: #fff;
    font-size: 1.4rem;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    text-align: center;
    font-weight: 600;
}
.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.15);
}
.btn-block { display: block; width: 100%; text-align: center; padding: 11px 16px; font-size: 0.96rem; font-weight: 600; }
.auth-links { text-align: center; margin-top: 18px; font-size: 0.88rem; }
.auth-links.secondary { margin-top: 14px; margin-bottom: -4px; }
.auth-links a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-links.secondary a { color: #6b7280; font-weight: 500; }
.auth-foot { margin-top: 22px; color: #7c869a; font-size: 0.8rem; text-align: center; }

/* ---- Kodi matematik + permiresime te faqes se hyrjes ---- */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.captcha-box { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha-img { flex: 1; min-width: 0; line-height: 0; border: 1px solid #e2e2df; border-radius: 10px; overflow: hidden; transition: opacity .2s; }
.captcha-svg { display: block; width: 100%; height: auto; max-height: 56px; }
.captcha-refresh {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid #e2e2df; background: #fff; color: var(--primary);
    font-size: 1.3rem; line-height: 1; cursor: pointer; transition: transform .35s, background .2s;
}
.captcha-refresh:hover { background: #f6f1e3; transform: rotate(180deg); }
.captcha-refresh:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(30,58,95,0.2); }
.captcha-field input { letter-spacing: .08em; font-weight: 600; }
.caps-warn { margin-top: 6px; font-size: .8rem; color: #b45309; font-weight: 600; }
.caps-warn[hidden] { display: none; }
.auth-card { animation: authRise .45s ease both; }
.auth-card .alert-error { animation: authShake .4s ease; }
.auth-card .btn-primary { transition: transform .15s, box-shadow .2s, opacity .2s; }
.auth-card .btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(30,58,95,.55); }
.auth-card .btn-primary:disabled { opacity: .7; cursor: wait; }
@keyframes authRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes authShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) {
    .auth-card, .auth-card .alert-error { animation: none; }
    .captcha-refresh, .auth-card .btn-primary { transition: none; }
}

@media (max-width: 480px) {
    .auth-page { padding: 32px 14px; }
    .auth-title { font-size: 1.5rem; }
    .auth-subtitle { margin-bottom: 20px; }
    .auth-card { padding: 22px 18px; border-radius: 14px; }
    .auth-emblem { width: 54px; height: 54px; max-width: 54px; }
}

@media (max-width: 360px) {
    .auth-page { padding: 24px 10px; }
    .auth-card { padding: 18px 14px; }
    .auth-emblem { width: 46px; height: 46px; max-width: 46px; }
    .auth-title { font-size: 1.3rem; }
}

/* ============================================================
   PERGJEGJSHMERIA PER TELEFON (gjithe sistemi, jo vetem faqet e hyrjes)
   Gjithcka mbi kete media query mbetet e paprekur ne desktop/tablet;
   rregullat e meposhtme aktivizohen VETEM nen 780px gjeresi ekrani.
   ============================================================ */
@media (max-width: 780px) {
    .container { padding: 14px; }

    /* --- Nav-i i siperm behet menu "hamburger" --- */
    .topnav { flex-direction: column; align-items: stretch; padding: 10px 14px; }
    .topnav-bar { display: flex; justify-content: space-between; align-items: center; }
    .topnav .brand { font-size: 1.05rem; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-right {
        display: none; flex-direction: column; align-items: stretch; gap: 2px;
        width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
    }
    .nav-right.open { display: flex; }
    .nav-right a, .nav-right .nav-user {
        padding: 10px 6px; width: 100%; border-radius: 6px;
    }
    .nav-right a:active, .nav-right a:hover { background: #f0f2f5; }
    .nav-user { order: 99; color: #9aa3b2; font-size: 0.82rem; padding-top: 6px !important; }
    .nav-right .bell-btn { padding: 10px 6px; width: 100%; text-align: left; border-radius: 6px; }
    .nav-right .bell-btn:active, .nav-right .bell-btn:hover { background: #f0f2f5; }
    .nav-right .nav-icon-link { width: 100%; text-align: left; }
    .nav-right .nav-logout { width: 100%; text-align: left; margin-left: 0; box-sizing: border-box; }

    /* Ne mobile, dropdown-i hapet inline (jo si panel qe fluturon jashte ekranit) */
    .nav-dropdown { width: 100%; }
    .nav-dropdown-btn { width: 100%; justify-content: space-between; box-sizing: border-box; }
    .nav-dropdown-panel {
        position: static; box-shadow: none; border: none; width: 100%; margin-top: 4px;
        padding: 0 0 0 10px; min-width: 0;
    }

    /* Nav-i i jashtem (☰ lart) eshte e vetmja "dere" - s'duhet klikim i dyte per te
       hapur nengrupin e linqeve, prandaj ne mobile e heqim butonin e brendshem dhe
       lista shfaqet gjithmone e hapur, direkt brenda menyse kryesore. */
    .nav-dropdown-btn { display: none; }
    .nav-dropdown-panel { display: flex !important; padding-left: 0; }

    /* --- Titujt e faqeve: mos u ngjeshin buttonat ne nje rresht te vetem --- */
    .page-head, .section-head {
        flex-wrap: wrap;
        row-gap: 10px;
    }
    .page-head-actions { flex-wrap: wrap; }

    /* --- Tabelat: shfaqen te plota, mund te rreshqiten anash ne vend qe te thyhen --- */
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px 20px; padding: 0 14px; }
    .table-scroll .table { margin-bottom: 0; }
    .table { min-width: 480px; }

    /* --- Modalet: pak me shume vend perdorimi ne ekran te vogel --- */
    .modal-overlay { padding: 10px; }
    .modal-box { max-height: 92vh; }
    .modal-head { padding: 14px 16px; }
    .modal-body { padding: 16px; }

    /* --- Grafiket/kartat: nje kolone e vetme kur eshte shume ngushte --- */
    .balance-grid, .admin-grid { grid-template-columns: 1fr; }

    /* --- Butonat e formave te plota gjeresi ne mobile, per t'u prekur me lehte --- */
    .stacked-form .btn, form.inline-form .btn { min-height: 40px; }
}

/* Shiriti lart mbetet i ngjitur gjate scroll */
.topnav{position:sticky;top:0;z-index:1000;padding-top:calc(14px + env(safe-area-inset-top,0px))}
@media(max-width:768px){.topnav{padding-top:calc(10px + env(safe-area-inset-top,0px))}}

/* ===== v7: zgjedhja & fshirja, galeria me video ===== */
.select-mode .icon-tile[data-key] { cursor: pointer; outline: 2px dashed #cbd5e1; outline-offset: -2px; position: relative; }
.select-mode .icon-tile.sel-on { outline: 3px solid #dc2626; background: #fee2e2; }
.select-mode .icon-tile.sel-on::after { content: '✓'; position: absolute; top: 4px; right: 6px; background: #dc2626; color: #fff; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; text-align: center; font-weight: 700; font-size: .85rem; }
#selBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 2px solid #dc2626; box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
#selBar[hidden] { display: none; }
.select-mode body, body.select-mode { padding-bottom: 80px; }
.gal-thumb { width: 100%; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: #111; position: relative; }
.gal-thumb img, .gal-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gal-thumb .gal-play { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 999px; padding: 2px 7px; font-size: .75rem; }
.gal-thumb .gal-lock { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 999px; padding: 2px 7px; font-size: .75rem; }
.gal-thumb.is-private { opacity: .55; }

/* ===== v9: ikonat lart (🏠 📁 📆 🔍 🔔) gjithmonë te dukshme, edhe ne telefon, jashte menyse ===== */
.nav-quick{display:flex;gap:2px;align-items:center;margin-left:auto;margin-right:12px}
.nav-quick a{color:var(--text);text-decoration:none}
.nav-quick .bell-btn{padding:6px 8px}
@media (max-width: 780px) {
    .topnav-bar{gap:6px}
    .topnav .brand{display:none}
    .nav-quick{margin:0;flex:1;justify-content:space-around}
    .nav-quick .nav-icon-link,.nav-quick .bell-btn{font-size:1.35rem;padding:8px 12px;width:auto}
    .nav-toggle{flex:none}
}

/* ===== v10: menyja e pershtatshme per cdo ekran ===== */
.topnav{flex-wrap:wrap;gap:6px 12px}
.nav-right{flex-wrap:wrap;justify-content:flex-end}
.nav-dropdown-panel{max-height:calc(100vh - 110px);max-height:calc(100dvh - 110px);overflow-y:auto;overscroll-behavior:contain}
.nav-dropdown-panel a{white-space:normal}
@media (max-width: 780px) {
    body.nav-open{overflow:hidden}
    .topnav{flex-wrap:nowrap}
    /* paneli i hapur: i fiksuar nen shiritin, me scroll brenda tij, qe te shfaqen TE GJITHA linqet edhe ne ekran te vogel */
    .nav-right{position:fixed;left:0;right:0;top:var(--nav-h,64px);bottom:0;z-index:999;margin:0;padding:10px 14px calc(24px + env(safe-area-inset-bottom,0px));
        background:var(--card-bg);overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border-top:2px solid var(--accent-light);width:auto;flex-wrap:nowrap}
    .nav-right.open{display:flex}
    .nav-dropdown-panel{max-height:none;overflow:visible;padding:0}
    .nav-dropdown-panel a{padding:12px 8px;font-size:1rem;border-bottom:1px solid var(--border);border-radius:0}
    .nav-dropdown-sep{margin:10px 0}
    .nav-user{order:99}
}
@media (max-width: 380px) { .nav-quick .nav-icon-link,.nav-quick .bell-btn{font-size:1.2rem;padding:8px 6px} .nav-toggle{padding:6px 10px} }

/* ===== v11: albumi si Facebook ===== */
.alb-head{margin:4px 0 16px}.alb-back{font-size:.9rem;text-decoration:none;color:#65676b}.alb-title{margin:6px 0 2px;font-size:1.8rem}.alb-sub{color:#65676b;margin-bottom:10px}
.alb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:6px}
@media(max-width:560px){.alb-grid{grid-template-columns:repeat(3,1fr);gap:3px}}
.alb-cell{cursor:pointer;border-radius:6px;overflow:hidden}.alb-cell .gal-thumb{border-radius:0}.alb-cell:hover .gal-thumb{filter:brightness(.88)}
.alb-meta{position:absolute;left:6px;bottom:6px;background:rgba(0,0,0,.65);color:#fff;border-radius:999px;padding:2px 8px;font-size:.72rem}

/* ===== v11: foto e profilit tim lart (si Facebook) ===== */
.nav-me{flex:none;width:38px;height:38px;border-radius:50%;overflow:hidden;background:#cbd5e1;color:#334155;display:flex;align-items:center;justify-content:center;font-weight:700;text-decoration:none;border:2px solid var(--accent,#b8912f);margin-right:8px}
.nav-me img{width:100%;height:100%;object-fit:cover;display:block}
@media (max-width:780px){.nav-me{margin-right:2px;width:36px;height:36px}}

/* ===== v11: profili si Facebook ===== */
.fbp{background:var(--card-bg,#fff);border:1px solid var(--border,#e6e3db);border-radius:16px;overflow:hidden;margin-bottom:14px}
.fbp-cover{position:relative;height:240px;background:linear-gradient(135deg,#16202f,#b8912f);overflow:hidden}
.fbp-mosaic{position:absolute;inset:0;display:grid;gap:2px;grid-template-columns:repeat(4,1fr)}.fbp-mosaic .gal-thumb{border-radius:0;aspect-ratio:auto;height:100%}
.fbp-mosaic.n1{grid-template-columns:1fr}.fbp-mosaic.n2{grid-template-columns:1fr 1fr}.fbp-mosaic.n3{grid-template-columns:2fr 1fr 1fr}
.fbp-shade{position:absolute;inset:0;background:linear-gradient(transparent 45%,rgba(0,0,0,.45))}
.fbp-camera{position:absolute;right:12px;bottom:12px;background:rgba(255,255,255,.92);color:#111;border-radius:8px;padding:7px 12px;font-size:.85rem;cursor:pointer;font-weight:600}
.fbp-head{display:flex;gap:16px;align-items:flex-end;padding:0 20px 12px;margin-top:-52px;position:relative;flex-wrap:wrap}
.fbp-av{flex:none;width:136px;height:136px;border-radius:50%;border:5px solid var(--card-bg,#fff);background:#e5e7eb;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:3.4rem;box-shadow:0 2px 10px rgba(0,0,0,.2)}.fbp-av img{width:100%;height:100%;object-fit:cover}.fbp-av-edit{position:relative;cursor:pointer}.fbp-av-edit::after{content:"📷";position:absolute;left:0;right:0;bottom:0;height:32%;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45);color:#fff;font-size:1.05rem}.fbp-av-edit:hover::after{background:rgba(0,0,0,.65)}
.fbp-id{flex:1;min-width:200px;padding-bottom:6px}.fbp-id h1{margin:0;font-size:1.9rem;line-height:1.15}.fbp-sub{color:#6b7280;margin-top:4px;font-size:.92rem}
.fbp-actions{display:flex;gap:8px;flex-wrap:wrap;padding-bottom:8px}
.fbp-tabs{display:flex;gap:2px;border-top:1px solid var(--border,#e6e3db);padding:0 12px;overflow-x:auto}
.fbp-tabs button{flex:none;border:0;background:none;padding:14px 16px;font-size:.95rem;font-weight:600;color:#65676b;cursor:pointer;border-bottom:3px solid transparent}
.fbp-tabs button:hover{background:rgba(0,0,0,.04)}.fbp-tabs button.on{color:#1b74e4;border-bottom-color:#1b74e4}
.fbp-pane[hidden],.fbp-sub-pane[hidden]{display:none}
.fbp-subtabs{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 14px}.fbp-subtabs button{border:0;background:#e4e6eb;border-radius:999px;padding:8px 16px;font-weight:600;cursor:pointer;color:#1c1e21}.fbp-subtabs button.on{background:#e7f3ff;color:#1b74e4}
.fbp-albums{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.fbp-album{text-decoration:none;color:inherit;display:block}.fbp-album-cv{border-radius:12px;background:#e4e6eb;border:1px solid #e4e6eb}.fbp-album-cv .mt{width:100%;height:100%}
.fbp-album:hover .fbp-album-cv{filter:brightness(.92)}.fbp-album-ph{display:flex;width:100%;height:100%;align-items:center;justify-content:center;font-size:3rem}
.fbp-album-n{font-weight:700;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fbp-album-c{font-size:.82rem;color:#65676b}
.fbp-h3{margin:22px 0 8px}.fbp-co{display:flex;flex-wrap:wrap;gap:10px}
.fbp-co-i{display:flex;flex-direction:column;align-items:center;width:104px;text-decoration:none;color:inherit;text-align:center;font-size:.82rem;padding:8px;border-radius:12px}.fbp-co-i:hover{background:rgba(0,0,0,.05)}
.fbp-co-av{width:60px;height:60px;border-radius:50%;background:#cbd5e1;overflow:hidden;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1.3rem;color:#334155;margin-bottom:4px}.fbp-co-av img{width:100%;height:100%;object-fit:cover}.fbp-co-i small{color:#65676b}
.fbp-years{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.fbp-years button{border:1px solid #d1d5db;background:#fff;border-radius:999px;padding:5px 14px;cursor:pointer}.fbp-years button.on{background:#1b74e4;color:#fff;border-color:#1b74e4}
.fbp-link summary{cursor:pointer}
@media(max-width:640px){.fbp-cover{height:150px}.fbp-head{margin-top:-46px;padding:0 12px 10px}.fbp-av{width:100px;height:100px}.fbp-id h1{font-size:1.45rem}.fbp-albums{grid-template-columns:repeat(2,1fr);gap:10px}}
