/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #ab1053;
    --primary-light: #fce8f0;
    --primary-dark: #8a0d43;
    --accent: #c4246a;
    --danger: #dc3545;
    --danger-light: #fde8ea;
    --warning: #f0ad4e;
    --warning-light: #fef7e8;
    --success: #28a745;
    --success-light: #e8f5eb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --sidebar-width: 260px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-800);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 12px 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

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

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

.nav-icon {
    font-size: 16px;
}

.sidebar-clients {
    flex: 1;
    padding: 0 12px 12px;
    overflow-y: auto;
}

.sidebar-search {
    position: sticky;
    top: 0;
    padding: 8px 0;
    background: var(--gray-800);
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.06);
    color: white;
    font-size: 13px;
    outline: none;
}

.sidebar-search input::placeholder {
    color: var(--gray-400);
}

.sidebar-search input:focus {
    border-color: var(--accent);
}

.sidebar-client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: var(--gray-300);
}

.sidebar-client-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-client-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

.sidebar-client-consistency {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    max-width: 1400px;
}

/* ===== Views ===== */
.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.client-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===== Buttons ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

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

.btn-back {
    background: transparent;
    color: var(--gray-500);
    padding: 8px 12px;
}

.btn-back:hover {
    color: var(--gray-800);
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    background: var(--gray-200);
    color: var(--gray-600);
}

.btn-small:hover {
    background: var(--primary-light);
    color: var(--primary);
}

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

.btn-icon {
    padding: 4px 8px;
    background: transparent;
    font-size: 16px;
    color: var(--gray-400);
}

.btn-icon:hover {
    color: var(--gray-700);
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
}

.card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.summary-card.attention .card-value {
    color: var(--danger);
}

/* ===== Targets Bar ===== */
.targets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
}

.target-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.target-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    font-weight: 500;
}

.target-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ===== Consistency Badge ===== */
.consistency-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.consistency-green {
    background: var(--success-light);
    color: var(--success);
}

.consistency-yellow {
    background: var(--warning-light);
    color: #b8860b;
}

.consistency-red {
    background: var(--danger-light);
    color: var(--danger);
}

.consistency-na {
    background: var(--gray-100);
    color: var(--gray-400);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.cell-green {
    color: var(--success);
    font-weight: 600;
}

.cell-yellow {
    color: #b8860b;
    font-weight: 600;
}

.cell-red {
    color: var(--danger);
    font-weight: 600;
}

.cell-na {
    color: var(--gray-400);
}

.weight-change-positive {
    color: var(--danger);
}

.weight-change-negative {
    color: var(--success);
}

.weight-change-neutral {
    color: var(--gray-500);
}

.client-name-cell {
    font-weight: 600;
    color: var(--gray-800);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.tab {
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Charts ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    min-height: 300px;
}

.chart-card canvas {
    max-height: 280px;
}

/* ===== Date Range Picker ===== */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.date-range-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}

.date-range-picker input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
}

.quick-ranges {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

/* ===== Forms ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.targets-grid {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,122,109,0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 720px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal form,
.modal > div:not(.modal-header) {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    margin-top: 8px;
}

.checkin-form-sections {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 8px;
    padding-right: 8px;
}

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

.checkin-header h3 {
    margin-bottom: 0;
}

/* ===== Check-In Detail ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.detail-row .detail-label {
    color: var(--gray-500);
}

.detail-row .detail-value {
    font-weight: 600;
    color: var(--gray-800);
}

.detail-notes {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 14px;
    display: none;
}

.empty-state.visible {
    display: block;
}

/* ===== Action Buttons in Table ===== */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ===== Login Screen ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gray-800) 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.login-card {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: var(--primary);
    padding: 32px 32px 24px;
    text-align: center;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.login-header p {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.login-body {
    padding: 32px;
}

.login-message {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--gray-200);
}

.login-divider span {
    padding: 0 12px;
}

.login-body .form-group {
    margin-bottom: 12px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 18px;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 300;
    color: var(--gray-500);
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Sidebar Footer ===== */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.btn-signout {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-400);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-signout:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* ===== Macro Paste Zone ===== */
.macro-paste-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 16px;
    background: var(--gray-50);
    outline: none;
}

.macro-paste-zone:focus,
.macro-paste-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.macro-paste-zone.processing {
    border-color: var(--primary);
    background: var(--primary-light);
    cursor: default;
}

.paste-zone-idle svg {
    color: var(--gray-400);
    margin-bottom: 6px;
}

.paste-zone-idle p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 2px;
}

.paste-hint {
    font-size: 11px;
    color: var(--gray-400);
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin: 0 auto 8px;
}

.paste-zone-processing p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.ocr-progress-bar {
    width: 80%;
    max-width: 200px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 0 auto 4px;
    overflow: hidden;
}

.ocr-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.ocr-status-text {
    font-size: 11px;
    color: var(--gray-400);
}

/* ===== OCR Result Strip ===== */
.ocr-result {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.ocr-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--gray-700);
}

.ocr-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}

.ocr-badge.low {
    background: var(--warning);
    color: var(--gray-800);
}

.ocr-result-values {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.ocr-value-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ocr-value-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 14px;
}

.ocr-input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    background: white;
}

.ocr-input:focus {
    border-color: var(--primary);
    outline: none;
}

.ocr-value-group span {
    font-size: 12px;
    color: var(--gray-500);
}

.ocr-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ocr-result-actions select {
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
}

.btn-sm {
    padding: 5px 12px !important;
    font-size: 12px !important;
}

/* ===== Daily Macro Section ===== */
.daily-macro-section {
    margin-bottom: 16px;
}

.daily-macro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    user-select: none;
}

.daily-macro-toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--gray-400);
}

.daily-macro-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.daily-macro-table {
    margin-top: 4px;
}

.daily-macro-table.collapsed {
    display: none;
}

.daily-macro-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.daily-macro-row-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.daily-day-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.daily-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    text-align: center;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.daily-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(171,16,83,0.1);
}

.daily-input.filled {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ===== Macro Averages Section ===== */
.macro-averages-section {
    margin-top: 12px;
}

.macro-avg-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.macro-avg-label strong {
    font-size: 13px;
    color: var(--gray-700);
}

.macro-avg-indicator {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
    margin-top: 4px;
}

.btn-link:hover {
    color: var(--primary);
}

/* Daily macro detail in check-in detail view */
.daily-breakdown-table {
    width: 100%;
    font-size: 12px;
    margin-top: 8px;
}

.daily-breakdown-table th,
.daily-breakdown-table td {
    padding: 4px 8px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.daily-breakdown-table th {
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* ===== Phase Badges ===== */
.phase-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-fat-loss {
    background: #fde8ea;
    color: #dc3545;
}

.phase-reverse {
    background: #e8f0fe;
    color: #1a73e8;
}

.phase-maintenance {
    background: #e8f5eb;
    color: #28a745;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.status-active, .status-monthly {
    background: var(--success-light);
    color: var(--success);
}

.status-expiring {
    background: var(--warning-light);
    color: #b8860b;
}

.status-ended {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== Client Dates Info ===== */
.client-dates-info {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
    padding-left: 0;
}

.view-header {
    flex-wrap: wrap;
}

/* ===== Protocols Tab ===== */
.protocols-form .form-group {
    margin-bottom: 16px;
}

.protocols-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    font-family: inherit;
    resize: vertical;
}

.protocols-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(171,16,83,0.1);
}

.protocols-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.protocols-save-status {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    transition: opacity 0.3s;
}

/* ===== Photo Upload Zone ===== */
.photo-upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 12px;
    background: var(--gray-50);
}

.photo-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-upload-zone svg {
    color: var(--gray-400);
    margin-bottom: 6px;
}

.photo-upload-zone p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 2px;
}

/* ===== Photo Preview Grid ===== */
.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220,53,69,0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Photo Comparison View ===== */
.photo-comparison-controls {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.photo-compare-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-compare-select label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.photo-compare-select select {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
}

.photo-comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 200px;
}

.photo-compare-side {
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.photo-compare-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--gray-400);
    font-size: 14px;
}

.photo-compare-side img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.photo-compare-side img:hover {
    opacity: 0.9;
}

.photo-compare-date-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
}

/* ===== Photo Lightbox ===== */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ===== Check-in Detail Photos ===== */
.detail-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.detail-photo-thumb {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: border-color 0.2s;
}

.detail-photo-thumb:hover {
    border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: visible;
    }

    .sidebar-header h1, .sidebar-subtitle,
    .sidebar-clients, .nav-btn span:not(.nav-icon) {
        display: none;
    }

    .nav-btn {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 60px;
        padding: 16px;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid, .targets-grid {
        grid-template-columns: 1fr 1fr;
    }
}
