/* ─────────────────────────────────────────────────────────────
   Pabalhas Organizer Dashboard — Custom Styles
   Bootstrap 5.3 base. Overrides and extensions only.
───────────────────────────────────────────────────────────── */

/* ── Root / Brand ────────────────────────────────────────── */
:root {
    --pbd-primary:      #1a56db;
    --pbd-primary-dark: #1245b5;
    --pbd-sidebar-bg:   #0f172a;
    --pbd-sidebar-text: #cbd5e1;
    --pbd-sidebar-w:    240px;
    --pbd-radius:       0.6rem;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

/* ── Layout wrapper ──────────────────────────────────────── */
#wrapper {
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
    width: var(--pbd-sidebar-w);
    min-height: 100vh;
    background: var(--pbd-sidebar-bg);
    color: var(--pbd-sidebar-text);
    flex-shrink: 0;
    transition: width 0.25s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

#sidebar .sidebar-brand {
    color: #f8fafc;
}

#sidebar .sidebar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

#sidebar .nav-link {
    color: var(--pbd-sidebar-text);
    border-radius: var(--pbd-radius);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: background 0.15s, color 0.15s;
}

#sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

#sidebar .nav-link.active {
    background: var(--pbd-primary);
    color: #fff;
}

#sidebar .sidebar-footer {
    border-color: rgba(255,255,255,0.1) !important;
}

#sidebar .sidebar-footer small {
    color: var(--pbd-sidebar-text);
}

/* Admin sidebar accent */
.admin-sidebar {
    background: #1e1b4b;
}

/* ── Page content ────────────────────────────────────────── */
#page-content {
    min-width: 0;
    background: #f1f5f9;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    border-radius: var(--pbd-radius) !important;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
    transition: transform 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Tables ──────────────────────────────────────────────── */
.table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge-success  { background-color: #16a34a !important; color: #fff; }
.badge-warning  { background-color: #d97706 !important; color: #fff; }
.badge-danger   { background-color: #dc2626 !important; color: #fff; }
.badge-info     { background-color: #0891b2 !important; color: #fff; }
.badge-secondary{ background-color: #64748b !important; color: #fff; }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1a56db 100%);
}

.login-card {
    border-radius: calc(var(--pbd-radius) * 2) !important;
}

/* ── Nav tabs flush with card ────────────────────────────── */
.nav-tabs .nav-link {
    border-radius: var(--pbd-radius) var(--pbd-radius) 0 0;
    color: #64748b;
    font-size: 0.875rem;
}

.nav-tabs .nav-link.active {
    color: var(--pbd-primary);
    font-weight: 600;
}

.rounded-top-0 {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ── Scrollbar (webkit) ──────────────────────────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ── Responsive sidebar (mobile) ────────────────────────── */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        z-index: 1040;
        transform: translateX(-100%);
        width: var(--pbd-sidebar-w);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #page-content {
        width: 100%;
    }

    #sidebarOverlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1039;
    }

    #sidebarOverlay.show {
        display: block;
    }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

/* ── Kit Claim Modal ────────────────────────────────────── */
.pbd-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pbd-modal-overlay.show { opacity: 1; }

.pbd-modal-box {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%; max-width: 380px;
    padding: 2rem 1.8rem 1.5rem;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pbd-modal-overlay.show .pbd-modal-box {
    transform: scale(1) translateY(0);
}

.pbd-modal-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}
.pbd-modal-icon.claim {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: #fff;
}
.pbd-modal-icon.unclaim {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
}
.pbd-modal-icon.success {
    background: linear-gradient(135deg, #16a34a, #4ade80);
    color: #fff;
    animation: pbd-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pbd-modal-icon.error {
    background: linear-gradient(135deg, #dc2626, #f87171);
    color: #fff;
}

@keyframes pbd-pop {
    0%   { transform: scale(0.5); }
    100% { transform: scale(1); }
}

.pbd-modal-title {
    font-weight: 700; font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 0.4rem;
}
.pbd-modal-text {
    color: #64748b; font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}
.pbd-modal-text strong {
    color: #1e293b;
}

.pbd-modal-actions {
    display: flex; gap: 0.6rem; justify-content: center;
}
.pbd-modal-actions .btn {
    min-width: 110px; border-radius: 0.5rem;
    font-weight: 600; font-size: 0.85rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}
.pbd-btn-confirm {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: #fff; border: none;
}
.pbd-btn-confirm:hover {
    background: linear-gradient(135deg, #1245b5, #2563eb);
    color: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.4);
}
.pbd-btn-cancel {
    background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.pbd-btn-cancel:hover {
    background: #e2e8f0; color: #334155;
}
.pbd-btn-ok {
    background: linear-gradient(135deg, #16a34a, #4ade80);
    color: #fff; border: none; min-width: 140px;
}
.pbd-btn-ok:hover {
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: #fff;
}
