@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--text);
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: #eff6ff;
}

/* Forms */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group .sub-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    display: block;
}

.input-field,
.select-field,
.textarea-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #f9fafb;
}

.input-field:focus,
.select-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #ffffff;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-wrapper,
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: var(--transition);
    background: #fff;
}

.checkbox-wrapper:hover,
.radio-wrapper:hover {
    border-color: var(--accent);
    background: #f0f9ff;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
    width: 1.1rem;
    height: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 10px -2px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--text-muted);
}

/* Sections */
h1 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

/* Table */
.table-container {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e2e8f0;
    color: var(--text-muted);
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-indigo {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-rose {
    background: #ffe4e6;
    color: #9f1239;
}

/* Utilities */
.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* Vitals Group */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.vital-card {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.vital-card label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: block;
}

.vital-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    padding: 0.25rem;
}

.vital-input:focus {
    outline: none;
    border-color: var(--primary);
}

.bmi-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.5rem;
}

/* Rx Table */
.rx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.rx-table th {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
    font-weight: 600;
}

.rx-row {
    background: var(--background);
    transition: var(--transition);
}

.rx-row td {
    border: 1px solid var(--border);
    padding: 0.5rem;
    background: #fff;
}

.rx-row td:first-child {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.rx-row td:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.rx-row td:not(:first-child):not(:last-child) {
    border-left: none;
    border-right: none;
}

.remove-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #fecaca;
}

.add-btn {
    background: #dbeafe;
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.add-btn:hover {
    background: #bfdbfe;
}

/* Investigation Packages */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.package-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
}

.package-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.package-card.selected {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.package-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.package-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}