:root {
	--cream: #faf8f3;
	--sage: #9ca89b;
	--blush: #e8b4a0;
	--slate: #5f6c7b;
	--soft-white: #ffffff;
	--border: #e8e3d8;
	--fail-border: #dc3545;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Work Sans', sans-serif;
	background: var(--cream);
	color: var(--slate);
	line-height: 1.7;
}

/* Navigation */
.navbar {
	background: var(--soft-white);
	border-bottom: 1px solid var(--border);
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.nav-container {
	max-width: 1600px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 2rem;
}

.nav-brand {
	font-family: 'Fraunces', serif;
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--slate);
}

.nav-brand-logo {
	height: 50px;
}

.nav-menu {
	display: flex;
	gap: 0;
	list-style: none;
	align-items: center;
}

.nav-item {
	position: relative;
}

.nav-link {
	color: var(--slate);
	text-decoration: none;
	padding: 0.75rem 1.5rem;
	display: block;
	font-weight: 500;
	font-size: 0.9rem;
	transition: all 0.3s ease;
}

.nav-link:hover {
	background: var(--cream);
	color: var(--blush);
}

.nav-link.btn-save {
	background: var(--sage);
	color: var(--soft-white);
	border-radius: 6px;
	margin-left: 1rem;
}

.nav-link.btn-save:hover {
	background: #8a9888;
}

.nav-link.btn-logout {
	background: var(--blush);
	color: var(--soft-white);
	border-radius: 6px;
}

.nav-link.btn-logout:hover {
	background: #d9a090;
}

.dropdown-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--soft-white);
	min-width: 200px;
	display: none;
	list-style: none;
	border: 1px solid var(--border);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	border-radius: 4px;
}

.nav-dropdown:hover .dropdown-menu {
	display: block;
}

.dropdown-menu .nav-link {
	border-bottom: 1px solid var(--border);
}

.dropdown-menu .nav-link:last-child {
	border-bottom: none;
}

/* Container */
.container {
	max-width: 1600px;
	margin: 0 auto;
	padding: 2rem;
}

.page-header {
	text-align: center;
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--border);
}

.page-title {
	font-family: 'Fraunces', serif;
	font-size: 3rem;
	font-weight: 400;
	color: var(--slate);
	margin-bottom: 0.5rem;
	letter-spacing: -0.02em;
}

.page-subtitle {
	font-size: 1rem;
	color: var(--sage);
	font-weight: 300;
}

/* Filters */
.filters {
	background: var(--soft-white);
	border-radius: 16px;
	padding: 2rem;
	margin-bottom: 2rem;
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.filters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 2rem;
}

.filter-group label {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--sage);
	margin-bottom: 0.75rem;
}

.filter-group select,
.filter-group input[type="date"] {
	width: 100%;
	padding: 1rem;
	background: var(--cream);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--slate);
	font-size: 0.95rem;
	font-family: 'Work Sans', sans-serif;
	cursor: pointer;
	transition: all 0.3s ease;
}

.filter-group select:hover,
.filter-group input[type="date"]:hover {
	border-color: var(--sage);
	background: var(--soft-white);
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
	outline: none;
	border-color: var(--blush);
	box-shadow: 0 0 0 3px rgba(232, 180, 160, 0.1);
}

.filter-group select,
.filter-group input[type="text"] {
	width: 100%;
	padding: 1rem;
	background: var(--cream);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--slate);
	font-size: 0.95rem;
	font-family: 'Work Sans', sans-serif;
	cursor: pointer;
	transition: all 0.3s ease;
}

.filter-group select:hover,
.filter-group input[type="text"]:hover {
	border-color: var(--sage);
	background: var(--soft-white);
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
	outline: none;
	border-color: var(--blush);
	box-shadow: 0 0 0 3px rgba(232, 180, 160, 0.1);
}

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

.stat-card {
	background: var(--soft-white);
	border-radius: 16px;
	padding: 2rem;
	text-align: center;
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
	transition: all 0.4s ease;
	position: relative;
	overflow: hidden;
}

.stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background: linear-gradient(90deg, var(--blush), var(--sage));
	transform: scaleX(0);
	transition: transform 0.4s ease;
}

.stat-card:hover::before {
	transform: scaleX(1);
}

.stat-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.stat-header {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.stat-label {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--sage);
	font-weight: 600;
}

.stat-points {
	font-size: 0.7rem;
	color: var(--blush);
	font-weight: 500;
}

.stat-value {
	font-family: 'Fraunces', serif;
	font-size: 3rem;
	font-weight: 400;
	color: var(--slate);
	line-height: 1;
	margin-bottom: 1.5rem;
}

.stat-progress {
	width: 100%;
	height: 4px;
	background: var(--cream);
	border-radius: 4px;
	overflow: hidden;
}

.stat-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--blush), var(--sage));
	border-radius: 4px;
	transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Financial Section */
.section {
	background: var(--soft-white);
	border-radius: 16px;
	padding: 2rem;
	margin-bottom: 2rem;
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}

.section-title {
	font-family: 'Fraunces', serif;
	font-size: 1.75rem;
	font-weight: 400;
	color: var(--slate);
	letter-spacing: -0.01em;
}

.section-score {
	font-family: 'Fraunces', serif;
	font-size: 2rem;
	font-weight: 400;
	color: var(--blush);
}

/* Financial Grid */
.financial-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 0;
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
}

.financial-cell {
	padding: 1rem;
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.financial-cell:nth-child(3n) {
	border-right: none;
}

.financial-header-cell {
	background: var(--cream);
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--slate);
}

.financial-label {
	font-weight: 500;
	color: var(--slate);
}

.financial-input {
	width: 100%;
	padding: 0.5rem;
	background: var(--cream);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--slate);
	font-family: 'Work Sans', sans-serif;
	font-size: 0.9rem;
	text-align: right;
}

.financial-input:focus {
	outline: none;
	border-color: var(--blush);
}

.financial-percent {
	font-weight: 600;
	color: var(--slate);
	text-align: right;
}

.financial-total {
	background: var(--sage) !important;
	color: var(--soft-white);
	font-weight: 700;
}

/* Questions */
.questions {
	display: grid;
	gap: 0.75rem;
}

.question {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 1rem;
	align-items: center;
	padding: 1rem;
	background: var(--cream);
	border-radius: 8px;
	border: 2px solid transparent;
	transition: all 0.3s ease;
}

.question:hover {
	background: var(--soft-white);
}

.question.failed {
	border-color: var(--fail-border);
	background: rgba(220, 53, 69, 0.05);
}

.question_tr.failed td {
	border-color: var(--fail-border);
	background: rgba(220, 53, 69, 0.05);
}

.question-number {
	font-weight: 600;
	color: var(--sage);
	min-width: 2rem;
}

.question-text {
	font-size: 0.95rem;
	color: var(--slate);
	line-height: 1.5;
}

.question-controls {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.question-select,
.question-input {
	padding: 0.5rem 0.75rem;
	background: var(--soft-white);
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--slate);
	font-size: 0.85rem;
	font-family: 'Work Sans', sans-serif;
	cursor: pointer;
	transition: all 0.3s ease;
}

.question-input {
	width: 100px;
	text-align: center;
}

.question-select:hover,
.question-input:hover {
	border-color: var(--sage);
}

.question-select:focus,
.question-input:focus {
	outline: none;
	border-color: var(--blush);
	box-shadow: 0 0 0 3px rgba(232, 180, 160, 0.1);
}

/* Table styles */
.data-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
}

.data-table th,
.data-table td {
	padding: 0.75rem;
	border: 1px solid var(--border);
	text-align: left;
}

.data-table th {
	background: var(--cream);
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sage);
}

.data-table td {
	background: var(--soft-white);
}

.data-table input[type="text"],
.data-table input[type="number"] {
	width: 100%;
	padding: 0.5rem;
	background: var(--cream);
	border: 1px solid var(--border);
	border-radius: 4px;
	font-family: 'Work Sans', sans-serif;
	font-size: 0.9rem;
}

.data-table select {
	padding: 0.5rem;
	background: var(--soft-white);
	border: 1px solid var(--border);
	border-radius: 4px;
	font-family: 'Work Sans', sans-serif;
	cursor: pointer;
}

.total-row {
	background: var(--sage) !important;
	color: var(--soft-white);
	font-weight: 700;
}

/*
@media (max-width: 768px) {
	.nav-container {
		flex-direction: column;
		gap: 1rem;
	}

	.nav-menu {
		flex-direction: column;
		width: 100%;
	}

	.nav-link {
		text-align: center;
	}

	.dropdown-menu {
		position: static;
	}

	.question {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	.question-number {
		display: inline;
	}

	.financial-grid {
		grid-template-columns: 1fr;
	}

	.financial-cell {
		border-right: none;
	}
}
*/

@media (max-width: 768px) {

    .nav-container {
        flex-direction: row; /* keep horizontal */
        padding: 0.75rem 1rem;
    }

    .nav-menu {
        flex-direction: row; /* keep horizontal */
        flex-wrap: nowrap;
        gap: 0;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000; /* higher than navbar */
    background: var(--soft-white);
    min-width: 200px;
    display: none;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 8px;
}

.dropdown-menu {
	left: 50%;
	transform: translateX(-50%);
	min-width: 220px;
}
    
	.question {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	.question-number {
		display: inline;
	}

	.financial-grid {
		grid-template-columns: 1fr;
	}

	.financial-cell {
		border-right: none;
	}

}

.nav-menu {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* UPLOAD CSS */

/* Image Upload Section */
.image-upload-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--cream);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--sage);
    color: var(--soft-white);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.upload-button:hover {
    background: #8a9888;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-button:active {
    transform: translateY(0);
}

.upload-button svg {
    width: 20px;
    height: 20px;
}

.upload-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.upload-status.success {
    display: block;
    background: rgba(156, 168, 155, 0.1);
    color: var(--sage);
    border: 1px solid var(--sage);
}

.upload-status.error {
    display: block;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.upload-status.uploading {
    display: block;
    background: rgba(232, 180, 160, 0.1);
    color: var(--blush);
    border: 1px solid var(--blush);
}

.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.uploaded-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--soft-white);
}

.uploaded-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.uploaded-image-item .image-url {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--sage);
    word-break: break-all;
    background: var(--cream);
}

.uploaded-image-item .delete-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.uploaded-image-item .delete-image:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    user-select: none;
}