@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    --primary:        #00509d;
    --primary-dark:   #003f88;
    --primary-light:  #f0f6fc;
    --accent:         #fdc500;
    --accent-dark:    #e5b200;
    --danger:         #ef4444;
    --success:        #10b981;
    --warning:        #f59e0b;

    --bg-body:        #ffffff;
    --bg-card:        #ffffff;
    --bg-sidebar:     #ffffff;
    --border:         #f1f5f9;
    --border-focus:   #00509d;

    --text-main:      #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;

    --shadow-xs:  0 1px 2px rgba(0,0,0,.03);
    --shadow-sm:  0 4px 6px -1px rgba(0,0,0,.04), 0 2px 4px -2px rgba(0,0,0,.04);
    --shadow-md:  0 10px 15px -3px rgba(0,0,0,.05), 0 4px 6px -4px rgba(0,0,0,.03);
    --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.05), 0 8px 10px -6px rgba(0,0,0,.03);
    --shadow-xl:  0 25px 50px -12px rgba(0,0,0,.15);

    --sidebar-w:   260px;
    --header-h:    64px;
    --bottom-nav-h:64px;

    --r-xs:  8px;
    --r-sm:  12px;
    --r-md:  16px;
    --r-lg:  24px;
    --r-xl:  32px;
    --r-full:9999px;

    --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--text-main); }

a { color: var(--primary); }

img { max-width: 100%; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* =============================================
   LAYOUT
   ============================================= */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 1000;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--primary);
}

.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 17px;
    flex-shrink: 0;
}

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link-item i, .nav-link-item .nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.nav-link-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link-item:hover i, .nav-link-item:hover .nav-icon { transform: scale(1.1); }

.nav-link-item.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,80,157,0.25);
}

.nav-link-item.active i, .nav-link-item.active .nav-icon { color: white; }

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-full);
    min-width: 20px;
    text-align: center;
}

.nav-badge.danger { background: var(--danger); color: white; }

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-pin {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-user .logout-btn {
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    flex-shrink: 0;
    font-size: 15px;
}
.sidebar-user .logout-btn:hover { background: #fee2e2; color: var(--danger); }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.has-sidebar .main-content { margin-left: var(--sidebar-w); }

.main-content .container {
    max-width: 840px;
    padding: 24px 20px;
}

/* =============================================
   MOBILE HEADER
   ============================================= */
.mobile-header {
    display: none;
    position: fixed;
    width: 100%;
    top: 0;
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 850;
    box-shadow: var(--shadow-xs);
}

.hamburger-btn {
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
}
.hamburger-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }

.mobile-brand {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mobile-brand i { color: var(--primary); font-size: 18px; }

.mobile-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    text-decoration: none;
}

/* =============================================
   MOBILE DRAWER OVERLAY
   ============================================= */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 900;
    backdrop-filter: blur(2px);
    transition: opacity var(--transition);
}

body.drawer-open .drawer-overlay { display: block; }
body.drawer-open .sidebar { transform: translateX(0) !important; }

/* =============================================
   BOTTOM NAV (MOBILE)
   ============================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 860;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 600;
    position: relative;
    transition: color var(--transition);
    padding: 0 4px;
}

.bottom-nav-item i { font-size: 18px; line-height: 1; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active i { animation: popIn 0.25s ease; }

.bottom-nav-badge {
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(10px);
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
    padding: 0 3px;
}

/* =============================================
   CARDS
   ============================================= */
.card-surface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card-surface:hover { box-shadow: var(--shadow-md); }

/* Legacy alias */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.glass-card:hover { box-shadow: var(--shadow-md); }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary-app {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    padding: 9px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.btn-primary-app:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,80,157,0.30);
}
.btn-primary-app:active { transform: translateY(0); }

.btn-bbm {
    background: var(--primary);
    color: #fff !important;
    border: none;
    border-radius: var(--r-sm);
    padding: 9px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-bbm:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,80,157,0.28);
}

.btn-glass {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    transition: all var(--transition);
    cursor: pointer;
}
.btn-glass:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-accent {
    background: var(--accent);
    color: var(--primary-dark) !important;
    border: none;
    border-radius: var(--r-sm);
    font-weight: 700;
    transition: all var(--transition);
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* Circular icon buttons */
.btn-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-size: 15px;
}
.btn-icon:hover { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary); }
.btn-icon.active { background: var(--primary); border-color: var(--primary); color: white; }

/* =============================================
   FORM CONTROLS
   ============================================= */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 14px;
    padding: 9px 14px;
    color: var(--text-main);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,80,157,0.12);
    outline: none;
    background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-light); }

.input-group .form-control { border-radius: 0; }
.input-group .input-group-text {
    border: 1.5px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 14px;
}
.input-group > .form-control:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group > .form-control:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group > .input-group-text:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: none; }
.input-group > .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

/* =============================================
   AVATAR
   ============================================= */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.avatar-xs  { width: 28px;  height: 28px; }
.avatar-sm  { width: 36px;  height: 36px; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-lg  { width: 56px;  height: 56px; }
.avatar-xl  { width: 80px;  height: 80px; }
.avatar-2xl { width: 100px; height: 100px; }
.avatar-3xl { width: 120px; height: 120px; }

/* Gradient ring (keep legacy) */
.avatar-ring {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 2.5px;
    flex-shrink: 0;
}
.avatar-ring img {
    border-radius: 50%;
    border: 2.5px solid var(--bg-card);
    display: block;
    object-fit: cover;
}

/* Online indicator */
.online-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-card);
    position: absolute;
    bottom: 1px; right: 1px;
}
.offline-dot { background: #d1d5db; }

/* =============================================
   STATUS / FEED CARDS
   ============================================= */
.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
    margin-bottom: 14px;
}
.status-card:hover { box-shadow: var(--shadow-sm); }

.status-card .author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}
.status-card .author-name:hover { color: var(--primary); }

.status-card .post-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.status-content { 
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 16px;font-size: 14px; color: var(--text-secondary); padding: 10px 0; }


.status-actions {
    display: flex;
    border-top: 1px solid var(--border);
    margin-top: 2px;
    padding-top: 2px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.action-btn:hover { background: var(--bg-body); color: var(--primary); }
.action-btn.liked { color: var(--danger); }
.action-btn.liked i { animation: heartbeat 0.35s ease-out; }

.action-btn i, .action-btn .fa { font-size: 15px; }

/* Post compose */
.compose-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 20px; box-shadow: var(--shadow-xs); margin-bottom: 16px; }
.compose-input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-main);
    background: transparent;
    padding: 10px 0;
    line-height: 1.6;
}
.compose-input::placeholder { color: var(--text-light); }

/* =============================================
   CHAT ROOM
   ============================================= */
.chat-room-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 0px);
}

.has-sidebar .chat-room-wrap {
    height: 100vh;
    position: fixed;
    right: 0;
    left: var(--sidebar-w);
    top: 0;
}

.chat-header {
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
    z-index: 10;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px;
    background: #f8fafc;
    background-image: radial-gradient(#e2e8f0 0.8px, transparent 0.8px);
    background-size: 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-input-bar {
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.message-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    animation: msgIn 0.2s ease-out;
}

.msg-me {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,80,157,0.2);
}

.msg-them {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.msg-time {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 3px;
    display: block;
    text-align: right;
}

.msg-them .msg-time { text-align: left; }

.msg-status { font-size: 11px; color: rgba(255,255,255,0.75); margin-left: 4px; }

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}
.typing-dots span {
    width: 7px; height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Chat list item */
.chat-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: pointer;
}
.chat-list-item:hover { background: var(--primary-light); }
.chat-list-item:last-child { border-bottom: none; }

/* =============================================
   NOTIFICATIONS
   ============================================= */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-body); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #d9e8f8; }

.notif-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* =============================================
   PROFILE PAGE
   ============================================= */
.profile-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #0070c9 100%);
    border-radius: var(--r-md) var(--r-md) 0 0;
    position: relative;
}

.profile-avatar-wrap {
    position: absolute;
    bottom: -48px;
    left: 24px;
    border: 4px solid var(--bg-card);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.profile-body { padding: 56px 24px 24px; }

.profile-stat {
    text-align: center;
}
.profile-stat .stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}
.profile-stat .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =============================================
   FRIENDS PAGE
   ============================================= */
.pin-display {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--r-sm);
    padding: 14px 20px;
    text-align: center;
    display: block;
    font-variant-numeric: tabular-nums;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.friend-item:hover { background: var(--primary-light); }
.friend-item:last-child { border-bottom: none; }

.friend-status {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0 20px;
    margin-bottom: 4px;
    margin-top: 20px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-body); }

.settings-label h6 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.settings-label p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container-app {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    background: var(--bg-card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 360px;
    border-left: 4px solid var(--primary);
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-app.hiding { opacity: 0; transform: translateX(20px); }
.toast-app.toast-success { border-color: var(--success); }
.toast-app.toast-success .toast-icon { color: var(--success); }
.toast-app.toast-error { border-color: var(--danger); }
.toast-app.toast-error .toast-icon { color: var(--danger); }
.toast-app.toast-warning { border-color: var(--warning); }
.toast-app.toast-warning .toast-icon { color: var(--warning); }
.toast-app.toast-info { border-color: var(--primary); }
.toast-app.toast-info .toast-icon { color: var(--primary); }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { font-size: 13px; font-weight: 500; color: var(--text-main); flex: 1; line-height: 1.4; }
.toast-close { font-size: 13px; color: var(--text-muted); cursor: pointer; background: none; border: none; flex-shrink: 0; padding: 0; }
.toast-close:hover { color: var(--text-main); }

/* =============================================
   SKELETON LOADING
   ============================================= */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton-line,
.skeleton-circle,
.skeleton-avatar {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 600px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--r-xs);
    display: block;
}

.skeleton-circle, .skeleton-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-card { pointer-events: none; }

/* =============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================= */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes heartbeat {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

@keyframes popIn {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

@keyframes pulse-record {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

.animate-slide-up  { animation: slideUp 0.45s cubic-bezier(0.23,1,0.32,1) forwards; }
.animate-fade-in   { animation: fadeIn 0.4s ease forwards; }

/* =============================================
   UTILITIES
   ============================================= */
.text-bbm   { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-bbm     { background: var(--primary) !important; }
.bg-accent  { background: var(--accent) !important; }
.bg-primary { background: var(--primary) !important; }
.bg-primary-light { background: var(--primary-light) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.fs-xs  { font-size: 11px; }
.fs-sm  { font-size: 13px; }
.fs-base{ font-size: 15px; }
.fs-lg  { font-size: 17px; }

.cursor-pointer { cursor: pointer; }
.overflow-y-auto { overflow-y: auto; }

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

/* Section labels */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
}
.empty-state-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--primary);
}
.empty-state h5 { font-size: 16px; color: var(--text-main); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; color: var(--text-muted); }

/* Load More */
.load-more-wrap { text-align: center; padding: 20px 0 8px; }

/* Badge boostrap overrides */
.badge { font-weight: 600; letter-spacing: 0.2px; }

/* =============================================
   RESPONSIVE — TABLET & MOBILE
   ============================================= */
@media (max-width: 1199.98px) {
    .main-content .container { max-width: 100%; }
}

@media (max-width: 991.98px) {
    /* Sidebar hidden off-screen, slides in as drawer */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .has-sidebar .main-content { margin-left: 0; }
    .main-content { padding-bottom: var(--bottom-nav-h); }
    .main-content .container { padding: 16px 14px calc(var(--bottom-nav-h) + 16px); }

    /* Show mobile header */
    .mobile-header { display: flex; }

    /* Show bottom nav */
    .bottom-nav { display: block; }

    .chat-room-wrap {
        height: calc(100vh - var(--bottom-nav-h) - var(--header-h));
        position: static;
        left: auto; right: auto;
    }
    .has-sidebar .chat-room-wrap { height: calc(100vh - var(--bottom-nav-h) - var(--header-h)); position: static; left: auto; right: auto; }
}

@media (max-width: 767.98px) {
    .message-bubble { max-width: 88%; }
    .profile-cover { height: 130px; }
    .status-card { padding: 14px 16px; }
    .pin-display { font-size: 22px; letter-spacing: 4px; }
}

@media (max-width: 575.98px) {
    .action-btn span { display: none; }
    .action-btn { padding: 8px 6px; }
}

@media (min-width: 270px) and (max-width: 690px) {
    .main-content {
        width: 100%;
        max-width: 100%;
        padding-top: 64px;
    }

    .modal {
        z-index: 1231 !important;
    }
}