:root {
   --primary-color:#00c9a2 ;
    --primary-dark: #1098e9;
    --primary-light: #e8f5f2;
    --secondary-color: #50aaff;

    --accent-color: #ff6b9d;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

@font-face {
    font-family: 'Peyda100';
    src: url('../fonts/PeydaWebFaNum-Thin.4dc9791976a333b36501.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda200';
    src: url('../fonts/PeydaWebFaNum-ExtraLight.cb12d7d5e9d6131c285f.woff') format('woff');
    font-weight: 200;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda300';
    src: url('../fonts/PeydaWebFaNum-Light.e5c4aa2be8084a7fd345.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda400';
    src: url('../fonts/PeydaWebFaNum-Regular.a85fc388413d6fb2707b.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda500';
    src: url('../fonts/PeydaWebFaNum-Medium.5ae94427bffc3c292a70.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda600';
    src: url('../fonts/PeydaWebFaNum-SemiBold.bee880ae22ea6f0f046e.woff') format('woff');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda700';
    src: url('../fonts/PeydaWebFaNum-Bold.2106f9398d9799d35d55.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda800';
    src: url('../fonts/PeydaWebFaNum-ExtraBold.5d0e4f0b138c23493636.woff') format('woff');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'Peyda900';
    src: url('../fonts/PeydaWebFaNum-Black.ce8ffc88f1303a4ed135.woff') format('woff');
    font-weight: 900;
    font-style: normal;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Peyda400', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2 {
    font-family: 'Peyda900', sans-serif !important;
    font-weight: 900 !important;
}

h3, h4 {
    font-family: 'Peyda700', sans-serif !important;
    font-weight: 700 !important;
}

p {
    font-family: 'Peyda300', sans-serif !important;
    font-weight: 300 !important;
}

strong, b {
    font-family: 'Peyda800', sans-serif !important;
    font-weight: 800 !important;
}

em {
    font-family: 'Peyda200', sans-serif !important;
    font-weight: 200 !important;
}

a {
    font-family: 'Peyda500', sans-serif !important;
    font-weight: 500 !important;
}

small, .caption {
    font-family: 'Peyda100', sans-serif !important;
    font-weight: 100 !important;
}

button, input, textarea, select {
    font-family: 'Peyda600', sans-serif !important;
    font-weight: 600 !important;
}
/* Login & Register Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
  
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 36px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-upload-input {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
    font-size: 14px;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-label i {
    font-size: 18px;
}

.file-preview {
    margin-top: 10px;
    text-align: center;
}

.file-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.file-preview-name {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 106, 95, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dashboard */
.dashboard-wrapper {
    min-height: 100vh;
    padding-bottom: 70px;
    background: var(--bg-light);
}

.dashboard-header {
    background: var(--white);
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
    font-weight: bold;
}

.user-details h3 {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: normal;
}

.user-details p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
    font-size: 16px;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn.has-badge {
    position: relative;
}

.icon-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger-color);
    color: var(--white);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: var(--white);
    padding: 5px;
    margin: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    margin: 0 20px 20px;
    border-radius: 20px;
    padding: 25px 20px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.hero-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
}

/* Department Selector */
.department-selector {
    padding: 0 20px 20px;
}

.department-selector-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.department-card {
    background: var(--white);
    padding: 20px 15px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.department-card:active {
    transform: scale(0.95);
}

.department-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.department-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--primary-color);
    font-size: 24px;
}

.department-card.selected .department-icon {
    background: var(--primary-color);
    color: var(--white);
}

.department-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Calendar Section */
.calendar-section {
    padding: 0 20px 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 35px;
    height: 35px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: var(--white);
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.calendar-day-name {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.calendar-day-number {
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-day.today {
    background: var(--primary-color);
    color: var(--white);
}

.calendar-day.today .calendar-day-name,
.calendar-day.today .calendar-day-number {
    color: var(--white);
}

.calendar-day.selected {
    background: var(--primary-light);
    border: 2px solid var(--primary-color);
}

.calendar-day.has-shift {
    position: relative;
}

.calendar-day.has-shift::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
}

/* Shifts Section */
.shifts-section {
    padding: 0 20px 20px;
}

.shifts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shifts-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.selected-date {
    font-size: 13px;
    color: var(--text-light);
}

.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-card {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.shift-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.shift-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
}

.shift-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.shift-residents {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resident-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 10px;
}

.resident-item.unregistered {
    background: #fff3cd;
}

.resident-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.resident-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
}

.resident-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #c44569 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
    font-weight: bold;
}

.resident-details {
    flex: 1;
}

.resident-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.resident-level {
    font-size: 12px;
    color: var(--text-muted);
}

.call-btn {
    width: 40px;
    height: 40px;
    background: var(--success-color);
    border: none;
    border-radius: 50%;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.call-btn:active {
    transform: scale(0.95);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-text {
    font-size: 15px;
    color: var(--text-light);
}

/* Profile Tab */
.profile-section {
    padding: 20px;
    padding-bottom: 100px;
}

.profile-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 40px;
    margin: 0 auto 15px;
    border: 4px solid var(--primary-light);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.profile-role {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.profile-status.pending {
    background: #fff3cd;
    color: #856404;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-menu-item {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
}

.profile-menu-item:active {
    transform: scale(0.98);
}

.profile-menu-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-menu-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
}

.profile-menu-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}

.profile-menu-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-menu-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

/* Tools Tab */
.tools-section {
    padding: 20px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tool-card {
    background: var(--white);
    padding: 25px 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
}

.tool-card:active {
    transform: scale(0.95);
}

.tool-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--primary-color);
    font-size: 28px;
}

.tool-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 10px 20px 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px 10px;
    border-radius: 10px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 380px) {
    .department-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .calendar-day {font-size: 11px;
}
.calendar-day-name {
    font-size: 9px;
}
}
/* Utilities */
.text-center {
text-align: center;
}
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden {
display: none !important;
}

/* Messages Section */
.messages-section {
    padding: 20px;
    padding-bottom: 100px;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.messages-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-item {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
}

.chat-item:active {
    transform: scale(0.98);
}

.chat-item.unread {
    background: var(--primary-light);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.chat-avatar-group {
    background: linear-gradient(135deg, var(--accent-color) 0%, #c44569 100%);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-last-message {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-unread-badge {
    background: var(--primary-color);
    color: var(--white);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* New Chat Modal */
.modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.user-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.user-type-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.user-type-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.user-type-btn i {
    font-size: 32px;
    color: var(--primary-color);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 15px;
}

.departments-list,
.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.department-select-item,
.user-select-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.department-select-item:hover,
.user-select-item:hover {
    background: var(--primary-light);
}

.department-select-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.department-select-name,
.user-select-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.user-select-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.user-select-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.user-select-info {
    flex: 1;
}

.user-select-level {
    font-size: 12px;
    color: var(--text-muted);
}
/* Message Input Auto-resize */
.chat-input {
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.5;
}

/* Scrollbar Styling */
.messages-container::-webkit-scrollbar,
.departments-list::-webkit-scrollbar,
.users-list::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.departments-list::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb,
.departments-list::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.departments-list::-webkit-scrollbar-thumb:hover,
.users-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Message Selection */
.message-bubble {
    user-select: text;
    -webkit-user-select: text;
}

/* Loading State for Messages */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.message-loading {
    background: linear-gradient(90deg, var(--bg-light) 0%, var(--white) 50%, var(--bg-light) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 12px;
    height: 60px;
    margin-bottom: 10px;
}

/* Image/Video Preview in Messages */
.message-media img,
.message-media video {
    max-height: 300px;
    cursor: pointer;
}

/* Active Voice Button */
.chat-action-btn.recording {
    background: var(--danger-color);
    color: var(--white);
}

/* Online Status */
.chat-header-status.online {
    color: var(--success-color);
}

.chat-header-status.online::before {
    content: '●';
    margin-left: 5px;
}

/* Group Members Count */
.chat-header-status.group::after {
    content: ' عضو';
    font-size: 11px;
}

/* Message Reactions (optional future feature) */
.message-reactions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.message-reaction {
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Reply Preview (optional future feature) */
.reply-preview {
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    border-right: 3px solid var(--primary-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* Mention Highlight */
.message-text .mention {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}

/* Link Preview */
.message-link-preview {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    border-right: 3px solid var(--primary-color);
}

.message-link-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.message-link-description {
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .message {
        max-width: 85%;
    }
    
    .chat-input-actions {
        gap: 5px;
    }
    
    .chat-action-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}