/* VitalArc App Styles - matches landing page design language */
:root {
    --forest: #1a5c4c;
    --forest-light: #237a65;
    --forest-dark: #0f3d33;
    --amber: #c8944a;
    --amber-light: #e8b86d;
    --cream: #faf7f2;
    --cream-dark: #f0ebe3;
    --charcoal: #1a1a2e;
    --slate: #4a4a5a;
    --mist: #8a8a96;
    --danger: #d94f4f;
    --success: #2d9b6e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--charcoal);
    background: var(--cream);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.15;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--forest-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-logo {
    padding: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo span { color: var(--amber-light); }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--amber);
}

.sidebar-nav a .icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--forest-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-email {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: color 0.15s;
}

.logout-btn:hover { color: white; }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--forest-dark);
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    font-size: 0.95rem;
    color: var(--mist);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--forest-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 92, 76, 0.25);
}

.btn-secondary {
    background: white;
    color: var(--forest);
    border: 1px solid rgba(26, 92, 76, 0.15);
}

.btn-secondary:hover {
    border-color: var(--forest);
    background: rgba(26, 92, 76, 0.03);
}

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

.btn-amber:hover {
    background: var(--amber-light);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid rgba(26, 92, 76, 0.06);
    box-shadow: 0 2px 12px rgba(26, 92, 76, 0.04);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cream-dark);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--forest-dark);
}

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

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid rgba(26, 92, 76, 0.06);
    box-shadow: 0 2px 12px rgba(26, 92, 76, 0.04);
}

.stat-card .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--forest);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-card .stat-value.amber { color: var(--amber); }

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--mist);
    font-weight: 500;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mist);
    border-bottom: 1px solid var(--cream-dark);
}

table td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: var(--charcoal);
    border-bottom: 1px solid var(--cream-dark);
}

table tr:last-child td { border-bottom: none; }

table tr:hover td {
    background: rgba(26, 92, 76, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft {
    background: rgba(138, 138, 150, 0.12);
    color: var(--mist);
}

.badge-active, .badge-approved {
    background: rgba(45, 155, 110, 0.1);
    color: var(--success);
}

.badge-completed {
    background: rgba(26, 92, 76, 0.1);
    color: var(--forest);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.4rem;
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--mist);
    margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(26, 92, 76, 0.15);
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--charcoal);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(26, 92, 76, 0.08);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* Section dividers */
.form-section {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--forest-dark);
    margin-bottom: 0.35rem;
}

.form-section p {
    font-size: 0.85rem;
    color: var(--mist);
}

.form-section-divider {
    height: 1px;
    background: var(--cream-dark);
    margin: 2rem 0;
}

/* Tag input */
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.4rem;
    border: 1px solid rgba(26, 92, 76, 0.15);
    border-radius: 10px;
    background: white;
    min-height: 42px;
    cursor: text;
}

.tag-input-wrap:focus-within {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(26, 92, 76, 0.08);
}

.tag-input-wrap .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(26, 92, 76, 0.08);
    color: var(--forest);
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tag-input-wrap .tag button {
    background: none;
    border: none;
    color: var(--forest);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.6;
}

.tag-input-wrap .tag button:hover { opacity: 1; }

.tag-input-wrap input {
    flex: 1;
    min-width: 120px;
    border: none;
    padding: 0.25rem 0.35rem;
    font-size: 0.85rem;
    outline: none;
    box-shadow: none;
}

/* Pain slider */
.pain-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pain-slider input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--success), var(--amber), var(--danger));
    outline: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.pain-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--forest);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.pain-slider .pain-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    min-width: 36px;
    text-align: center;
}

/* Blueprint display */
.blueprint-section {
    margin-bottom: 1.75rem;
}

.blueprint-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--forest-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blueprint-section h3 .section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.focus-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 10px;
    background: var(--cream);
    margin-bottom: 0.5rem;
}

.focus-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.focus-dot.high { background: var(--danger); }
.focus-dot.medium { background: var(--amber); }
.focus-dot.low { background: var(--success); }

.session-phase {
    border-left: 3px solid var(--forest-light);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--cream);
    border-radius: 0 10px 10px 0;
}

.session-phase .phase-range {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--forest);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.session-phase .phase-focus {
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.35rem;
}

.session-phase .phase-techniques {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.session-phase .phase-techniques span {
    background: rgba(26, 92, 76, 0.08);
    color: var(--forest);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed rgba(26, 92, 76, 0.1);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-week {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--amber);
    background: rgba(200, 148, 74, 0.1);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    white-space: nowrap;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

.spinner.dark {
    border-color: rgba(26, 92, 76, 0.15);
    border-top-color: var(--forest);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
    border-left: 3px solid var(--forest);
}

.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.15rem;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--mist);
    margin-bottom: 1.25rem;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(26, 92, 76, 0.08);
    border: 1px solid rgba(26, 92, 76, 0.06);
}

.auth-card .auth-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--forest);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .auth-logo span { color: var(--amber); }

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--mist);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--mist);
}

.auth-card .auth-footer a {
    color: var(--forest);
    font-weight: 600;
    text-decoration: none;
}

.auth-card .auth-footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1.25rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
