:root {
    --primary-color: #008069;
    --primary-hover: #006b57;
    --secondary-color: #128C7E;
    --danger-color: #d9534f;
    --bg-color: #d1d7db;
    --app-bg: #efeae2;
    --text-main: #1f2937;
    --text-muted: #6b7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body { background-color: var(--bg-color); display: flex; justify-content: center; height: 100vh; overflow: hidden; direction: rtl; }

/* מעטפת האפליקציה המרכזית */
.app-wrapper { width: 100%; max-width: 480px; height: 100vh; background-color: var(--app-bg); display: flex; flex-direction: column; position: relative; box-shadow: 0 0 25px rgba(0,0,0,0.15); overflow: hidden; }

/* === סגנונות מסך התחברות === */
.login-container { display: flex; justify-content: center; align-items: center; height: 100%; background: var(--app-bg); position: absolute; top:0; left:0; right:0; bottom:0; z-index: 100; }
.login-box { background: white; padding: 35px 25px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); text-align: center; width: 85%; max-width: 340px; }
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); margin-bottom: 20px; }
.login-box h2 { color: var(--text-main); margin-top: 0; font-size: 20px; font-weight: 600;}
.desc { color: var(--text-muted); font-size: 14px; margin-bottom: 25px; min-height: 20px; }
input { padding: 14px; margin: 10px 0; width: 100%; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 16px; text-align: center; outline: none; transition: 0.2s; background: #f9fafb; }
input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,128,105,0.1); background: #fff;}
.login-btn { background-color: var(--primary-color); color: white; padding: 14px; border: none; border-radius: 10px; width: 100%; font-size: 16px; cursor: pointer; margin-top: 15px; font-weight: bold; transition: background 0.2s; box-shadow: 0 2px 5px rgba(0,128,105,0.3); }
.login-btn:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary-color); color: white; padding: 12px; border: none; border-radius: 10px; width: 100%; font-size: 15px; cursor: pointer; font-weight: bold; }
.btn-link { background: transparent; color: var(--text-muted); border: none; font-size: 14px; cursor: pointer; margin-top: 15px; text-decoration: underline; }
.auth-options { display: flex; flex-direction: column; gap: 10px; }
.divider { display: flex; align-items: center; color: var(--text-muted); margin: 10px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #e0e0e0; }
.divider span { padding: 0 10px; font-size: 0.9rem; }

/* === סגנונות מסך הראשי וההודעות === */
.app-screen { flex-direction: column; height: 100%; display: flex; }
.app-header { background-color: var(--primary-color); color: white; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.15);}
.header-main { display: flex; align-items: center; gap: 12px; flex: 1; }
.avatar-group { width: 44px; height: 44px; background: #dfe5e7; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.2);}
.header-info { display: flex; flex-direction: column; line-height: 1.3; }
.header-info h2 { margin: 0; font-size: 17px; font-weight: 600; text-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.sub-status { font-size: 12px; color: #e0f2f1; display: flex; align-items: center; gap: 4px; }
.header-actions { display: flex; gap: 8px; }
.header-btn { background: transparent; color: white; border: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; outline: none; }
.header-btn:hover { background: rgba(255,255,255,0.15); }
.header-btn svg { width: 22px; height: 22px; fill: white; }

.chat-container { flex: 1; overflow-y: auto; padding: 20px 15px 30px; display: flex; flex-direction: column; background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); background-size: cover; background-attachment: local; }
.message-bubble { position: relative; padding: 10px 12px 8px; border-radius: 12px; max-width: 82%; width: 270px; box-shadow: 0 1px 2px rgba(0,0,0,0.15); display: flex; flex-direction: column; margin-bottom: 10px; }
.message-bubble.other { background: #ffffff; align-self: flex-start; border-top-right-radius: 4px; }
.message-bubble.self { background: #dcf8c6; align-self: flex-end; border-top-left-radius: 4px; }
.sender-name { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; color: #444; }
.message-bubble.self .sender-name { color: var(--primary-color); }
.audio-ui { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; cursor: pointer; display: flex; justify-content: center; align-items: center; padding: 0; outline: none;}
.play-btn svg { width: 34px; height: 34px; fill: #8696a0; transition: fill 0.2s;}
.play-btn:active svg { fill: var(--primary-color); }
.progress-container { flex: 1; display: flex; flex-direction: column; justify-content: center;}
.progress-bar { -webkit-appearance: none; width: 100%; height: 5px; background: rgba(0,0,0,0.1); border-radius: 3px; outline: none; margin: 0; cursor: pointer;}
.progress-bar::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #00a884; cursor: pointer; transition: transform 0.1s;}
.message-bubble.self .progress-bar::-webkit-slider-thumb { background: var(--primary-color); }
.audio-time { font-size: 11.5px; color: #7a8a94; display: flex; justify-content: space-between; margin-top: 6px;}
.bubble-meta { font-size: 11px; color: #7a8a94; text-align: left; margin-top: 2px;}
#system-msg { align-self: center; background: rgba(255,255,255,0.95); padding: 10px 20px; border-radius: 20px; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin: 20px 0; }

/* === סגנונות מסך ניהול === */
.admin-container { background: white; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; display: flex; flex-direction: column; }
.admin-header { background: var(--text-main); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.admin-header h2 { margin: 0; font-size: 18px; }
.tabs { display: flex; border-bottom: 1px solid #e0e0e0; background: #f9fafb; }
.tab-link { flex: 1; padding: 15px 0; text-align: center; border: none; background: none; font-size: 14px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tab-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: bold; }
.tab-content { display: none; padding: 20px; overflow-y: auto; flex: 1; }
.tab-content.active { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: right; }
th, td { padding: 10px; border-bottom: 1px solid #e0e0e0; }
th { color: var(--text-muted); font-weight: normal; }
.block-form { display: flex; flex-direction: column; gap: 10px; }
.block-form select { padding: 12px; border: 1px solid #e0e0e0; border-radius: 10px; }