/* style.css - Receipt Scanner Styles */

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
}

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

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

/* Navigation */
nav {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

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

.nav-user {
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.household-badge {
    background: var(--gray-200);
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.household-badge:hover {
    background: var(--gray-300);
    color: var(--gray-800);
}

.household-badge:empty {
    display: none;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-menu-btn:hover {
    background: var(--gray-200);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.user-menu-name {
    color: var(--gray-800);
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.6rem;
    color: var(--gray-600);
    transition: transform 0.2s;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-header {
    padding: 1rem;
    background: var(--gray-100);
}

.dropdown-header strong {
    display: block;
    color: var(--gray-800);
}

.dropdown-email {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-800);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-logout {
    color: var(--danger);
}

.dropdown-logout:hover {
    background: #fdeaea;
}

.pending-admin-badge {
    background: var(--warning);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Badge */
.badge {
    display: inline-block;
    background: var(--danger);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.badge.warning {
    background: var(--warning);
}

.badge.success {
    background: var(--success);
}

.badge.manual {
    background: var(--primary);
}

.badge.hidden {
    display: none;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Upload Mode Toggle */
.upload-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--gray-200);
    padding: 0.25rem;
    border-radius: 8px;
    width: fit-content;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-600);
    transition: all 0.2s;
}

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

.mode-btn.active {
    background: white;
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-section {
    /* Container for upload areas */
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* Upload area */
.upload-area {
    background: white;
    border: 3px dashed var(--gray-300);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Group Upload */
.group-upload-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.group-header {
    margin-bottom: 1.5rem;
}

.group-header h2 {
    margin-bottom: 0.5rem;
}

.group-header p {
    color: var(--gray-600);
}

.group-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.group-drop-zone {
    border: 3px dashed var(--gray-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.group-drop-zone:hover, .group-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.05);
}

.drop-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.group-preview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.group-preview h3 {
    margin-bottom: 0.5rem;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.preview-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.preview-order {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.preview-label {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.preview-actions {
    display: flex;
    gap: 0.25rem;
}

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

.upload-options {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.upload-options label {
    margin-right: 0.5rem;
    color: var(--gray-600);
}

.upload-options select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 1rem;
}

/* Progress */
#upload-progress {
    margin-top: 2rem;
}

.progress-header {
    margin-bottom: 1rem;
}

.progress-bar {
    background: var(--gray-200);
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    width: 0;
    transition: width 0.3s;
}

#progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--gray-600);
}

#progress-timer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-600);
    font-family: monospace;
}

/* Progress Details - Real-time file status */
.progress-details {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 1rem;
    scroll-behavior: smooth;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

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

.progress-item .status-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.progress-item .filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-800);
}

.progress-item .status-text {
    color: var(--gray-600);
    font-size: 0.85rem;
}

.progress-item .time {
    color: var(--gray-600);
    font-family: monospace;
    font-size: 0.8rem;
}

.progress-item.uploading {
    background: var(--gray-100);
}

.progress-item.processing {
    background: #e8f4fd;
}

.progress-item.processing.active {
    background: #cce5ff;
    border-left: 3px solid var(--primary);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.progress-item.success {
    background: #e8f8ed;
}

.progress-item.error {
    background: #ffeaea;
}

.progress-item.skipped {
    background: #fff8e6;
}

/* Spinner animation */
.spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Results */
#results {
    margin-top: 2rem;
}

.result-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-item.error {
    background: #ffeaea;
}

.result-item.skipped {
    background: #fff8e6;
}

.result-item .status-icon {
    font-size: 1.5rem;
}

.result-item .date {
    color: var(--gray-600);
}

.result-item .muted {
    color: var(--gray-600);
}

.result-item .warning {
    color: var(--warning);
}

.result-item .error {
    color: var(--danger);
}

/* Review cards */
.review-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Review card with image */
.review-card-with-image {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

.review-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.review-thumbnail {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.review-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.image-hint {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.no-image {
    width: 100%;
    height: 200px;
    background: var(--gray-200);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.review-content {
    display: flex;
    flex-direction: column;
}

/* Image modal */
.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 1rem;
    position: relative;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--gray-800);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: var(--danger);
}

@media (max-width: 768px) {
    .review-card-with-image {
        grid-template-columns: 1fr;
    }
    
    .review-thumbnail {
        max-height: 200px;
    }
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.reason-badge {
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 300px;
}

.review-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.review-details .detail {
    display: flex;
    flex-direction: column;
}

.review-details label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.review-details input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

.review-details select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

.review-meta {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    display: flex;
    gap: 2rem;
}

.review-actions {
    display: flex;
    gap: 1rem;
}

.btn-approve {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-reject {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

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

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
}

th {
    background: var(--gray-200);
    font-weight: 600;
}

tr:not(:last-child) td {
    border-bottom: 1px solid var(--gray-200);
}

.amount {
    font-family: inherit;
    font-size: inherit;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Date column - no wrap */
td:first-child {
    white-space: nowrap;
}

/* Actions column - aligned buttons */
td:last-child {
    white-space: nowrap;
}

td:last-child .btn-small {
    min-width: 70px;
}

/* Status badges */
.badge.edited {
    background: var(--primary);
    color: white;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-small {
    min-width: 120px;
    max-width: 150px;
}

.filter-medium {
    min-width: 150px;
    max-width: 200px;
}

/* Search box with clear button */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 300px;
    min-width: 200px;
}

.search-box {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 1rem;
    padding: 0.25rem;
    line-height: 1;
}

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

/* Total count badge */
.total-count {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--gray-500);
    margin-left: 0.5rem;
}

.search-results-count {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.date-filter-badge {
    background: var(--gray-700);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.date-filter-badge .clear-date {
    cursor: pointer;
    margin-left: 0.3rem;
    opacity: 0.7;
}

.date-filter-badge .clear-date:hover {
    opacity: 1;
}

/* Search highlighting */
.search-highlight {
    background-color: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Matched items preview in search results */
.matched-items-preview {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--gray-50);
    border-radius: 4px;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary);
}

.matched-items-preview .match-label {
    color: var(--gray-500);
    margin-right: 0.5rem;
}

.matched-items-preview .matched-item {
    display: inline-block;
    background: white;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin: 0.15rem 0.25rem 0.15rem 0;
    border: 1px solid var(--gray-200);
}

.matched-items-preview .item-price {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* Pagination */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Elements */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Buttons */
.btn-small {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    box-sizing: border-box;
}

.btn-small:hover {
    background: var(--gray-200);
}

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

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

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

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

.btn-small.btn-warning {
    color: #f59e0b;
    border-color: #f59e0b;
    background: white;
}

.btn-small.btn-warning:hover {
    background: #f59e0b;
    color: white;
}

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

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

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

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

.btn-primary.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

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

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Review Banner */
.review-banner {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-banner-text {
    font-weight: 600;
    color: #856404;
}

#review-reason {
    font-size: 0.9rem;
    color: #856404;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-section {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

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

.modal-wide {
    max-width: 500px;
    width: 100%;
}

.item-desc-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

.item-desc-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.currency-suffix {
    font-size: 0.9em;
    color: var(--gray-600);
    font-weight: normal;
}

/* Analytics */
.currency-selector {
    margin-bottom: 2rem;
}

.currency-selector select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--gray-600);
}

.analytics-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.analytics-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analytics-section.full-width {
    margin-bottom: 1.5rem;
}

.analytics-section.full-width .chart-container {
    height: 350px;
}

.analytics-section h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Multi-currency summary */
.multi-currency-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.multi-currency-summary h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.currency-totals {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.currency-total-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-radius: 8px;
}

.currency-total-item.primary {
    background: linear-gradient(135deg, #3498db15, #9b59b615);
    border: 1px solid var(--primary);
}

.currency-total-item .currency-flag {
    font-size: 1.25rem;
}

.currency-total-item .currency-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.currency-total-item.primary .currency-value {
    color: var(--primary);
}

.currency-total-item .currency-code {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.notice {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #856404;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
    padding: 0;
}

/* Calendar styles */
.calendar-section {
    margin-bottom: 1.5rem;
    max-width: 350px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calendar-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.calendar-select:focus {
    outline: none;
    border-color: var(--primary);
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 3px;
    width: 100%;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--gray-500);
    padding: 0.25rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--gray-100);
    position: relative;
    font-size: 0.8rem;
    min-height: 32px;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid var(--primary);
}

.calendar-day.has-receipts {
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.calendar-day.has-receipts:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.calendar-day-num {
    font-size: 0.75rem;
}

.calendar-count {
    font-size: 0.55rem;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-weight: 700;
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Analytics filters */
.analytics-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray-600);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Mobile-friendly bar charts */
.bar-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: 8px;
    transition: background 0.2s;
}

.bar-item.clickable {
    cursor: pointer;
}

.bar-item.clickable:hover {
    background: var(--gray-200);
}

.bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bar-label {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.bar-value {
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.bar-container {
    width: 100%;
    background: var(--gray-300);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.bar-fill {
    background: var(--primary);
    height: 100%;
    transition: width 0.3s;
    border-radius: 4px;
}

.bar-fill.shop {
    background: var(--success);
}

.bar-fill.monthly {
    background: #9b59b6;
}

/* Legacy bar-row support */
.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Chart container for Chart.js */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.recent-table {
    width: 100%;
}

.recent-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.recent-table tr.clickable {
    cursor: pointer;
}

.recent-table tr.clickable:hover {
    background: var(--gray-100);
}

/* Receipts table in modal */
.receipts-table {
    width: 100%;
    border-collapse: collapse;
}

.receipts-table th,
.receipts-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.receipts-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.receipts-table tr.clickable {
    cursor: pointer;
}

.receipts-table tr.clickable:hover {
    background: var(--gray-100);
}

/* Large modal for drill-down */
.modal-large {
    max-width: 800px;
    max-height: 80vh;
}

.modal-large .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Modal header layout */
.categories-modal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Stack title + total */
.modal-header-text {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Total styling */
.modal-total {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-400);
    white-space: nowrap;
}

/* Mobile responsive for analytics */
@media (max-width: 768px) {
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-group select {
        flex: 1;
    }
    
    .bar-label {
        max-width: 50%;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Receipt Detail Page */
.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Section header with action button */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
}

/* Item actions in table */
.item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.receipt-header {
    margin-bottom: 1.5rem;
}

.receipt-header h1 {
    margin-bottom: 0.5rem;
}

.receipt-meta {
    display: flex;
    gap: 1rem;
    color: var(--gray-600);
}

.receipt-category {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.receipt-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Wrapper to stack Total card with currency conversions underneath */
.summary-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.summary-card-wrapper .summary-card {
    border-radius: 8px 8px 0 0;
    box-shadow: none;
}

.summary-card-wrapper .other-currencies-box.hidden ~ .summary-card,
.summary-card-wrapper:has(.other-currencies-box.hidden) .summary-card {
    border-radius: 8px;
}

.other-currencies-box {
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-top: 1px dashed var(--gray-300);
}

.other-currencies-box .alt-currency {
    white-space: nowrap;
}

.summary-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Compact summary cards for Currency, Country, Date/Time */
.summary-card.compact {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.summary-card.compact label {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.summary-card.compact span {
    font-size: 1rem;
    font-weight: 600;
}

.currency-symbol, .country-flag {
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

.summary-card label {
    display: block;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.summary-card .amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success);
}

.receipt-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.receipt-section h2 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--gray-800);
}

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

.detail-item label {
    display: block;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.confidence-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.confidence-section > label {
    display: block;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.confidence-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.conf-item {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.conf-high {
    background: #d4edda;
    color: #155724;
}

.conf-mid {
    background: #fff3cd;
    color: #856404;
}

.conf-low {
    background: #f8d7da;
    color: #721c24;
}

.source-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.source-link:hover {
    background: var(--primary);
    color: white;
}

.receipt-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

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

/* Utilities */
.hidden {
    display: none !important;
}

.muted {
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .nav-user {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .user-menu-btn {
        padding: 0.4rem;
    }
    
    .user-menu-name {
        display: none;
    }
    
    main {
        padding: 1rem;
    }
    
    .analytics-sections {
        grid-template-columns: 1fr;
    }
    
    .bar-label {
        width: 100px;
    }
    
    .bar-value {
        width: 80px;
    }
    
    /* Button spacing on mobile */
    .btn-primary, .btn-secondary, .btn-danger {
        margin-bottom: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Review actions on mobile */
    .review-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .review-actions button {
        width: 100%;
    }
    
    /* Pending user actions */
    .pending-user-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pending-user-actions button,
    .pending-user-actions select {
        width: 100%;
    }
    
    /* Modal actions on mobile */
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions button {
        width: 100%;
    }
    
    /* Item actions in table */
    .item-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .item-actions button {
        width: 100%;
        font-size: 0.8rem;
    }
    
    /* Backup grid */
    .backup-grid {
        grid-template-columns: 1fr;
    }
    
    /* Profile grid */
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    /* Actions cell in tables */
    .actions-cell {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .actions-cell button,
    .actions-cell .btn-small {
        width: 100%;
        text-align: center;
    }
    
    /* Section header on mobile */
    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .section-header button {
        width: 100%;
    }
}

/* Version badge in nav */
.nav-brand .version {
    font-size: 0.7rem;
    color: var(--gray-600);
    font-weight: normal;
    vertical-align: super;
}

/* User link in nav */
.user-link {
    color: var(--gray-600);
    text-decoration: none;
}

.user-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Profile page styles */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.profile-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.profile-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--gray-600);
}

.profile-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.profile-info p {
    margin: 0.5rem 0;
    color: var(--gray-600);
}

.email-status {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.email-status .verified {
    color: var(--success);
}

.email-status .unverified {
    color: var(--warning);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: 8px;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.member-info {
    flex: 1;
}

.member-info strong {
    display: block;
}

.member-email {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* Sessions Section */
.sessions-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.sessions-section h3 {
    margin-bottom: 0.5rem;
}

.section-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.session-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.session-card.current-session {
    background: #e8f4f8;
    border-color: var(--primary);
}

.session-icon {
    font-size: 1.5rem;
}

.session-info {
    flex: 1;
}

.session-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.badge-current {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.session-details {
    font-size: 0.8rem;
    color: var(--gray-600);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

.sessions-actions {
    margin-top: 1rem;
}

.logout-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
}

.form-actions {
    margin-top: 1rem;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-brand h1 {
    margin: 0;
    color: var(--gray-800);
    font-size: 1.75rem;
}

.login-tagline {
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.auth-form-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--gray-800);
}

.auth-form-container .form-group {
    margin-bottom: 1.25rem;
}

.auth-form-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-800);
}

.auth-form-container input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

/* Checkbox styling for login form */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.auth-error {
    background: #fdeaea;
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-success {
    background: #e8f5e9;
    color: var(--success);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-600);
}

.forgot-password {
    text-align: right;
    margin: -0.5rem 0 1rem 0;
    font-size: 0.85rem;
}

.forgot-password a {
    color: var(--gray-600);
}

.forgot-password a:hover {
    color: var(--primary);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

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

/* Admin Section Styles */
.admin-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-user-card {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning);
}

.pending-user-card:last-child {
    margin-bottom: 0;
}

.pending-user-info {
    margin-bottom: 1rem;
}

.pending-user-info strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.pending-user-info p {
    margin: 0.25rem 0;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.pending-user-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.pending-user-actions select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    flex: 1;
    min-width: 150px;
}

.btn-approve {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-approve:hover {
    background: #219653;
}

.btn-reject {
    background: var(--gray-200);
    color: var(--gray-600);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.no-pending {
    color: var(--gray-600);
    text-align: center;
    padding: 2rem;
}

/* Backup & Storage Styles */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.backup-card {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.25rem;
}

.backup-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.backup-card h4 {
    margin: 1.25rem 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--gray-600);
}

.backup-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.backups-list {
    max-height: 250px;
    overflow-y: auto;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.backup-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backup-name {
    font-weight: 500;
    font-size: 0.85rem;
}

.backup-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: var(--gray-200);
    text-decoration: none;
}

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

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

.storage-stats {
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.stat-row:last-child {
    border-bottom: none;
}

.no-backups {
    color: var(--gray-500);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.pending-badge {
    background: var(--warning);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.pending-admin-badge {
    display: inline-block;
    background: var(--warning);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 0.35rem;
    vertical-align: middle;
    cursor: pointer;
}

/* User Management Styles */
.invite-section {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.invite-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.invitations-list {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-300);
}

.invitations-list h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.users-table thead {
    background: var(--gray-100);
}

.users-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.users-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.users-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

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

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

.status-active {
    color: var(--success);
    font-size: 0.85rem;
}

.status-pending {
    color: var(--warning);
    font-size: 0.85rem;
}

.status-verified {
    color: var(--success);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.status-unverified {
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.status-expired {
    color: var(--danger);
    font-size: 0.85rem;
}

.badge-master {
    background: #9b59b6;
    color: white;
}

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

.badge-user {
    background: var(--gray-300);
    color: var(--gray-600);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

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

.user-details {
    margin-top: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row:last-child {
    border-bottom: none;
}

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

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.no-users {
    color: var(--gray-500);
    text-align: center;
    padding: 2rem;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 90%;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: var(--primary);
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.toast-message {
    font-size: 0.95rem;
}

/* Additional mobile fixes */
@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .login-logo {
        font-size: 3rem;
    }
    
    .login-brand h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .modal-actions {
        margin-top: 1rem;
    }
    
    .backup-card {
        padding: 1rem;
    }
    
    .profile-section {
        padding: 1rem;
    }
    
    .admin-section {
        padding: 1rem;
    }
    
    /* Ensure buttons don't overflow */
    button, .btn-primary, .btn-secondary, .btn-danger, .btn-approve, .btn-reject {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Table responsiveness */
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th, .users-table td {
        padding: 0.5rem;
    }
    
    /* Badge sizing */
    .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}
