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

:root {
    --primary: #0056b3;
    --primary-light: #e0edff;
    --bg-color: #f3f4f6;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --shadow-soft: 0 4px 24px rgba(0,0,0,0.04);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* APP ROOT & VIEWS CONTAINER */
#appRoot {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

.view-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.4s ease;
    will-change: transform, opacity;
}

/* View states */
.view-feed {
    z-index: 10;
    transform: translateX(0);
    opacity: 1;
}

.view-feed.hidden {
    display: none !important;
}

.view-post, .view-internal {
    z-index: 20;
    transform: translateX(100%);
    background-color: var(--surface);
    opacity: 0;
    pointer-events: none;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
}

.view-post.active, .view-internal.active {
    display: flex !important;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   FEED VIEW (MAIN 2-COLUMN LAYOUT)
   ========================================= */
.view-feed {
    position: relative;
    overflow: hidden;
}

.ambient-glow {
    position: fixed;
    top: -120px;
    left: -120px;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(0, 86, 179, 0.25) 0%, rgba(0, 123, 255, 0.1) 45%, rgba(243, 244, 246, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(50px);
}

.ambient-glow-2 {
    position: fixed;
    bottom: -150px;
    right: -100px;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(0, 168, 255, 0.15) 0%, rgba(243, 244, 246, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}

.feed-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 36px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

/* Navbar inside Feed */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 24px;
    margin-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 44px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-box {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: 15px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
}

.btn-icon:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}

/* Category Filter Pill */
.active-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.active-category-pill button {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: 4px;
}

/* CARDS STYLING (The Apple/Ncmaz Look) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.card-post {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/5;
    transform: translateZ(0);
}

.card-hero {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-post:hover .card-img {
    transform: scale(1.05);
}

.card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 28px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-hero .card-content {
    padding: 40px;
}

.tag {
    align-self: flex-start;
    background-color: var(--primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.tag.fique-por-dentro { background-color: rgba(14, 165, 233, 0.9); }
.tag.banco-de-talentos { background-color: rgba(168, 85, 247, 0.9); }
.tag.eventos { background-color: rgba(16, 185, 129, 0.9); }
.tag.escalas { background-color: rgba(245, 158, 11, 0.9); }
.tag.comunicados { background-color: rgba(225, 29, 72, 0.9); }
.tag.saude-e-seguranca { background-color: rgba(16, 185, 129, 0.9); }
.tag.treinamentos { background-color: rgba(99, 102, 241, 0.9); }
.tag.institucional { background-color: rgba(14, 165, 233, 0.9); }

.card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.card-hero .card-title {
    font-size: 32px;
    max-width: 80%;
}

.card-meta {
    font-size: 13px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* SIDEBAR (Desktop Right Column) */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.widget {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* =========================================
   MENU INSTITUCIONAL (EXACT MATCH USER IMAGE)
   ========================================= */
.nav-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.nav-item:hover {
    background-color: rgba(241, 245, 249, 0.9);
    transform: translateX(3px);
}

.nav-icon-box {
    width: 50px;
    height: 50px;
    background: #ffffff;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(241, 245, 249, 0.9);
    color: #334155;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-item:hover .nav-icon-box {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    color: var(--primary);
    transform: scale(1.05);
}

.nav-label {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.2px;
    line-height: 1.25;
    transition: color 0.2s ease;
}

.nav-item.active .nav-icon-box {
    color: #0056b3;
    border-color: rgba(0, 86, 179, 0.2);
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.15);
}

.nav-item.active .nav-label {
    color: #0056b3;
    font-weight: 700;
}

/* Trending List in Sidebar */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trending-item {
    display: flex;
    gap: 16px;
    cursor: pointer;
    align-items: center;
}

.trending-item:hover .t-img {
    transform: scale(1.05);
}

.t-img-wrapper {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.t-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.t-content h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.t-content span {
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================================
   CARD ESCALA MÉDICA (ARTE COM FUNDO DO SITE)
   ========================================= */
.card-escala-medica {
    position: relative;
    display: block;
    width: 100%;
    min-height: 180px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    background-image: url('https://hsvicente.org.br/wp-content/uploads/2020/05/page-title-background.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 24px rgba(0, 86, 179, 0.18), 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.card-escala-medica:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 36px rgba(0, 86, 179, 0.3), 0 4px 12px rgba(0,0,0,0.08);
}

.escala-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.88) 0%, rgba(11, 94, 215, 0.78) 50%, rgba(0, 60, 130, 0.92) 100%);
    transition: background 0.3s ease;
}

.card-escala-medica:hover .escala-bg-overlay {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.82) 0%, rgba(11, 94, 215, 0.72) 50%, rgba(0, 60, 130, 0.88) 100%);
}

.escala-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #ffffff;
    gap: 8px;
}

.escala-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.escala-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-top: 4px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.escala-desc {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.escala-btn-link {
    margin-top: 12px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #0056b3;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.card-escala-medica:hover .escala-btn-link {
    background: #e0edff;
    gap: 8px;
}

/* =========================================
   INTERNAL VIEWS & ARTICLES
   ========================================= */
.post-topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    z-index: 40;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.post-top-logo {
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.post-header-img {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 400px;
}

.post-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: #fff;
    color: var(--text-main);
}

.post-article {
    max-width: 860px;
    margin: -80px auto 60px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 50px 60px;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.post-article h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.8px;
    margin-bottom: 24px;
    color: var(--text-main);
}

.author-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.author-info strong {
    display: block;
    font-size: 15px;
}
.author-info span {
    font-size: 13px;
    color: var(--text-muted);
}

.post-body {
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.post-body p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.post-body a {
    color: var(--primary);
    text-decoration: underline;
    word-break: break-all;
    font-weight: 500;
    transition: color 0.2s ease;
}

.post-body a:hover {
    color: #003d80;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.post-body-hero-image {
    margin: 24px 0 32px;
    text-align: center;
}

.post-body-hero-image img {
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    border-radius: var(--radius-md);
    margin: 0 auto;
    display: inline-block;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border: 1px solid var(--border-color);
}

.post-body figure {
    margin: 24px 0;
    text-align: center;
}

/* Dedicated Internal Views Header */
.internal-topbar {
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.internal-topbar .btn-back {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
}

.internal-topbar .btn-back:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.internal-title {
    text-align: center;
    flex: 1;
    margin: 0 16px;
}

.internal-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.internal-title span {
    font-size: 12px;
    color: var(--text-muted);
}

.internal-topbar .post-top-logo {
    filter: none;
    height: 38px;
}

/* Iframe Wrapper */
.iframe-wrapper {
    flex: 1;
    width: 100%;
    height: calc(100vh - 76px);
    background: #ffffff;
    position: relative;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Planejamento Estratégico View */
.planejamento-container {
    flex: 1;
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.planejamento-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.planejamento-img {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* =========================================
   LOGIN VIEW
   ========================================= */
.view-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b5ed7;
    background-image: url('https://hsvicente.org.br/intranet/wp-content/uploads/2024/07/bg_Login_intranet_HSV_2024.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    padding: 16px;
}

.view-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 86, 179, 0.7);
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.login-logo {
    width: 100%;
    max-width: 240px;
    background: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-card {
    background: #fff;
    width: 100%;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-card h2 {
    font-size: 15px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    background: #fdfdfd;
}

.login-card input:focus {
    border-color: var(--primary);
    background: #fff;
}

.input-icon {
    position: relative;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    margin: 20px 0;
    cursor: pointer;
}

.btn-acessar {
    width: 100%;
    background-color: #0b5ed7;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 20px;
}

.btn-acessar:hover {
    background-color: #004a99;
}

.lost-pass {
    display: block;
    text-align: left;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.lost-pass:hover {
    text-decoration: underline;
}

/* =========================================
   MOBILE BOTTOM NAVIGATION (APPLE GLASS PILL)
   ========================================= */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(28px) saturate(210%);
    -webkit-backdrop-filter: blur(28px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 40px;
    padding: 8px 12px;
    z-index: 99999;
    justify-content: space-around;
    align-items: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

/* Hide bottom nav while on Login screen */
#viewLogin.active ~ #mobileBottomNav,
#viewLogin:not([style*="display: none"]) ~ #mobileBottomNav {
    display: none !important;
}

.mobile-nav-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    position: relative;
}

.mobile-nav-btn:active {
    transform: scale(0.92);
}

.mobile-nav-btn.active {
    color: #0056b3;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.12);
}

.mobile-nav-btn svg {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-btn.active svg {
    transform: scale(1.12) translateY(-1px);
    color: #0056b3;
}

@media (max-width: 1024px) {
    .feed-container {
        grid-template-columns: 1fr;
        padding: 16px 16px 120px; /* Space for floating pill bar */
    }
    
    .sidebar {
        display: none;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card-hero, .card-post {
        grid-column: 1 / -1;
        aspect-ratio: 4/4;
    }

    .search-box {
        display: none;
    }

    .post-article {
        margin: -40px 16px 40px;
        padding: 30px 20px;
        border-radius: var(--radius-md);
    }
}

/* =========================================
   MODAL DIALOGS (PROFILE & NEW POST)
   ========================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    animation: modalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card-lg {
    max-width: 640px;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.modal-user-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.modal-user-info span {
    font-size: 13px;
    color: var(--text-muted);
}

.user-role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e2e8f0;
    color: #475569;
}

.user-role-badge.admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.btn-close-modal:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.admin-badge-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.admin-badge-header svg {
    color: #f59e0b;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
}

.btn-primary-sm {
    align-self: flex-start;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary-sm:hover {
    background: #004494;
}

.btn-outline-sm {
    align-self: flex-start;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-sm:hover {
    background: #f1f5f9;
}

.btn-admin-action {
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-admin-action:hover {
    background: #1e40af;
}

.btn-admin-link {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-admin-link:hover {
    background: #dbeafe;
}

.btn-logout {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #fecaca;
}


