/* ============================================================
   net2phone Brand Identity — Portal Estado de Cuenta
   Following Brand Identity Manual 2026 v2.1
   ============================================================ */

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

:root {
    /* ── Primary ────────────────────────────────────────── */
    --n2p-dark-blue:        #002540;   /* PANTONE 282 C — primary text + brand */
    --n2p-white:            #FFFFFF;
    --n2p-mid-blue:         #435E72;
    --n2p-light-mid-blue:   #C5CDD4;

    /* ── Secondary / Accents ────────────────────────────── */
    --n2p-blue:             #0095FF;   /* PANTONE 2925 C */
    --n2p-purple:           #740CE8;   /* PANTONE 266 C  */
    --n2p-pink:             #FE0687;   /* PANTONE 213 C  */

    /* Lighter tints */
    --n2p-blue-300:         #61BDFF;
    --n2p-purple-300:       #A562F0;
    --n2p-pink-300:         #FF69B7;

    /* Pale (use as bg of cards / pills) */
    --n2p-blue-50:          #CCEAFF;
    --n2p-purple-50:        #E0CAFA;
    --n2p-pink-50:          #FFDAED;

    /* ── Neutrals ───────────────────────────────────────── */
    --n2p-gray-50:          #F5F5F5;
    --n2p-gray-100:         #EFEFEF;
    --n2p-gray-200:         #B6B8B9;
    --n2p-gray-300:         #9B9D9E;
    --n2p-gray-400:         #818384;
    --n2p-gray-500:         #686A6B;
    --n2p-gray-600:         #505253;
    --n2p-gray-700:         #393B3C;
    --n2p-gray-800:         #272829;
    --n2p-gray-900:         #0E1112;
    --n2p-black:            #000000;

    /* ── Status (mapped to brand colors) ────────────────── */
    --n2p-success:          #2E7D32;
    --n2p-warning:          #F57F17;
    --n2p-danger:           var(--n2p-pink);   /* use brand pink instead of generic red */
    --n2p-danger-soft:      #C62828;           /* fallback for hard negatives */

    /* ── Aliases for legacy templates ───────────────────── */
    --primary:        var(--n2p-dark-blue);
    --primary-light:  var(--n2p-blue-50);
    --primary-accent: var(--n2p-blue);
    --success:        var(--n2p-success);
    --danger:         var(--n2p-danger-soft);
    --warning:        var(--n2p-warning);
    --bg:             var(--n2p-gray-50);
    --card:           var(--n2p-white);
    --border:         #e0e3e8;
    --text:           var(--n2p-dark-blue);
    --text-light:     var(--n2p-gray-500);

    /* ── Brand gradient (Blue → Purple → Pink) ──────────── */
    --n2p-gradient:        linear-gradient(90deg, #0095FF 0%, #740CE8 50%, #FE0687 100%);
    --n2p-gradient-diag:   linear-gradient(135deg, #0095FF 0%, #740CE8 50%, #FE0687 100%);
    --n2p-gradient-pale:   linear-gradient(90deg, #CCEAFF 0%, #E0CAFA 50%, #FFDAED 100%);
}

/* ── Base typography ─────────────────────────────────────── */
html, body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: var(--n2p-dark-blue);
    background: var(--n2p-gray-50);
    text-align: left;          /* manual: never justify on web */
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings — Extra Bold (manual rule) */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', system-ui, sans-serif;
    font-weight: 800;          /* Extra Bold */
    color: var(--n2p-dark-blue);
    line-height: 1.25;
    margin: 0;
}

/* Body text — Light (manual rule) */
p, li, td, span, label {
    font-weight: 300;
}

/* Buttons & CTAs — Bold */
button, .btn {
    font-family: 'Open Sans', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}

strong, b { font-weight: 700; }

/* ── Brand gradient bar (decorative under section titles) ─ */
.n2p-gradient-bar {
    display: block;
    height: 3px;
    width: 4rem;
    border-radius: 2px;
    background: var(--n2p-gradient);
    margin-top: 0.5rem;
}

.n2p-gradient-bar.wide   { width: 100%; }
.n2p-gradient-bar.narrow { width: 2rem; }

/* ── Header strip used app-wide ──────────────────────────── */
.n2p-header {
    background: var(--n2p-dark-blue);
    color: var(--n2p-white);
    padding: 1.2rem 0;
    position: relative;
}
.n2p-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: var(--n2p-gradient);
}
.n2p-header h1 {
    color: var(--n2p-white);
    font-size: 1.4rem;
    font-weight: 800;
}
.n2p-header .subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    font-weight: 300;
    margin-top: 0.15rem;
}

/* ── Buttons (brand styles) ──────────────────────────────── */
.btn-n2p {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;        /* pill shape — see brand palette swatches */
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s;
    line-height: 1;
}
.btn-n2p:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,37,64,0.18); }
.btn-n2p:active { transform: translateY(0); }

.btn-n2p-primary {
    background: var(--n2p-blue);
    color: var(--n2p-white);
}
.btn-n2p-primary:hover { background: #007de0; }

.btn-n2p-dark {
    background: var(--n2p-dark-blue);
    color: var(--n2p-white);
}
.btn-n2p-dark:hover { background: #001b30; }

.btn-n2p-gradient {
    background: var(--n2p-gradient);
    color: var(--n2p-white);
}

.btn-n2p-outline {
    background: transparent;
    color: var(--n2p-white);
    border: 1px solid rgba(255,255,255,0.5);
}
.btn-n2p-outline:hover { background: rgba(255,255,255,0.1); }

.btn-n2p-ghost {
    background: var(--n2p-blue-50);
    color: var(--n2p-dark-blue);
}
.btn-n2p-ghost:hover { background: var(--n2p-purple-50); }

/* ── Cards ───────────────────────────────────────────────── */
.n2p-card {
    background: var(--n2p-white);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 1px 3px rgba(0,37,64,0.06), 0 1px 2px rgba(0,37,64,0.04);
}

/* ── Badges (brand pill style) ───────────────────────────── */
.n2p-badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.n2p-badge-success { background: #C8E6C9; color: var(--n2p-success); }
.n2p-badge-danger  { background: var(--n2p-pink-50); color: var(--n2p-pink); }
.n2p-badge-warning { background: #FFE0B2; color: var(--n2p-warning); }
.n2p-badge-info    { background: var(--n2p-blue-50); color: var(--n2p-blue); }
.n2p-badge-neutral { background: var(--n2p-gray-100); color: var(--n2p-gray-600); }

/* ── Money / tabular numbers ─────────────────────────────── */
.money, .tabular {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ===========================================================
   App shell — collapsible left sidebar
   =========================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--n2p-gray-50);
}

.app-sidebar {
    width: 232px;
    background: var(--n2p-dark-blue);
    color: var(--n2p-white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.22s ease;
    flex-shrink: 0;
    z-index: 50;
}
.app-sidebar.collapsed { width: 60px; }

.sb-head {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 1rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 60px;
    position: relative;
}
.sb-brand {
    display: flex; align-items: center; gap: 0.55rem;
    color: var(--n2p-white); text-decoration: none;
    flex: 1; min-width: 0;
}
.sb-logo {
    background: var(--n2p-gradient);
    width: 30px; height: 30px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.78rem;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.sb-brand-text {
    font-weight: 800; font-size: 0.92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--n2p-white);
}
.app-sidebar.collapsed .sb-brand-text { display: none; }

.sb-toggle {
    background: rgba(255,255,255,0.08);
    border: none; color: var(--n2p-white);
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.78rem;
    transition: background 0.15s;
    flex-shrink: 0;
}
.sb-toggle:hover { background: rgba(255,255,255,0.18); }
/* Collapsed sidebar: stack logo on top, toggle below — no floating chip */
.app-sidebar.collapsed .sb-head {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 0;
    align-items: center;
    min-height: auto;
}
.app-sidebar.collapsed .sb-brand {
    flex: none;
    justify-content: center;
}
.app-sidebar.collapsed .sb-toggle {
    position: static;
    background: rgba(255,255,255,0.08);
    width: 32px;
    height: 22px;
    border-radius: 5px;
}
.app-sidebar.collapsed .sb-toggle:hover { background: rgba(255,255,255,0.18); }

.sb-nav { flex: 1; padding: 0.6rem 0; overflow-y: auto; overflow-x: hidden; }
.sb-nav::-webkit-scrollbar { width: 5px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.sb-section {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255,255,255,0.4);
    padding: 0.9rem 1rem 0.35rem;
    font-weight: 700;
}
.app-sidebar.collapsed .sb-section { display: none; }

.sb-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-size: 0.84rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.15s;
    cursor: pointer;
    white-space: nowrap;
    background: transparent; width: 100%; text-align: left;
    font-family: 'Open Sans', system-ui, sans-serif;
    border-top: none; border-right: none; border-bottom: none;
}
.sb-item:hover { background: rgba(255,255,255,0.06); color: var(--n2p-white); }
.sb-item.active {
    background: linear-gradient(90deg, rgba(0,149,255,0.18), rgba(0,149,255,0));
    color: var(--n2p-white);
    border-left-color: var(--n2p-blue);
}
.sb-icon {
    width: 22px; text-align: center; font-size: 1rem; flex-shrink: 0;
    opacity: 0.95;
}
.sb-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-arrow {
    font-size: 0.6rem; opacity: 0.5;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sb-item[aria-expanded="true"] .sb-arrow { transform: rotate(180deg); }
.app-sidebar.collapsed .sb-label,
.app-sidebar.collapsed .sb-arrow { display: none; }
.app-sidebar.collapsed .sb-item {
    padding: 0.6rem 0;
    justify-content: center;
    border-left-width: 0;
    border-right: 3px solid transparent;
    background: transparent;
}
.app-sidebar.collapsed .sb-item:hover { background: rgba(255,255,255,0.06); }
.app-sidebar.collapsed .sb-item.active {
    border-right-color: var(--n2p-blue);
    background: transparent;
}
.app-sidebar.collapsed .sb-item.active .sb-icon {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(0,149,255,0.55));
}

/* Submenu */
.sb-submenu {
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
    background: rgba(0,0,0,0.18);
}
.sb-submenu.open { max-height: 400px; }
.sb-subitem {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 1rem 0.45rem 2.7rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.78rem; font-weight: 500;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.sb-subitem:hover { background: rgba(255,255,255,0.05); color: var(--n2p-white); }
.sb-subitem.active { color: var(--n2p-blue-300); font-weight: 600; }
.sb-subitem::before { content: '•'; opacity: 0.5; }
.app-sidebar.collapsed .sb-submenu { display: none; }

.sb-foot {
    padding: 0.7rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    display: flex; align-items: center; gap: 0.5rem;
    min-height: 44px;
}
.app-sidebar.collapsed .sb-foot { padding: 0.7rem 0; justify-content: center; }
.app-sidebar.collapsed .sb-foot .sb-foot-text { display: none; }
.sb-foot-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--n2p-success); flex-shrink: 0;
}

/* Main area */
.app-main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
}

/* Top breadcrumb bar */
.app-topbar {
    background: var(--n2p-white);
    border-bottom: 1px solid #e0e3e8;
    padding: 0.85rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky; top: 0; z-index: 40;
}
.app-crumbs {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem;
    min-width: 0;
}
.app-crumbs a { color: var(--n2p-gray-500); text-decoration: none; font-weight: 500; }
.app-crumbs a:hover { color: var(--n2p-blue); }
.app-crumbs .sep { color: var(--n2p-gray-300); font-size: 0.75rem; }
.app-crumbs .current { color: var(--n2p-dark-blue); font-weight: 700; }

/* Mobile responsive */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed; left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }
    .app-sidebar.mobile-open { transform: translateX(0); }
    .app-sidebar.collapsed { width: 232px; transform: translateX(-100%); }
}
