/* ============================================
   CPR Management System - Modern Stylesheet
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff416c;
    --primary-dark: #ff4b2b;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header i {
    font-size: 50px;
    margin-bottom: 15px;
}

.login-header h1 {
    margin: 10px 0 5px 0;
    font-size: 26px;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.login-form {
    padding: 30px;
}

.login-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.login-footer code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    padding-bottom: 90px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 40px;
    color: var(--primary);
}

.sidebar-header h2 {
    margin: 10px 0 0 0;
    font-size: 20px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a i {
    width: 25px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 25px;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-left: 4px solid white;
}

.nav-section {
    padding: 15px 20px 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, #2c3e50 0%, #2f4359 100%);
    z-index: 0;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: rgba(220, 53, 69, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
}

.logout-btn i {
    margin-right: 8px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1200;
}

.topbar-left h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

.user-info {
    display: flex;
    align-items: center;
    color: #666;
}

.user-info i {
    font-size: 24px;
    margin-right: 10px;
    color: var(--primary);
}

.content-wrapper {
    padding: 30px;
}

/* User dropdown menu */
.user-menu { position: relative; }
.user-menu-toggle {
    background: transparent;
    border: 1px solid #eee;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #555;
}
.user-menu-toggle i.fa-user-circle { color: var(--primary); font-size: 20px; margin-right: 8px; }
.user-dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    min-width: 240px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    display: none;
    overflow: hidden;
    z-index: 1500;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.user-dropdown-header .user-role { font-weight: 700; color: #333; }
.user-dropdown-header .user-username { font-size: 12px; color: #999; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: #333 !important;
    text-decoration: none !important;
}
.user-dropdown-item:hover { background: #f8f9fa; }

.sidebar-nav { position: relative; z-index: 1; }

/* ============================================
   CARDS & STATS
   ============================================ */

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--dark);
}

.card-header h3 i {
    margin-right: 8px;
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 28px;
    color: white;
}

.stat-primary .stat-icon { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.stat-success .stat-icon { background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%); }
.stat-info .stat-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-danger .stat-icon { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
.stat-secondary .stat-icon { background: linear-gradient(135deg, #485563 0%, #29323c 100%); }

.stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 32px;
    font-weight: 700;
}

.stat-content p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

/* ============================================
   TABLES
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 10px;
    font-size: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-info {
    background: var(--info);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--dark);
}

.page-header h2 i {
    margin-right: 10px;
    color: var(--primary);
}

/* ============================================
   DASHBOARD SPECIFIC
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.3s;
}

.quick-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.quick-action-btn i {
    font-size: 32px;
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item strong {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.info-item span {
    color: var(--dark);
    font-size: 15px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-muted {
    color: #777;
}

code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

