:root {
    --blue: #2563eb;
    --navy: #1e293b;
    --slate: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
}

/* Base Layout */
body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    margin: 0; 
    background: var(--light); 
    display: flex; 
    height: 100vh; 
    overflow: hidden;
    color: var(--navy);
}

.screen { 
    display: none; 
    width: 100%; 
    height: 100vh; 
    overflow-y: auto; 
}

.active { 
    display: flex; 
    flex-direction: column; 
}

/* Authentication Screen centering */
.auth-container { 
    max-width: 450px; 
    margin: auto; 
    padding: 20px; 
    width: 100%;
}

.card { 
    background: #fff; 
    padding: 2.5rem; 
    border-radius: 16px; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
    margin-bottom: 20px;
}

/* --- THE FIX: INPUTS & FORM ELEMENTS --- */
input, select, textarea {
    display: block;      /* This forces them to stack vertically */
    width: 100%;         /* Uses full width of the card */
    box-sizing: border-box; /* Critical: keeps padding inside the width */
    padding: 12px 15px;
    margin: 8px 0 16px 0; /* Vertical spacing */
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--blue);
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate);
    display: block;
}

/* Button Refinements */
.btn { 
    border: none; 
    padding: 14px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%; 
    transition: background 0.2s, transform 0.1s;
}

.btn-blue { 
    background: var(--blue); 
    color: white; 
}

.btn-blue:hover { background: #1d4ed8; }
.btn:active { transform: scale(0.98); }

/* Sidebar Logic */
.portal-layout { 
    display: flex; 
    width: 100%; 
    height: 100vh; 
}

.sidebar { 
    width: 260px; 
    background: var(--navy); 
    color: white; 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 40px;
    padding-left: 10px;
}

.nav-link { 
    padding: 14px 18px; 
    cursor: pointer; 
    border-radius: 10px; 
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    transition: 0.3s;
}

.nav-link i { font-size: 18px; }

.nav-link:hover, .nav-link.active { 
    background: rgba(255,255,255,0.08); 
    color: white; 
}

.logout-btn {
    margin-top: auto;
    color: #fb7185;
}

/* Content Area */
.main-content { 
    flex: 1; 
    padding: 40px; 
    overflow-y: auto; 
    background: var(--light);
}

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

/* Dashboard & Meds */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.med-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.med-entry input { margin: 0; }
.med-entry .btn { width: 50px; }

.med-card { 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    justify-content: space-between; 
    padding: 12px 0; 
    align-items: center;
}

.status-badge { 
    padding: 10px 20px; 
    border-radius: 30px; 
    color: white; 
    font-weight: 700;
    font-size: 14px;
}

/* Profile Setup Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group.full {
    grid-column: span 2;
}
.timeline-item {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    padding-left: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: 10px 0 0 10px;
    background: #e2e8f0; /* Default color */
}

/* Color coding the timeline circles based on status */
.timeline-item strong {
    color: var(--navy);
    font-size: 16px;
}

.timeline-item small {
    display: block;
    color: var(--slate);
    margin-top: 5px;
}
/* Custom Photo Upload Button */
.custom-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--slate);
    margin-top: 10px;
}

.custom-file-upload:hover {
    background: #e2e8f0;
    border-color: var(--blue);
    color: var(--blue);
}

.custom-file-upload i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.custom-file-upload span {
    font-weight: 600;
    font-size: 14px;
}

/* Hide the ugly default input */
#wound-photo {
    display: none;
}

/* Photo Preview Image */
#wound-preview {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 15px;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
/* Ensure only the active tab is visible */
.tab-pane {
    display: none;
    width: 100%;
}

.tab-pane.active {
    display: block !important;
}