/* =========================================================
   Ayele Degu International Hotel — Chat Styles (Complete)
   Navy + Gold Theme · Logo · Favicon · Responsive · Reactions
   ========================================================= */

/* =========================================================
   RESET & VARIABLES
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* === Ayele Degu Brand Palette === */
    --navy-900:      #05132e;
    --navy-800:      #0a1f44;
    --navy-700:      #0f2a5c;
    --navy-600:      #14336e;
    --navy-500:      #1b4185;
    --navy-400:      #2a5aa3;

    --gold-500:      #d4af37;
    --gold-400:      #e0bd4a;
    --gold-300:      #f5d76e;
    --gold-600:      #a67c00;
    --gold-700:      #8b6914;
    --gold-glow:     rgba(212, 175, 55, 0.35);

    /* Semantic tokens */
    --primary:       #0a1f44;
    --primary-dark:  #05132e;
    --primary-light: #1b4185;
    --accent:        #d4af37;
    --accent-dark:   #a67c00;
    --accent-light:  #f5d76e;

    --bg:            #f1f5f9;
    --sidebar-bg:    #0a1f44;
    --sidebar-hover: #14336e;
    --text:          #1e293b;
    --text-light:    #64748b;
    --border:        #e2e8f0;
    --success:       #10b981;
    --danger:        #ef4444;
    --card:          #ffffff;
    --messages-bg:   #f8fafc;
}

html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   AUTH PAGES
   ========================================================= */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-900) 100%);
    padding: 16px;
    overflow-y: auto;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card h1 { font-size: 22px; color: var(--primary); margin-bottom: 4px; text-align: center; }
.auth-card h2 { font-size: 16px; color: var(--text-light); margin-bottom: 24px; text-align: center; font-weight: 400; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: #fff;
    width: 100%;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 31, 68, 0.35);
}
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold-300) 0%, var(--accent) 50%, var(--gold-600) 100%);
    color: var(--navy-900);
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}
.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.45);
}
.btn-gold:active { transform: translateY(0); }

.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-light); }
.auth-link a { color: var(--navy-700); text-decoration: none; font-weight: 600; }

.alert { padding: 12px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; animation: alertIn 0.3s ease; }
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-error   { background: #fee2e2; color: var(--danger); }
.alert-success { background: #dcfce7; color: #15803d; }

/* =========================================================
   CHAT APP LAYOUT
   ========================================================= */
.chat-app { display: flex; height: 100vh; height: 100dvh; }

/* =========================================================
   SIDEBAR — Navy & Gold
   ========================================================= */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(212, 175, 55, 0.5) 20%,
        rgba(212, 175, 55, 0.5) 80%,
        transparent 100%);
    pointer-events: none;
}

.sidebar-header {
    position: relative;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
.brand-block { display: flex; flex-direction: column; }

/* Sidebar brand row with logo */
.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
    transition: all 0.25s;
}
.sidebar-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
}

.sidebar-logo-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
    color: var(--navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-brand {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.3px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    text-shadow: 0 1px 8px rgba(212, 175, 55, 0.25);
}

.sidebar-header .subtitle {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    color: rgba(212, 175, 55, 0.6);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 500;
    margin: 2px 0 0;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent);
    border: none;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.sidebar-close:active { background: rgba(212, 175, 55, 0.2); }

.user-panel {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: rgba(212, 175, 55, 0.05);
    gap: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}
.user-avatar-link {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.user-avatar-link:hover { transform: scale(1.08); }

.user-avatar {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(212, 175, 55, 0.35);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 40px;
    height: 40px;
    display: block;
}
.user-avatar-link:hover .user-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: rgba(212, 175, 55, 0.7); }
.status-online { color: #4ade80; }

.logout-btn {
    color: rgba(148, 163, 184, 0.85);
    text-decoration: none;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}
.logout-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    transform: scale(1.1);
}

.theme-toggle:hover { transform: scale(1.1) rotate(15deg); }

.sidebar-section { flex: 1; overflow-y: auto; padding: 12px 0; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.65);
    letter-spacing: 1.5px;
    font-weight: 700;
}

.btn-icon {
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.7);
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-icon:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    transform: rotate(90deg);
}

.group-list { list-style: none; }
.group-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    gap: 12px;
    transition: background 0.2s, transform 0.15s;
    min-height: 60px;
    border-left: 3px solid transparent;
}
.group-item:hover {
    background: var(--sidebar-hover);
    transform: translateX(3px);
    border-left-color: rgba(212, 175, 55, 0.4);
}
.group-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), transparent);
    border-left-color: var(--accent);
}
.group-item.active .group-name { color: var(--accent); font-weight: 600; }

.group-item.discover { opacity: 0.75; }
.group-item.discover:hover { opacity: 1; }

.group-avatar {
    width: 36px;
    height: 36px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 15px;
}
.group-item:hover .group-avatar {
    transform: scale(1.08);
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent);
}

.group-details { flex: 1; min-width: 0; }
.group-name {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-preview {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.empty-groups {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.7);
    font-style: italic;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    font-size: 10px;
    color: rgba(212, 175, 55, 0.5);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
    font-style: italic;
}
.footer-diamond { font-size: 6px; opacity: 0.7; }

/* =========================================================
   MAIN CHAT AREA
   ========================================================= */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card);
    min-width: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 2px solid var(--accent);
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-700) 100%);
    color: #fff;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}
.chat-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-light) 50%,
        transparent 100%);
}
.chat-header-info { min-width: 0; flex: 1; }
.chat-header h2 {
    font-size: 18px;
    color: #fff;
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
    letter-spacing: 0.3px;
}
.chat-sub { font-size: 12px; color: rgba(212, 175, 55, 0.7); margin-top: 2px; }

.online-users { display: flex; align-items: center; }
.online-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-400), var(--accent));
    color: var(--navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    border: 2px solid var(--navy-800);
    margin-left: -8px;
    transition: transform 0.2s;
    cursor: default;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    overflow: hidden;
}
.online-dot:first-child { margin-left: 0; }
.online-dot:hover { transform: translateY(-3px) scale(1.15); z-index: 2; }
.online-dot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.online-more {
    margin-left: 6px;
    font-size: 11px;
    color: rgba(212, 175, 55, 0.8);
    font-weight: 600;
}

/* =========================================================
   MESSAGES
   ========================================================= */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--messages-bg);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(10, 31, 68, 0.03) 0%, transparent 30%);
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.welcome-crest {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: crestFloat 4s ease-in-out infinite;
}
@keyframes crestFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.welcome-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.35));
}
.welcome-logo-fallback {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.35));
}
.welcome-message h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--navy-800);
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
}
.welcome-divider {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 8px;
    margin-bottom: 16px;
    opacity: 0.7;
}
.welcome-tip { margin-top: 14px; font-size: 13px; opacity: 0.85; }
.loading, .empty-chat {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
    animation: msgIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes msgIn {
    0%   { opacity: 0; transform: translateY(15px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.message.own { flex-direction: row-reverse; }

.msg-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.25);
}
.msg-avatar-img {
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}
.msg-body { max-width: 70%; }
.msg-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-700);
    margin-bottom: 4px;
}
.msg-role {
    font-size: 10px;
    color: var(--accent-dark);
    text-transform: uppercase;
    margin-left: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.msg-bubble {
    background: var(--card);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border);
}
.message.other:hover .msg-bubble { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09); }
.message.own .msg-bubble {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: #fff;
    border-color: transparent;
}
.message.own:hover .msg-bubble {
    box-shadow: 0 4px 14px rgba(10, 31, 68, 0.35);
}

.msg-text { font-size: 14px; line-height: 1.5; }
.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}
.msg-time { font-size: 10px; color: var(--text-light); }
.message.own .msg-time { color: rgba(212, 175, 55, 0.7); }

.read-receipt {
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
}
.read-receipt.sent      { color: rgba(212, 175, 55, 0.6); }
.read-receipt.delivered { color: rgba(212, 175, 55, 0.85); }
.read-receipt.read      { color: #93c5fd; }

/* =========================================================
   AVATARS
   ========================================================= */
.avatar-img {
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
    border: 2px solid transparent;
}
.avatar-initials {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-500), var(--navy-800));
    text-transform: uppercase;
    user-select: none;
    border: 1px solid rgba(212, 175, 55, 0.3);
}
.table-avatar {
    border-radius: 50%;
    object-fit: cover;
    width: 36px;
    height: 36px;
    display: block;
}

/* =========================================================
   ATTACH BUTTON
   ========================================================= */
.btn-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: rgba(10, 31, 68, 0.06);
    border: 1px solid rgba(10, 31, 68, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    user-select: none;
    position: relative;
}
.btn-attach:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    transform: scale(1.05);
}
.btn-attach:active { transform: scale(0.95); }
.btn-attach svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--navy-700);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke 0.2s;
}
.btn-attach:hover svg { stroke: var(--accent-dark); }
.btn-attach input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   ATTACH PREVIEW
   ========================================================= */
.attach-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    animation: alertIn 0.25s ease;
}
.attach-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attach-remove {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.attach-remove:hover { color: var(--danger); background: #fee2e2; }

/* =========================================================
   IMAGE ATTACHMENTS
   ========================================================= */
.msg-attachment.image { display: inline-block; max-width: 220px; }
.msg-attachment.image img {
    width: 100%;
    max-width: 220px;
    max-height: 165px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.msg-attachment.image img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.msg-attachment.image .attach-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.message.own .msg-attachment.image .attach-meta { color: rgba(212, 175, 55, 0.8); }
.message .msg-bubble:has(.msg-attachment.image) { padding: 6px; background: var(--card); }
.message.own .msg-bubble:has(.msg-attachment.image) {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
}

/* =========================================================
   FILE ATTACHMENTS
   ========================================================= */
.msg-attachment.file .file-download {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(10, 31, 68, 0.05);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    min-width: 200px;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid rgba(10, 31, 68, 0.08);
}
.msg-attachment.file .file-download:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}
.message.own .msg-attachment.file .file-download {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}
.message.own .msg-attachment.file .file-download:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.4);
}

.file-icon { font-size: 24px; }
.file-details { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.file-size { font-size: 11px; opacity: 0.7; }
.file-dl { font-size: 16px; opacity: 0.8; transition: transform 0.2s; }
.file-download:hover .file-dl { transform: translateY(2px); }

/* =========================================================
   REACTIONS
   ========================================================= */
.reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(10, 31, 68, 0.05);
    border: 1px solid rgba(10, 31, 68, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    animation: chipIn 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
@keyframes chipIn {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.reaction-chip:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    transform: scale(1.08);
}
.reaction-chip:active { transform: scale(0.95); }
.reaction-chip.mine {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent);
    color: var(--gold-700);
}
.reaction-chip b { font-weight: 700; font-size: 11px; }
.reaction-emoji { font-size: 14px; }

/* =========================================================
   MESSAGE HOVER ACTIONS
   ========================================================= */
.msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.message:hover .msg-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.emoji-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.emoji-btn:hover {
    transform: scale(1.2) translateY(-2px);
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.25);
}
.emoji-btn:active { transform: scale(0.95); }

/* =========================================================
   TYPING INDICATOR
   ========================================================= */
.typing-indicator {
    padding: 0 24px 4px;
    font-size: 12px;
    color: var(--text-light);
    height: 0;
    overflow: hidden;
    transition: height 0.2s, opacity 0.2s;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.typing-indicator.active { height: 24px; opacity: 1; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: typingBounce 1.4s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-5px); opacity: 1; }
}
.typing-text { font-style: italic; }

/* =========================================================
   MESSAGE INPUT
   ========================================================= */
.message-input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--card);
    flex-shrink: 0;
}
.message-input-container form {
    display: flex;
    gap: 10px;
    align-items: center;
}
#messageInput {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
}
#messageInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.btn-send {
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, var(--gold-300) 0%, var(--accent) 50%, var(--gold-600) 100%);
    color: var(--navy-900);
    border: none;
    border-radius: 50%;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}
.btn-send svg { stroke: var(--navy-900); }
.btn-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}
.btn-send:active { transform: scale(0.92); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =========================================================
   MODAL
   ========================================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 19, 46, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 90vh;
    overflow-y: auto;
    border-top: 3px solid var(--accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
@keyframes modalIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
    color: var(--navy-800);
}
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 19, 46, 0.96);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: lbFade 0.2s ease;
}
.lightbox.active { display: flex; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: lbZoom 0.25s ease;
}
@keyframes lbZoom {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.lightbox-content img {
    max-width: 95vw;
    max-height: 82vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 175, 55, 0.2);
    background: #111;
    object-fit: contain;
}
.lightbox-caption {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #e2e8f0;
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    backdrop-filter: blur(6px);
    max-width: 90vw;
}
#lightboxName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
    font-weight: 500;
}
.lightbox-download {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}
.lightbox-download:hover { background: rgba(212, 175, 55, 0.2); }
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
    z-index: 10;
}
.lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 300;
}
.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 6px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(212, 175, 55, 0.35);
    transform: translateY(-50%) scale(1.1);
}

/* =========================================================
   DRAG & DROP
   ========================================================= */
.drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 68, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeIn 0.2s;
}
.drop-overlay.active { display: flex; }
.drop-content {
    text-align: center;
    color: #fff;
    padding: 48px 56px;
    border: 3px dashed rgba(212, 175, 55, 0.6);
    border-radius: 24px;
    animation: dropPulse 1.5s ease-in-out infinite;
    background: rgba(212, 175, 55, 0.05);
}
@keyframes dropPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.03); }
}
.drop-icon { font-size: 64px; margin-bottom: 16px; }
.drop-content h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--accent);
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
}
.drop-content p { opacity: 0.75; font-size: 14px; }

/* =========================================================
   ADMIN PANEL
   ========================================================= */
.admin-page { background: var(--bg); overflow: auto; }
.admin-container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(10, 31, 68, 0.2);
    flex-wrap: wrap;
    border-bottom: 3px solid var(--accent);
}
.admin-header h1 {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--accent);
}
.admin-header p { font-size: 13px; color: rgba(226, 232, 240, 0.85); }
.admin-header .btn {
    width: auto;
    display: inline-block;
    margin-left: 8px;
    text-decoration: none;
    text-align: center;
}

.admin-table-wrap {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
.admin-table th {
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
}
.admin-table tr { transition: background 0.15s; }
.admin-table tr:hover td { background: rgba(212, 175, 55, 0.05); }

.badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}
.badge-admin { background: #fee2e2; color: #b91c1c; }
.badge-staff { background: rgba(10, 31, 68, 0.1); color: var(--navy-700); }
.badge-guest { background: #dcfce7; color: #15803d; }

.status-pill {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}
.status-online-pill { background: #dcfce7; color: #15803d; }
.status-offline-pill { background: #f1f5f9; color: #64748b; }

.btn-delete {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}
.btn-delete:hover { background: #fecaca; transform: scale(1.05); }
.text-muted { color: #cbd5e1; }

/* =========================================================
   PROFILE PAGE
   ========================================================= */
.profile-page {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-900) 100%);
    overflow-y: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.profile-container { width: 100%; max-width: 520px; }
.profile-card {
    background: var(--card);
    padding: 36px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border-top: 4px solid var(--accent);
}
.back-link {
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 20px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--navy-700); }
.profile-card h1 {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--navy-800);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}
.profile-avatar {
    border-radius: 50%;
    box-shadow: 0 6px 24px rgba(10, 31, 68, 0.2), 0 0 0 4px rgba(212, 175, 55, 0.25);
    border: 4px solid var(--card);
    display: block;
    transition: transform 0.25s ease;
    object-fit: cover;
    background: #e2e8f0;
    width: 140px;
    height: 140px;
}
.avatar-initials.profile-avatar { font-size: 56px; font-weight: 700; }
.profile-avatar-wrap:hover .profile-avatar { transform: scale(1.03); }

.avatar-edit-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
    color: var(--navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    border: 3px solid var(--card);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.45);
}
.avatar-edit-btn:hover {
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.6);
}
.avatar-edit-btn input { display: none; }

.profile-avatar-wrap.uploading .profile-avatar {
    opacity: 0.4;
    pointer-events: none;
}
.profile-avatar-wrap.uploading::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--gold-300);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.profile-avatar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}
.profile-avatar-actions .btn {
    width: auto;
    padding: 10px 20px;
    font-size: 13px;
}
.avatar-hint {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

.profile-info { display: flex; flex-direction: column; gap: 2px; }
.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

/* =========================================================
   LOGO — Login page
   ========================================================= */
.hotel-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}
.logo-crest {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: crestIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.4));
    border-radius: 50%;
}
.logo-fallback {
    width: 76px;
    height: 76px;
    filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.4));
}
.logo-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 50%;
    animation: ringPulse 3s ease-out infinite;
    pointer-events: none;
}
@keyframes ringPulse {
    0%   { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}
@keyframes crestIn {
    from { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* =========================================================
   HOTEL LOGIN PAGE
   ========================================================= */
.hotel-login {
    position: relative;
    background: radial-gradient(ellipse at top, var(--navy-700) 0%, var(--navy-900) 70%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow: hidden;
}
.login-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}
.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
    animation: glowFloat 8s ease-in-out infinite;
}
.glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(212, 175, 55, 0.15);
    top: -100px;
    right: -100px;
}
.glow-2 {
    width: 350px;
    height: 350px;
    background: rgba(27, 65, 133, 0.4);
    bottom: -100px;
    left: -100px;
    animation-delay: 4s;
}
@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, -20px) scale(1.05); }
}
.hotel-login .auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
}
.hotel-card {
    background: linear-gradient(180deg, rgba(15, 42, 92, 0.95), rgba(5, 19, 46, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    padding: 44px 36px 32px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.hotel-card::before,
.hotel-card::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    opacity: 0.4;
    pointer-events: none;
}
.hotel-card::before {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 12px;
}
.hotel-card::after {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 12px;
}
.hotel-title {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--gold-300) 0%, var(--accent) 50%, var(--gold-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(212, 175, 55, 0.3));
}
.hotel-subtitle {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(212, 175, 55, 0.75);
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.title-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}
.divider-line {
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.divider-diamond {
    color: var(--accent);
    font-size: 8px;
    opacity: 0.8;
}
.login-prompt {
    text-align: center;
    color: rgba(226, 232, 240, 0.75);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-weight: 500;
}
.hotel-card .form-group label {
    color: rgba(226, 232, 240, 0.9);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    color: rgba(212, 175, 55, 0.7);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s;
}
.hotel-card .form-group input {
    padding-left: 44px;
    background: rgba(5, 19, 46, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #e2e8f0;
    border-radius: 10px;
    transition: all 0.25s ease;
}
.hotel-card .form-group input::placeholder {
    color: rgba(148, 163, 184, 0.55);
}
.hotel-card .form-group input:focus {
    border-color: var(--accent);
    background: rgba(5, 19, 46, 0.9);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}
.input-wrap:focus-within .input-icon { color: var(--accent); }
.password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.7);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}
.password-toggle:hover {
    color: var(--accent);
    background: rgba(212, 175, 55, 0.1);
}
.hotel-card .btn-gold {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 10px;
    margin-top: 8px;
}
.hotel-card .alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-icon { font-size: 16px; }
.login-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.login-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.7);
    text-align: center;
    letter-spacing: 0.3px;
}
.login-note svg { flex-shrink: 0; opacity: 0.7; }
.hotel-footer {
    text-align: center;
    margin-top: 26px;
    color: rgba(148, 163, 184, 0.5);
    font-size: 11px;
    letter-spacing: 0.5px;
}
.hotel-footer p { margin-bottom: 4px; }
.footer-tag {
    color: rgba(212, 175, 55, 0.55);
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
    font-style: italic;
    letter-spacing: 1px;
    font-size: 11px;
}

/* =========================================================
   SCROLLBARS
   ========================================================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(10, 31, 68, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.4); }

/* =========================================================
   DARK MODE — Deeper navy
   ========================================================= */
body.dark {
    --bg:           #05132e;
    --text:         #e2e8f0;
    --text-light:   #94a3b8;
    --border:       #1e293b;
    --card:         #0a1f44;
    --messages-bg:  #05132e;
}
body.dark .chat-main,
body.dark .chat-header,
body.dark .message-input-container {
    background: var(--card);
    color: #e2e8f0;
}
body.dark .chat-header {
    background: linear-gradient(180deg, #05132e 0%, #0a1f44 100%);
    border-bottom-color: var(--accent);
}
body.dark .messages { background: var(--messages-bg); }
body.dark .msg-bubble {
    background: #14336e;
    color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border-color: rgba(212, 175, 55, 0.1);
}
body.dark .message.own .msg-bubble {
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    color: #fff;
}
body.dark .msg-author { color: var(--accent); }
body.dark #messageInput {
    background: #14336e;
    color: #e2e8f0;
    border-color: rgba(212, 175, 55, 0.2);
}
body.dark #messageInput:focus { border-color: var(--accent); }
body.dark .btn-attach {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
}
body.dark .btn-attach:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--accent);
}
body.dark .btn-attach svg { stroke: var(--accent); }
body.dark .reaction-chip {
    background: rgba(20, 51, 110, 0.6);
    border-color: rgba(212, 175, 55, 0.15);
    color: #e2e8f0;
}
body.dark .reaction-chip.mine {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent);
    color: var(--accent-light);
}
body.dark .emoji-btn {
    background: #14336e;
    border-color: rgba(212, 175, 55, 0.15);
    color: #e2e8f0;
}
body.dark .emoji-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
}
body.dark .msg-attachment.file .file-download {
    background: #14336e;
    color: #e2e8f0;
    border-color: rgba(212, 175, 55, 0.1);
}
body.dark .msg-attachment.file .file-download:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
}
body.dark .modal-content {
    background: #0a1f44;
    color: #e2e8f0;
}
body.dark .modal-content h2 { color: var(--accent); }
body.dark .form-group input,
body.dark .form-group textarea,
body.dark .form-group select {
    background: #05132e;
    color: #e2e8f0;
    border-color: rgba(212, 175, 55, 0.2);
}
body.dark .attach-preview {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    color: #e2e8f0;
}
body.dark .attach-remove:hover { background: #7f1d1d; color: #fecaca; }
body.dark .admin-header {
    background: linear-gradient(135deg, #05132e, #0a1f44);
}
body.dark .admin-table-wrap {
    background: #0a1f44;
    color: #e2e8f0;
    border-color: rgba(212, 175, 55, 0.1);
}
body.dark .admin-table th {
    background: linear-gradient(135deg, #05132e, #0a1f44);
    color: var(--accent);
}
body.dark .admin-table td { border-color: rgba(212, 175, 55, 0.1); }
body.dark .admin-table tr:hover td { background: rgba(212, 175, 55, 0.05); }
body.dark .welcome-message { color: #94a3b8; }
body.dark .welcome-message h2 { color: var(--accent); }
body.dark .profile-page {
    background: linear-gradient(135deg, #05132e 0%, #0a1f44 100%);
}
body.dark .profile-card {
    background: #0a1f44;
    color: #e2e8f0;
}
body.dark .profile-avatar { border-color: #0a1f44; }
body.dark .avatar-edit-btn { border-color: #0a1f44; }
body.dark .profile-info-row { border-color: rgba(212, 175, 55, 0.1); }
body.dark .profile-label { color: #94a3b8; }
body.dark .profile-value { color: #e2e8f0; }
body.dark .profile-card h1 { color: var(--accent); }
body.dark .back-link { color: #94a3b8; }
body.dark .back-link:hover { color: var(--accent); }

/* =========================================================
   MOBILE — Hamburger, backdrop, drawer
   ========================================================= */
.mobile-menu-btn,
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 90;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--navy-800);
        border: 1px solid rgba(212, 175, 55, 0.3);
        color: var(--accent);
        cursor: pointer;
        box-shadow: 0 2px 12px rgba(0,0,0,0.3);
        transition: transform 0.15s, background 0.15s;
    }
    .mobile-menu-btn:active {
        transform: scale(0.94);
        background: var(--navy-700);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 82vw;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 200;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: flex; }
    .sidebar-header { padding-right: 60px; }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(5, 19, 46, 0.7);
        backdrop-filter: blur(4px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s;
    }
    .sidebar-backdrop.active { opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }

    .chat-header {
        padding: 12px 16px 12px 64px;
        min-height: 64px;
        align-items: center;
    }
    .chat-header h2 { font-size: 15px; }
    .chat-sub { font-size: 11px; }

    .online-users { gap: 0; }
    .online-dot {
        width: 28px;
        height: 28px;
        font-size: 11px;
        margin-left: -6px;
    }
    .online-more { font-size: 10px; }

    .messages { padding: 14px 12px 6px; }
    .msg-body { max-width: 84%; }
    .msg-bubble { padding: 9px 12px; font-size: 14px; }
    .msg-avatar { width: 32px; height: 32px; font-size: 13px; }

    .emoji-btn { width: 34px; height: 34px; font-size: 15px; }
    .msg-actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
        gap: 6px;
    }
    .reaction-chip {
        padding: 5px 10px;
        font-size: 14px;
        min-height: 30px;
    }

    .message-input-container {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
        z-index: 20;
    }
    .message-input-container form { gap: 8px; align-items: center; }
    .btn-attach { width: 42px; height: 42px; min-width: 42px; }
    #messageInput {
        padding: 11px 14px;
        font-size: 16px;
        min-width: 0;
    }
    .btn-send { width: 42px; height: 42px; }

    .typing-indicator { padding: 0 14px 2px; }
    .attach-preview { font-size: 12px; padding: 6px 10px; }
    #attachName {
        max-width: 55vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-content { width: 100%; padding: 22px; border-radius: 14px; }
    .modal-content h2 { font-size: 18px; }

    .msg-attachment.image { max-width: 200px; }
    .msg-attachment.image img { max-width: 200px; max-height: 150px; }
    .msg-attachment.file .file-download { min-width: 0; width: 100%; }
    .file-name { max-width: 45vw; }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
    .lightbox-caption {
        font-size: 12px;
        padding: 6px 12px;
        flex-direction: column;
        gap: 6px;
    }
    #lightboxName { max-width: 78vw; }

    .welcome-message { padding: 40px 16px; }
    .welcome-crest { width: 70px; height: 70px; }
    .welcome-message h2 { font-size: 18px; }
    .welcome-tip { font-size: 12px; }

    .sidebar-logo,
    .sidebar-logo-fallback { width: 38px; height: 38px; }
    .sidebar-brand { font-size: 15px; }

    .admin-header { flex-direction: column; align-items: stretch; }
    .admin-header .btn { margin-left: 0; margin-top: 8px; }
    .admin-table-wrap { overflow-x: auto; }
    .admin-table { min-width: 720px; }

    .profile-page { padding: 12px; align-items: flex-start; }
    .profile-card { padding: 24px 20px; border-radius: 16px; }
    .profile-card h1 { font-size: 20px; margin-bottom: 20px; }
    .profile-avatar { width: 110px; height: 110px; }
    .avatar-initials.profile-avatar { font-size: 44px; }
    .avatar-edit-btn { width: 38px; height: 38px; font-size: 16px; }
    .profile-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .profile-value { text-align: left; }

    .hotel-login { padding: 16px 12px; }
    .hotel-card { padding: 32px 22px 24px; border-radius: 16px; }
    .hotel-title { font-size: 24px; letter-spacing: 1px; }
    .hotel-subtitle { font-size: 10px; letter-spacing: 3px; }
    .logo-crest { width: 80px; height: 80px; }
    .logo-img,
    .logo-fallback { width: 64px; height: 64px; }
    .logo-ring { width: 110px; height: 110px; }
    .btn-gold { padding: 13px 20px; font-size: 14px; }
    .hotel-card::before,
    .hotel-card::after { width: 30px; height: 30px; }
}

@media (max-width: 400px) {
    .sidebar { width: 88vw; }
    .chat-header { padding: 10px 12px 10px 60px; }
    .chat-header h2 { font-size: 14px; }
    .online-dot { width: 24px; height: 24px; font-size: 10px; }
    .msg-body { max-width: 88%; }
    .msg-attachment.image { max-width: 170px; }
    .msg-attachment.image img { max-width: 170px; max-height: 130px; }
    .btn-attach,
    .btn-send { width: 40px; height: 40px; min-width: 40px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .sidebar { width: 60vw; }
    .chat-header { padding: 8px 12px 8px 60px; min-height: 52px; }
    .messages { padding: 8px; }
    .message-input-container { padding: 8px 10px; }
}

@media (hover: none) and (pointer: coarse) {
    .msg-actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    .group-item:active { background: var(--sidebar-hover); }
    .reaction-chip:active { transform: scale(0.95); }
}

@supports (padding: env(safe-area-inset-bottom)) {
    .message-input-container {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .login-bg-glow,
    .logo-ring { animation: none; }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
    .sidebar,
    .message-input-container,
    .typing-indicator,
    .msg-actions,
    .reactions-bar,
    .drop-overlay,
    .lightbox,
    .modal,
    .mobile-menu-btn,
    .sidebar-backdrop { display: none !important; }

    .chat-app { display: block; }
    .messages { overflow: visible; background: #fff; }
    .msg-bubble { box-shadow: none; border: 1px solid #ddd; }
}
/* =========================================================
   DIRECT MESSAGES
   ========================================================= */

.dm-item { padding: 10px 20px; }

.dm-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.dm-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(212, 175, 55, 0.25);
    display: block;
}

.dm-avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-500), var(--navy-800));
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.dm-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--navy-800);
    background: #64748b;
    transition: background 0.2s;
}
.dm-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.dm-status-dot.offline { background: #64748b; }

.dm-header {
    background: linear-gradient(180deg, #14336e 0%, #0f2a5c 100%) !important;
}

.dm-modal {
    max-width: 480px !important;
    padding: 26px !important;
}

.dm-search-wrap {
    position: relative;
    margin-bottom: 14px;
}
.dm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.dm-search-wrap input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--card);
    color: var(--text);
}
.dm-search-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.dm-user-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    margin: 0 -6px;
    padding: 0 6px;
}

.dm-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.dm-user-item:hover {
    background: rgba(212, 175, 55, 0.08);
    transform: translateX(3px);
}
.dm-user-item:active { transform: translateX(0) scale(0.99); }

.dm-user-info { flex: 1; min-width: 0; }
.dm-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-user-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.online-text { color: #22c55e; font-weight: 600; }

.dm-loading,
.dm-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 13px;
    font-style: italic;
}

/* Dark mode */
body.dark .dm-avatar-initials {
    background: linear-gradient(135deg, #1b4185, #05132e);
}
body.dark .dm-status-dot { border-color: #0a1f44; }
body.dark .dm-search-wrap input {
    background: #14336e;
    color: #e2e8f0;
    border-color: rgba(212, 175, 55, 0.2);
}
body.dark .dm-user-item:hover { background: rgba(212, 175, 55, 0.12); }
body.dark .dm-user-name { color: #e2e8f0; }

/* Mobile */
@media (max-width: 768px) {
    .dm-avatar-wrap,
    .dm-avatar-img,
    .dm-avatar-initials {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .dm-status-dot { width: 11px; height: 11px; }
    .dm-modal { padding: 20px !important; }
}
/* Admin: Message button */
.btn-dm {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-700);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    margin-right: 6px;
}
.btn-dm:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: scale(1.05);
}
body.dark .btn-dm { color: var(--accent-light); }
/* =========================================================
   ADMIN EDIT USER MODAL
   ========================================================= */

.edit-modal {
    max-width: 560px !important;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(10, 31, 68, 0.08);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.modal-close-x:hover {
    background: #fee2e2;
    color: var(--danger);
    transform: rotate(90deg);
}

/* --- Avatar section inside modal --- */
.edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.edit-avatar-wrap {
    position: relative;
    margin-bottom: 12px;
}

.edit-avatar-preview {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy-500), var(--navy-800));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--card);
    box-shadow: 0 4px 16px rgba(10, 31, 68, 0.2), 0 0 0 4px rgba(212, 175, 55, 0.25);
}
.edit-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.edit-avatar-initials {
    color: var(--accent);
    font-weight: 700;
    font-size: 40px;
    ffont-family: Arial, "Helvetica Neue", Helvetica, sans-serif;, serif;
}

.edit-avatar-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
    color: var(--navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    border: 3px solid var(--card);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}
.edit-avatar-btn:hover {
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.6);
}
.edit-avatar-btn input { display: none; }

.edit-avatar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.btn-small {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-700);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-small:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}
.btn-danger-small {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fecaca;
}
.btn-danger-small:hover {
    background: #fecaca;
}

/* --- Form rows --- */
.form-row { margin-bottom: 14px; }
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

/* --- Password section --- */
.password-section {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 18px;
}

.password-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.password-icon { font-size: 16px; }
.password-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.pw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pw-input-wrap input {
    padding-right: 44px !important;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}
.pw-gen-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold-700);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pw-gen-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: scale(1.08);
}

.pw-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-tiny {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}
.btn-tiny:hover {
    background: var(--border);
    color: var(--text);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    margin-top: 12px;
    user-select: none;
}
.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

/* --- Action buttons in users table --- */
.btn-edit,
.btn-dm {
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    margin-right: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn-edit {
    background: rgba(10, 31, 68, 0.08);
    color: var(--navy-700);
    border-color: rgba(10, 31, 68, 0.15);
}
.btn-edit:hover {
    background: rgba(10, 31, 68, 0.15);
    transform: scale(1.05);
}
.btn-dm {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-700);
    border-color: rgba(212, 175, 55, 0.3);
}
.btn-dm:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: scale(1.05);
}

/* --- Dark mode for edit modal --- */
body.dark .edit-avatar-preview {
    border-color: #0a1f44;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(212, 175, 55, 0.25);
}
body.dark .edit-avatar-btn { border-color: #0a1f44; }
body.dark .password-section {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.25);
}
body.dark .modal-close-x {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
}
body.dark .btn-edit {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
    border-color: rgba(212, 175, 55, 0.25);
}
body.dark .btn-edit:hover { background: rgba(212, 175, 55, 0.2); }
body.dark .btn-tiny {
    color: #94a3b8;
    border-color: #334155;
}
body.dark .btn-tiny:hover {
    background: #334155;
    color: #e2e8f0;
}
body.dark .checkbox-row { color: #e2e8f0; }
body.dark .btn-small { color: var(--accent-light); }

/* --- Mobile --- */
@media (max-width: 600px) {
    .edit-modal { padding: 20px !important; }
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .edit-avatar-preview {
        width: 90px;
        height: 90px;
    }
    .edit-avatar-initials { font-size: 32px; }
    .edit-avatar-btn { width: 34px; height: 34px; font-size: 14px; }
    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5),
    .admin-table th:nth-child(7),
    .admin-table td:nth-child(7) { display: none; } /* Hide Role + Created on mobile */
}
/* =========================================================
   ICON BUTTONS — SVG-based, always visible on all devices
   ========================================================= */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.icon-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent);
    transform: translateY(-1px);
}

.icon-btn:hover svg {
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.94);
}

/* ===== RED logout button ===== */
.icon-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.icon-btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}

.icon-btn-danger:active {
    background: #dc2626;
    transform: scale(0.94);
}

/* Theme toggle rotates on hover */
.theme-toggle:hover svg {
    transform: rotate(20deg) scale(1.1);
}

/* ===== Red general button (used elsewhere) ===== */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
.btn-danger:active { transform: translateY(0); }

/* ===== Sidebar close button (SVG version) ===== */
.sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.sidebar-close svg {
    display: block;
    pointer-events: none;
}
.sidebar-close:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: rotate(90deg);
}

/* ===== Admin header action buttons ===== */
.admin-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.admin-header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

/* ===== btn-icon (small round, for section headers) ===== */
.btn-icon {
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.7);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.btn-icon svg {
    display: block;
    pointer-events: none;
    transition: transform 0.2s;
}
.btn-icon:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    transform: rotate(90deg);
}
.btn-icon:hover svg {
    transform: scale(1.15);
}

/* ===== btn-edit / btn-dm / btn-delete (SVG versions) ===== */
.btn-edit,
.btn-dm,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    margin-right: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1;
}
.btn-edit {
    background: rgba(10, 31, 68, 0.08);
    color: var(--navy-700);
    border-color: rgba(10, 31, 68, 0.15);
}
.btn-edit:hover {
    background: rgba(10, 31, 68, 0.15);
    transform: translateY(-1px);
}
.btn-dm {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-700);
    border-color: rgba(212, 175, 55, 0.3);
}
.btn-dm:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}
.btn-delete {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fecaca;
}
.btn-delete:hover {
    background: #fecaca;
    transform: translateY(-1px);
}
.btn-delete svg { stroke: currentColor; }

/* =========================================================
   MOBILE — Larger tap targets, red logout emphasized
   ========================================================= */
@media (max-width: 768px) {

    .user-panel {
        padding: 14px 16px;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .user-panel::-webkit-scrollbar { display: none; }

    .icon-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 10px;
    }

    .icon-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Red logout gets extra emphasis on mobile */
    .icon-btn-danger {
        background: rgba(239, 68, 68, 0.25);
        border: 1.5px solid #ef4444;
        color: #ff5555;
        animation: logoutPulse 2.5s ease-in-out infinite;
    }

    .icon-btn-danger svg {
        stroke-width: 2.5;
    }

    @keyframes logoutPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
        50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    }

    /* Admin header actions wrap on mobile */
    .admin-header-actions {
        width: 100%;
        justify-content: stretch;
    }
    .admin-header-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 10px;
        font-size: 12px;
    }

    /* Bigger action buttons in tables on mobile */
    .btn-edit,
    .btn-dm,
    .btn-delete {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Sidebar close button bigger on mobile */
    .sidebar-close {
        width: 42px;
        height: 42px;
        top: 12px;
        right: 12px;
    }
    .sidebar-close svg {
        width: 20px;
        height: 20px;
    }
}

/* Small phones — compact */
@media (max-width: 380px) {
    .icon-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
    .icon-btn svg {
        width: 18px;
        height: 18px;
    }
    .theme-toggle {
        display: none;
    }
}

/* =========================================================
   DARK MODE for icon buttons
   ========================================================= */
body.dark .icon-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
body.dark .icon-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    color: var(--accent);
}
body.dark .icon-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ff5555;
}
body.dark .icon-btn-danger:hover {
    background: #ef4444;
    color: #fff;
}
body.dark .sidebar-close {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
}
body.dark .btn-edit {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
    border-color: rgba(212, 175, 55, 0.25);
}
body.dark .btn-edit:hover {
    background: rgba(212, 175, 55, 0.2);
}
body.dark .btn-dm {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
}
body.dark .btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}
body.dark .btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}
/* =========================================================
   GROUP MEMBERS + INVITES
   ========================================================= */

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
}
.header-icon-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    transform: translateY(-1px);
}

/* ----- Invite badge ----- */
.invite-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ----- Invites banner ----- */
.invites-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 24px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    animation: bannerIn 0.4s ease;
}
@keyframes bannerIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.invites-banner-icon { font-size: 22px; }
.invites-banner-text { flex: 1; min-width: 0; }
.invites-banner-text strong {
    display: block;
    font-size: 14px;
    color: var(--navy-800);
    font-weight: 700;
}
.invites-banner-text span {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.invites-banner-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.invites-banner-close:hover {
    background: rgba(0,0,0,0.06);
    color: var(--danger);
}

/* ----- Members modal ----- */
.members-modal {
    max-width: 520px !important;
    position: relative;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.members-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(10, 31, 68, 0.06);
    border-radius: 10px;
    padding: 4px;
}
.members-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light