/* Portfolio app */
:root {
    --app-bg: #f5f6f8;
    --app-soft: #6b7280;
    --app-border: #e5e7eb;
    --wa: #25d366;
    --wa-dark: #128c4b;
    --bs-primary: #2b5cdb;
    --bs-primary-rgb: 43, 92, 219;
    --bs-link-color: #2b5cdb;
    --bs-link-color-rgb: 43, 92, 219;
    --bs-border-radius: .6rem;
}
body { background: var(--app-bg); color: #1f2430; font-size: .95rem; }
.text-soft { color: var(--app-soft) !important; }
.text-pre { white-space: pre-line; }
.min-w-0 { min-width: 0; }
.btn-primary { --bs-btn-bg: #2b5cdb; --bs-btn-border-color: #2b5cdb; --bs-btn-hover-bg: #224bb6; --bs-btn-hover-border-color: #224bb6; --bs-btn-active-bg: #1d409c; }
.btn-outline-primary { --bs-btn-color: #2b5cdb; --bs-btn-border-color: #2b5cdb; --bs-btn-hover-bg: #2b5cdb; --bs-btn-hover-border-color: #2b5cdb; --bs-btn-active-bg: #2b5cdb; }
.card { border-color: var(--app-border); border-radius: .8rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.form-control:focus, .form-select:focus { border-color: #8aa7ee; box-shadow: 0 0 0 .2rem rgba(43, 92, 219, .15); }

/* Nav */
.app-navbar { background: #fff; border-bottom: 1px solid var(--app-border); }
.app-navbar .nav-link { color: #374151; border-radius: .5rem; padding: .45rem .75rem; }
.app-navbar .nav-link.active, .app-navbar .nav-link:hover { background: #eef2fd; color: #2b5cdb; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: .6rem; background: #2b5cdb; color: #fff; }
.brand-mark-lg { width: 52px; height: 52px; font-size: 1.5rem; border-radius: .9rem; }
.brand-logo { height: 34px; width: auto; max-width: 120px; object-fit: contain; }
.auth-wrap { max-width: 440px; margin: 0 auto; }
.install-wrap { max-width: 620px; }
.auth-logo { max-height: 70px; max-width: 200px; }

/* WhatsApp */
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: var(--wa-dark); --bs-btn-border-color: var(--wa-dark); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #0e7a40; --bs-btn-hover-border-color: #0e7a40; --bs-btn-active-bg: #0b6635; --bs-btn-active-color: #fff; }
.share-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--wa); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.share-panel { border-color: #bfe9cf; }
.share-preview { white-space: pre-wrap; word-break: break-word; background: #e7f8ee; border-radius: .6rem; padding: .75rem; font-family: inherit; font-size: .85rem; margin: 0; max-height: 260px; overflow: auto; }

/* Categories and items */
.category-card { transition: box-shadow .15s, transform .15s; }
.category-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.category-card .card-footer { border-top-color: var(--app-border); }
.category-card .card-footer form { display: inline; }
.is-hidden { opacity: .6; }
.cat-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.cat-link { background: #eef2fd; color: #2b5cdb; }
.cat-gallery { background: #fdf0e9; color: #d0581d; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--app-soft); }
.empty-state > .bi { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #c3c8d2; }
.item-list .list-group-item { padding: .85rem 1rem; border-color: var(--app-border); }
.item-list { border-radius: .8rem; }
.thumb-sm { width: 64px; height: 48px; border-radius: .5rem; overflow: hidden; background: #eef0f4; display: inline-flex; align-items: center; justify-content: center; color: #9aa1ad; font-size: 1.3rem; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.icon-pick { width: 44px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.upload-box { background: #f8f9fb; border: 1px dashed #cdd3dd; border-radius: .7rem; padding: .75rem; }

/* Image tiles (admin) */
.img-tile { position: relative; }
.img-tile > a { display: block; aspect-ratio: 4 / 3; border-radius: .6rem; overflow: hidden; background: #eef0f4; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; }
.img-tile .cover-badge { position: absolute; top: .4rem; left: .4rem; }
.img-tools { position: absolute; top: .4rem; right: .4rem; display: flex; gap: .2rem; }
.img-tools form { display: inline; }
.img-tools .btn { padding: .1rem .35rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.settings-logo { max-height: 56px; max-width: 140px; object-fit: contain; border: 1px solid var(--app-border); border-radius: .4rem; padding: .25rem; background: #fff; }

/* Public pages */
body.public { background: #fafbfc; min-height: 100vh; display: flex; flex-direction: column; }
body.public > main { flex: 1 0 auto; }
.public-header { background: #fff; border-bottom: 1px solid var(--app-border); }
.public-logo { max-height: 52px; max-width: 160px; object-fit: contain; }
.public-footer { border-top: 1px solid var(--app-border); background: #fff; margin-top: 2rem; }
.lead-sm { font-size: 1.02rem; color: #374151; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; align-items: start; }
.gallery-item { margin: 0; background: #fff; border-radius: .7rem; overflow: hidden; border: 1px solid var(--app-border); }
.gallery-item img { width: 100%; height: auto; display: block; }
.gallery-item figcaption { padding: .5rem .75rem; font-size: .85rem; color: #4b5563; }
.project-card { overflow: hidden; }
.project-cover { display: block; aspect-ratio: 16 / 10; background: #eef0f4; overflow: hidden; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .3s; }
.project-card:hover .project-cover img { transform: scale(1.03); }
.project-cover-empty { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #b6bdc9; }

/* Lightbox */
.lightbox-img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(0, 0, 0, .45); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 1.2rem; }
.lb-prev { left: .75rem; }
.lb-next { right: .75rem; }

@media (max-width: 575.98px) {
    main.container { padding-left: .9rem; padding-right: .9rem; }
    .gallery { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
}
