:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --primary-light: #E3F7E9;
    --secondary: #2D3436;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #D63031;
    --info: #34B7F1;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #6C757D;
    --gray-700: #495057;
    --gray-900: #212529;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.logo { margin-bottom: 12px; }
.logo-icon { font-size: 48px; margin-bottom: 8px; }
.logo h1 { font-size: 24px; font-weight: 700; color: var(--secondary); }
.subtitle { color: var(--gray-500); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 15px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

.error-message { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 20px; }

.app-container { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    background: white; border-bottom: 1px solid var(--gray-200); padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.app-header .logo { display: flex; align-items: center; gap: 8px; margin: 0; }
.app-header .logo-icon { font-size: 28px; margin: 0; }
.app-header h1 { font-size: 18px; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray-500); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 600; }

.app-nav {
    background: white; border-top: 1px solid var(--gray-200); padding: 8px 0;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: space-around;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 12px; color: var(--gray-500); text-decoration: none; font-size: 11px; font-weight: 500; cursor: pointer; border: none; background: none; }
.nav-item.active { color: var(--primary-dark); }
.nav-item .icon { font-size: 22px; }

.app-content { flex: 1; padding: 16px; padding-bottom: 90px; overflow-y: auto; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--secondary); }

.card { background: white; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--gray-700); }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-align: center; }
.stat-card .number { font-size: 28px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.list-item { background: white; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.1s; }
.list-item:active { transform: scale(0.98); }
.list-item-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.list-item-info p { font-size: 12px; color: var(--gray-500); }

.chat-list-item { display: flex; gap: 12px; align-items: center; }
.chat-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; }
.chat-meta { text-align: right; font-size: 11px; color: var(--gray-500); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--primary-light); color: var(--primary-dark); }
.badge-warning { background: #FFF3CD; color: #856404; }
.badge-danger { background: #F8D7DA; color: var(--danger); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.loading { text-align: center; padding: 40px; color: var(--gray-500); }

.status-grid { display: grid; gap: 12px; }
.status-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-200); }
.status-item:last-child { border-bottom: none; }
.status-label { font-size: 14px; color: var(--gray-700); }
.status-value { font-weight: 600; font-size: 14px; }
.status-good { color: var(--success); }
.status-bad { color: var(--danger); }

.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.modal-content { background: white; border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--gray-500); cursor: pointer; }

.hidden { display: none !important; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
