@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Roboto+Condensed:wght@700&display=swap');

:root {
    /* ── Brand: Primary ── */
    --teal-dark: #0f4652;
    --teal: #26aece;
    --teal-soft: #e8f6fb;
    --teal-mid: #1a8aaa;
    /* ── Brand: Secondary ── */
    --amber: #f0a202;
    --amber-soft: #fff7e0;
    --yellow: #ffe363;
    /* ── Brand: Tertiary ── */
    --black: #000;
    --white: #fff;
    --gray: #808080;
    --teal-darker: #0f394b;
    --orange: #f18805;
    /* ── Extended (UI semantics) ── */
    --gray-light: #e0e0e0;
    --gray-bg: #f5f5f5;
    --bg: #f7f9fa;
    --green: #22c55e;
    --green-soft: #f0fdf4;
    --red: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 250px;
    --topbar-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    min-height: 100vh;
    background: var(--bg);
    font-family: 'Open Sans', sans-serif;
    color: var(--black);
    display: flex;
}

/* ── Sidebar ─────────────────────────────────────────── */
.v2-sidebar {
    width: var(--sidebar-w);
    background: var(--teal-dark);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: left 0.3s ease;
}

.v2-sidebar-brand {
    padding: 22px 18px 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.v2-sidebar-brand img {
    height: 28px;
    width: auto;
}

.v2-sidebar-brand h1 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin: 0;
}

.v2-sidebar-nav {
    flex: 1;
    padding: 0 14px;
    overflow-y: auto;
}

.v2-sidebar-section {
    padding: 8px 12px 4px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 1px;
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
}

.v2-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
    text-decoration: none;
    color: inherit;
}

.v2-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.v2-sidebar-item.active {
    background: rgba(38, 174, 206, 0.2);
}

.v2-sidebar-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: #fff;
}

.v2-sidebar-icon.active { background: var(--teal); }
.v2-sidebar-icon.default { background: rgba(255, 255, 255, 0.08); }

.v2-sidebar-label {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2px;
}

.v2-sidebar-item.active .v2-sidebar-label { color: #fff; }

.v2-sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 12px;
}

/* Badge for counts */
.v2-sidebar-badge {
    margin-left: auto;
    background: var(--amber);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    font-family: 'Roboto Condensed', sans-serif;
}

/* Locked sidebar items */
.v2-sidebar-item.locked {
    opacity: 0.4;
    cursor: default;
}
.v2-sidebar-item.locked:hover {
    background: transparent;
}

/* ── Topbar ──────────────────────────────────────────── */
.v2-topbar {
    background: #fff;
    padding: 0 36px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}

.v2-topbar-logo {
    display: none;
}

.v2-topbar-logo img {
    height: 32px;
}

.v2-topbar-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--teal-dark);
}

.v2-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

/* EN/ES toggle */
.v2-lang-toggle {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--gray-light);
    border-radius: 6px;
    overflow: hidden;
    margin-right: 4px;
}

.v2-lang-btn {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--gray);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

.v2-lang-btn.active {
    background: var(--teal-dark);
    color: #fff;
}

.v2-lang-btn:hover:not(.active) {
    background: var(--gray-bg);
}

/* Org dropdown in topbar */
.v2-org-dropdown {
    position: relative;
}

.v2-org-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
    border: none;
    background: transparent;
}

.v2-org-trigger:hover {
    background: var(--gray-bg);
}

.v2-org-trigger img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.v2-org-trigger span {
    font-size: 11px;
    font-weight: 600;
    color: var(--teal-dark);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-org-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    z-index: 200;
    display: none;
}

.v2-org-menu.show { display: block; }

.v2-org-menu-header {
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Roboto Condensed', sans-serif;
    border-bottom: 1px solid var(--gray-light);
}

.v2-org-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--black);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
    cursor: pointer;
}

.v2-org-menu-item:hover {
    background: var(--gray-bg);
    text-decoration: none;
    color: var(--black);
}

.v2-org-menu-item.active {
    background: var(--teal-soft);
    font-weight: 700;
}

.v2-org-menu-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.v2-org-menu-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 4px 0;
}

/* User display */
.v2-user-name {
    font-size: 11px;
    color: var(--gray);
    font-weight: 600;
}

.v2-sign-out {
    font-size: 11px;
    color: var(--teal);
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: transparent;
}

.v2-sign-out:hover {
    text-decoration: underline;
    color: var(--teal);
}

/* ── Pull-to-refresh (mobile) ───────────────────────── */
.v2-pull-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
}

.v2-pull-indicator.pulling {
    display: flex;
}

.v2-pull-indicator.refreshing {
    display: flex;
    height: 48px;
}

.v2-pull-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-light, #e0e0e0);
    border-top-color: var(--teal, #26aece);
    border-radius: 50%;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.v2-pull-indicator.refreshing .v2-pull-spinner {
    opacity: 1;
    animation: v2-spin 0.7s linear infinite;
}

@keyframes v2-spin {
    to { transform: rotate(360deg); }
}

/* ── Navigation progress bar ─────────────────────────── */
.v2-nav-progress { height: 4px; overflow: hidden; background: rgba(0,0,0,.03); }
.v2-nav-progress-strip { width: 200%; height: 100%; background: repeating-linear-gradient(90deg, var(--white) 0%, var(--white) 20%, var(--teal-dark) 20%, var(--teal-dark) 40%, var(--teal) 40%, var(--teal) 60%, var(--amber) 60%, var(--amber) 80%, var(--yellow) 80%, var(--yellow) 100%); background-size: 50% 100%; animation: v2-nav-slide 1.8s linear infinite; }
@keyframes v2-nav-slide { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ── Main content ────────────────────────────────────── */
.v2-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
}

.v2-content {
    padding: 24px 28px 60px;
}

.v2-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 4px 4px 0;
}

/* ── Cards ───────────────────────────────────────────── */
.v2-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.v2-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-family: 'Roboto Condensed', sans-serif;
    margin: 6px 0 10px;
}

/* ── Buttons ─────────────────────────────────────────── */
.v2-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    letter-spacing: 0.5px;
    transition: opacity 0.2s, transform 0.1s;
}

.v2-btn:hover {
    opacity: 0.9;
}

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

.v2-btn-teal { background: var(--teal); color: #fff; }
.v2-btn-amber { background: var(--amber); color: #fff; }

.v2-btn:disabled, .v2-btn[disabled] {
    background: var(--gray-light);
    color: var(--gray);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}
.v2-btn-outline {
    background: none;
    border: 2px solid var(--gray-light);
    color: var(--gray);
}

/* ── Bootstrap overrides ─────────────────────────────── */
.btn-primary {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--teal-mid);
    border-color: var(--teal-mid);
}

/* ── Utility ─────────────────────────────────────────── */
.v2-text-teal-dark { color: var(--teal-dark); }
.v2-text-teal { color: var(--teal); }
.v2-text-gray { color: var(--gray); }
.v2-font-rc { font-family: 'Roboto Condensed', sans-serif; }

/* ── Mobile sidebar toggle ───────────────────────────── */
.v2-sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--gray-light);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--teal-dark);
}

.v2-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
}

.v2-sidebar-overlay.show { display: block; }

/* ── Mobile Bottom Nav Bar ──────────────────────────── */
.v2-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 150;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.v2-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray);
    gap: 2px;
    padding: 6px 16px;
    border-radius: 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.v2-bottom-nav-item:hover,
.v2-bottom-nav-item:focus {
    text-decoration: none;
    color: var(--gray);
}

.v2-bottom-nav-item.active {
    color: var(--teal);
}

.v2-bottom-nav-item i {
    font-size: 20px;
}

.v2-bottom-nav-item span {
    font-size: 10px;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    letter-spacing: 0.3px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 991px) {
    .v2-sidebar {
        left: calc(-1 * var(--sidebar-w));
    }
    .v2-sidebar.show {
        left: 0;
    }
    .v2-sidebar-toggle {
        display: none;
    }
    .v2-main {
        margin-left: 0;
    }
    .v2-topbar {
        padding-left: 16px;
    }
    .v2-topbar-logo {
        display: block;
    }
    .v2-topbar-title {
        display: none;
    }
    .v2-user-name {
        display: none;
    }
    .v2-sign-out {
        display: none;
    }
    .v2-content {
        padding-bottom: 80px;
    }
    .v2-bottom-nav {
        display: flex;
    }
}

@media (max-width: 600px) {
    .v2-content {
        padding: 16px 16px 80px;
    }
    .v2-page {
        padding: 0;
    }
    .v2-topbar {
        padding: 0 12px 0 52px;
    }
    .v2-org-trigger span {
        display: none;
    }
}

/* ── Flash messages ── */
.v2-flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    animation: v2-flash-in .3s ease;
}
.v2-flash-success {
    background: var(--teal-soft);
    color: var(--teal-dark);
    border: 1px solid var(--teal);
}
.v2-flash-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid var(--red);
}
.v2-flash-warning {
    background: var(--amber-soft);
    color: #92400e;
    border: 1px solid var(--amber);
}
@keyframes v2-flash-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
