/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

/* Container styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 20px;
    color: #333;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
    border-radius: 3px;
}

nav a.active {
    background-color: #28a745;
    color: #fff;
}

/* Main content styles */
main {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.stat-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 24px;
    color: #28a745;
    font-weight: bold;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Button styles */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.button:hover {
    background: #218838;
}

.button.cancel {
    background-color: #6c757d;
}

.button.cancel:hover {
    background-color: #545b62;
}

/* Table styles */
.patients-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.patients-table th,
.patients-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.patients-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 5px;
}

/* Flash message styles */
.flash-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
}

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

.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a {
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #28a745;
}

.pagination a.active {
    background-color: #28a745;
    color: #fff;
}

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* QR code styles */
#qrCode {
    text-align: center;
    margin: 20px 0;
}

/* QR Code styles */
.qr-container {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qr-container img {
    max-width: 300px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

.qr-info {
    text-align: left;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.qr-info p {
    margin: 8px 0;
    color: #333;
}

.qr-info strong {
    color: #2c3e50;
}

.qr-info a {
    word-break: break-all;
    white-space: pre-wrap;
    display: inline-block;
    max-width: 100%;
}

.qr-note {
    margin-top: 15px;
    padding: 10px;
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    color: #2980b9;
}

/* Responsive styles */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .patients-table {
        display: block;
        overflow-x: auto;
    }

    nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* Error Messages */
.error {
    background: #ff6b6b;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* Links */
.back-link {
    text-align: center;
    margin-top: 15px;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Login Options */
.login-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.login-option {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    max-width: 300px;
}

.login-option h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-option p {
    color: #666;
    margin-bottom: 15px;
}

/* Tier and Reward styles */
.tiers-section,
.rewards-section {
    margin-bottom: 30px;
}

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

.tiers-table,
.rewards-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tiers-table th,
.tiers-table td,
.rewards-table th,
.rewards-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tiers-table th,
.rewards-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.edit-tier,
.edit-reward,
.delete-tier,
.delete-reward {
    padding: 6px 12px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.edit-tier,
.edit-reward {
    background-color: #28a745;
    color: white;
}

.delete-tier,
.delete-reward {
    background-color: #dc3545;
    color: white;
}

.edit-tier:hover,
.edit-reward:hover {
    background-color: #218838;
}

.delete-tier:hover,
.delete-reward:hover {
    background-color: #c82333;
}

/* Points and Tier display styles */
.points-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.points-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.points-card h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 16px;
}

.points-card .points {
    font-size: 32px;
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
}

.points-card .tier {
    font-size: 24px;
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
}

/* Rewards grid styles */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.reward-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.reward-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.reward-card .description {
    color: #666;
    margin-bottom: 15px;
    min-height: 60px;
}

.reward-card .points-cost {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 15px;
}

.redeem-btn {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.redeem-btn:hover {
    background-color: #218838;
}

.redeem-btn.disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Status styles */
.status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

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

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

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

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

/* Rewards table styles */
.rewards-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rewards-table th,
.rewards-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.rewards-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.rewards-table .edit-reward,
.rewards-table .delete-reward {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
}

.rewards-table .edit-reward {
    background-color: #28a745;
    color: white;
}

.rewards-table .delete-reward {
    background-color: #dc3545;
    color: white;
}

.rewards-table .edit-reward:hover {
    background-color: #218838;
}

.rewards-table .delete-reward:hover {
    background-color: #c82333;
} 

/* --- BRAND COLORS --- */
:root {
    --brand-primary: #218838; /* Deep blue/gray */
    --brand-accent: #6c757d;  /* Green accent */
    --brand-light: #f4f4f4;
    --brand-white: #fff;
    --brand-error: #ff6b6b;
}

/* --- HEADER BAR FOR LOGIN --- */
.login-header {
    width: 100%;
    background: var(--brand-primary);
    color: var(--brand-white);
    padding: 24px 0 16px 0;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
}

/* --- LOGIN CONTAINER IMPROVEMENTS --- */
.login-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 32px 24px 24px 24px;
    background: var(--brand-white);
    border-radius: 8px;
    box-shadow: 0 0 16px rgba(44,62,80,0.08);
}

.login-container h1 {
    display: none; /* Hide duplicate h1, use .login-header instead */
}

/* --- FORM LABELS & INPUTS --- */
.form-group label {
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    font-size: 1rem;
}
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 10px;
    background: var(--brand-light);
    transition: border 0.2s;
}
.form-group input:focus {
    border-color: var(--brand-primary);
    outline: none;
}

/* --- LOGIN BUTTON --- */
.button, .login-container button, .btn.btn-primary {
    width: 100%;
    padding: 12px 0;
    background: var(--brand-primary);
    color: var(--brand-white);
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
}
.button:hover, .login-container button:hover, .btn.btn-primary:hover {
    background: var(--brand-accent);
}

/* --- ERROR MESSAGE --- */
.error, .error-message {
    background: var(--brand-error);
    color: var(--brand-white);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

/* --- RESPONSIVE --- */
@media (max-width: 500px) {
    .login-container {
        padding: 16px 6px 16px 6px;
        margin: 30px 4px;
    }
    .login-header {
        font-size: 1.3rem;
        padding: 16px 0 10px 0;
        margin-bottom: 18px;
    }
}  