/* ============================================
PEFR MONITOR - COMPLETE CSS STYLES
Malaysian CPG 2024 Compliant
Mediklinik Mikhail
============================================ */

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

body {
font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}

.container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 1200px;
width: 100%;
margin: 0 auto;
padding: 40px;
}

.header {
text-align: center;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 3px solid #f0f0f0;
}

.header h1 {
color: #2c3e50;
font-size: 32px;
margin-bottom: 10px;
}

.header .subtitle {
color: #7f8c8d;
font-size: 16px;
margin-bottom: 5px;
}

.clinic-name {
color: #667eea;
font-weight: 600;
font-size: 18px;
}

/* CPG 2024 Compliance Badge */
.cpg-badge {
display: inline-block;
background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
color: white;
padding: 5px 15px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
margin-top: 10px;
}

/* Critical 2024 CPG Warning Banner */
.cpg-2024-banner {
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
color: white;
padding: 20px;
border-radius: 15px;
margin-bottom: 25px;
border-left: 5px solid #a93226;
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.cpg-2024-banner h3 {
font-size: 18px;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
}

.cpg-2024-banner p {
font-size: 14px;
line-height: 1.6;
opacity: 0.95;
}

/* Print Styles */
@media print {
body {
background: white;
padding: 0;
}

```
.container {
    box-shadow: none;
    padding: 20px;
    max-width: 100%;
}

.tabs, .action-buttons, button, .user-info button {
    display: none !important;
}

.tab-content {
    display: block !important;
}

.chart-wrapper {
    page-break-inside: avoid;
}

.no-print {
    display: none !important;
}

.cpg-2024-banner {
    display: none !important;
}
```

}

/* Login Screen */
.login-screen {
max-width: 500px;
margin: 0 auto;
}

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

label {
display: block;
color: #2c3e50;
font-weight: 600;
margin-bottom: 8px;
font-size: 14px;
}

input[type=“text”],
input[type=“number”],
input[type=“date”],
input[type=“time”],
select,
textarea {
width: 100%;
padding: 12px 15px;
border: 2px solid #e0e0e0;
border-radius: 10px;
font-size: 16px;
transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
outline: none;
border-color: #667eea;
}

.radio-group {
display: flex;
gap: 20px;
flex-wrap: wrap;
}

.radio-option {
display: flex;
align-items: center;
cursor: pointer;
}

.radio-option input[type=“radio”] {
margin-right: 8px;
width: 20px;
height: 20px;
cursor: pointer;
}

.btn {
padding: 12px 30px;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
}

.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
width: 100%;
}

.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
background: #e0e0e0;
color: #2c3e50;
}

.btn-secondary:hover {
background: #d0d0d0;
}

.btn-success {
background: #27ae60;
color: white;
}

.btn-danger {
background: #e74c3c;
color: white;
}

.btn-small {
padding: 8px 16px;
font-size: 14px;
}

/* Dashboard */
.hidden {
display: none !important;
}

.user-info {
background: #f8f9fa;
padding: 15px 20px;
border-radius: 10px;
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}

.user-details {
font-size: 14px;
color: #2c3e50;
}

.user-details strong {
color: #667eea;
}

/* Medication Status Indicator */
.medication-status {
display: inline-block;
padding: 6px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
margin-left: 10px;
}

.medication-status.compliant {
background: #d4edda;
color: #155724;
}

.medication-status.warning {
background: #fff3cd;
color: #856404;
}

.medication-status.danger {
background: #f8d7da;
color: #721c24;
}

.tabs {
display: flex;
gap: 10px;
margin-bottom: 20px;
flex-wrap: wrap;
border-bottom: 2px solid #e0e0e0;
}

.tab {
padding: 12px 24px;
background: transparent;
border: none;
border-bottom: 3px solid transparent;
color: #7f8c8d;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
}

.tab:hover {
color: #667eea;
}

.tab.active {
color: #667eea;
border-bottom-color: #667eea;
}

.tab-content {
display: none;
}

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

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

/* Cards */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}

.stat-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.green {
background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.stat-card.yellow {
background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.stat-card.red {
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.stat-label {
font-size: 14px;
opacity: 0.9;
margin-bottom: 5px;
}

.stat-value {
font-size: 32px;
font-weight: 700;
}

.stat-unit {
font-size: 16px;
font-weight: 400;
}

/* Charts */
.chart-container {
background: #f8f9fa;
padding: 20px;
border-radius: 15px;
margin-bottom: 20px;
}

.chart-title {
font-size: 18px;
font-weight: 600;
color: #2c3e50;
margin-bottom: 15px;
}

.chart-wrapper {
position: relative;
height: 300px;
}

/* Table */
.table-container {
overflow-x: auto;
margin-bottom: 20px;
}

table {
width: 100%;
border-collapse: collapse;
background: white;
border-radius: 10px;
overflow: hidden;
}

thead {
background: #667eea;
color: white;
}

th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}

th {
font-weight: 600;
font-size: 14px;
}

td {
font-size: 14px;
color: #2c3e50;
}

tbody tr:hover {
background: #f8f9fa;
}

.zone-badge {
display: inline-block;
padding: 4px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
}

.zone-green {
background: #d4edda;
color: #155724;
}

.zone-yellow {
background: #fff3cd;
color: #856404;
}

.zone-red {
background: #f8d7da;
color: #721c24;
}

/* Forms */
.form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}

.checkbox-group {
margin-top: 10px;
}

.checkbox-item {
display: flex;
align-items: center;
margin-bottom: 8px;
}

.checkbox-item input[type=“checkbox”] {
margin-right: 8px;
width: 18px;
height: 18px;
}

.checkbox-item label {
margin: 0;
font-weight: 400;
}

/* Alerts */
.alert {
padding: 15px 20px;
border-radius: 10px;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}

.alert-success {
background: #d4edda;
color: #155724;
border-left: 4px solid #28a745;
}

.alert-danger {
background: #f8d7da;
color: #721c24;
border-left: 4px solid #dc3545;
}

.alert-warning {
background: #fff3cd;
color: #856404;
border-left: 4px solid #ffc107;
}

.alert-info {
background: #d1ecf1;
color: #0c5460;
border-left: 4px solid #17a2b8;
}

/* Action buttons */
.action-buttons {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 20px;
}

/* Export Preview */
.export-summary {
background: white;
padding: 20px;
border-radius: 10px;
margin-bottom: 20px;
}

.summary-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
}

.summary-row:last-child {
border-bottom: none;
}

.summary-label {
font-weight: 600;
color: #2c3e50;
}

.summary-value {
color: #667eea;
font-weight: 600;
}

/* Adherence Tracker */
.adherence-week {
display: flex;
gap: 8px;
margin-top: 10px;
}

.adherence-day {
flex: 1;
padding: 15px 8px;
border: 2px solid #e0e0e0;
border-radius: 8px;
text-align: center;
cursor: pointer;
transition: all 0.3s;
}

.adherence-day.taken {
background: #d4edda;
border-color: #27ae60;
}

.adherence-day.missed {
background: #f8d7da;
border-color: #e74c3c;
}

.adherence-day:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.adherence-day-label {
font-size: 12px;
font-weight: 600;
color: #2c3e50;
margin-bottom: 5px;
}

.adherence-day-status {
font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
.container {
padding: 20px;
}

```
.header h1 {
    font-size: 24px;
}

.stats-grid {
    grid-template-columns: 1fr;
}

.form-grid {
    grid-template-columns: 1fr;
}

.tabs {
    overflow-x: auto;
}

.tab {
    white-space: nowrap;
}

.chart-wrapper {
    height: 250px;
}
```

}

.info-text {
color: #7f8c8d;
font-size: 14px;
margin-top: 5px;
}

.section-title {
font-size: 20px;
font-weight: 600;
color: #2c3e50;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid #e0e0e0;
}

.empty-state {
text-align: center;
padding: 40px;
color: #7f8c8d;
}

.empty-state-icon {
font-size: 48px;
margin-bottom: 15px;
}

/* Loading spinner */
.spinner {
border: 3px solid #f3f3f3;
border-top: 3px solid #667eea;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
display: inline-block;
margin-right: 10px;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}