/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #E91E63;
    --primary-dark: #C2185B;
    --secondary: #9C27B0;
    --success: #4CAF50;
    --warning: #FFA500;
    --error: #F44336;
    --bg: #F5F5F5;
    --card-bg: #FFFFFF;
    --text: #212121;
    --text-secondary: #757575;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-modal: 0 8px 32px rgba(0,0,0,0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
    background: var(--primary);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.back-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
}

.back-link:hover {
    opacity: 0.9;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: rgba(255,255,255,0.9);
}

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

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

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

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

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

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 14px;
    min-height: 36px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    font-size: 18px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

.btn-icon.danger:hover {
    background: rgba(244,67,54,0.1);
    color: var(--error);
}

/* ===== Search ===== */
.search-bar {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 12px 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font);
    transition: border-color 0.2s;
    background: var(--card-bg);
}

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

/* ===== View Switcher ===== */
.view-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-shadow: var(--shadow);
}

.view-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 44px;
    color: var(--text-secondary);
}

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

.view-content {
    display: none;
}

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

/* ===== Feed ===== */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.feed-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.feed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.feed-header:hover {
    background: #FAFAFA;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FCE4EC, #F3E5F5);
    font-size: 20px;
}

.feed-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.feed-owner-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-project-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.feed-photo img {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
    cursor: pointer;
}

.feed-text {
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
}

.feed-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid #EEEEEE;
    display: flex;
    align-items: center;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.2s;
    min-height: 36px;
}

.like-btn:hover {
    background: #FCE4EC;
    color: var(--primary);
}

.like-btn.liked {
    color: var(--primary);
}

.like-btn.liked .like-icon {
    transform: scale(1.1);
}

.like-icon {
    font-size: 18px;
    transition: transform 0.2s;
}

.like-count {
    font-weight: 600;
    font-size: 14px;
    min-width: 8px;
}

.empty-state-sub {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Owner Filter ===== */
.owner-filter {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    margin-bottom: 20px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    background: var(--card-bg);
    cursor: pointer;
    min-height: 44px;
}

.owner-filter:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Filter ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #E0E0E0;
    border-radius: 24px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 44px;
    color: var(--text-secondary);
}

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

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

/* ===== Project Grid ===== */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Project Card ===== */
.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 200px;
    object-fit: cover;
    background: #E0E0E0;
    display: block;
}

.card-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 200px;
    background: linear-gradient(135deg, #FCE4EC, #F3E5F5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.card-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.project-card:hover .card-actions {
    opacity: 1;
}

.card-actions .btn-icon {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    color: var(--text);
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.in_progress { background: var(--warning); }
.status-badge.completed { background: var(--success); }
.status-badge.planned { background: #2196F3; }

.size-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary);
    background: #F3E5F5;
    border: 1px solid var(--secondary);
}

.owner-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #E0E0E0;
}

.owner-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.owner-label:hover {
    background: rgba(0,0,0,0.05);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 64px 16px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 18px;
}

.empty-state-small {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
}

/* ===== Project Detail ===== */
.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.project-title {
    font-size: 28px;
    font-weight: 700;
    flex: 1;
    min-width: 200px;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    padding: 4px 0;
}

.project-title:focus,
.project-title[contenteditable="true"] {
    border-bottom-color: var(--primary);
}

.edit-title-btn {
    font-size: 20px;
}

.status-select {
    padding: 8px 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: var(--card-bg);
    cursor: pointer;
    min-height: 44px;
}

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

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #E0E0E0;
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 44px;
}

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

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

.tab-content {
    display: none;
}

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

/* ===== Sections ===== */
.section {
    margin-bottom: 32px;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
}

/* ===== Cover Photo ===== */
.cover-photo {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.cover-photo img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

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

/* ===== Costs ===== */
.costs-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.costs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #E0E0E0;
}

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

.cost-label {
    font-size: 16px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 16px;
    font-weight: 600;
}

.cost-total .cost-label,
.cost-total .cost-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* ===== Tables ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: #F5F5F5;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-top: 1px solid #EEEEEE;
}

.data-table tr:hover {
    background: #FAFAFA;
}

.table-actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* ===== Hooks List ===== */
.hooks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hook-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    font-size: 14px;
}

.hook-item .hook-size {
    font-weight: 600;
}

.hook-item .hook-used-for {
    color: var(--text-secondary);
    font-size: 13px;
}

.hook-item .btn-icon {
    min-height: 32px;
    min-width: 32px;
    padding: 4px;
    font-size: 14px;
}

/* ===== Pattern ===== */
.upload-cta {
    text-align: center;
    padding: 48px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px dashed #E0E0E0;
}

.upload-cta p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.pattern-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.pattern-name {
    font-size: 16px;
    font-weight: 600;
}

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

/* ===== PDF Viewer ===== */
.pdf-viewer {
    margin-top: 16px;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 56px;
    z-index: 10;
}

.pdf-page-info,
.pdf-zoom-info {
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.pdf-canvas-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #E0E0E0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-align: center;
    padding: 16px;
    max-height: 75vh;
}

.pdf-canvas-wrapper canvas {
    display: inline-block;
}

/* ===== Notes ===== */
.notes-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font);
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--card-bg);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.notes-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal-overlay {
    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;
    padding: 16px;
    animation: fadeIn 0.2s;
}

.modal-overlay.keyboard-open {
    position: absolute;
    bottom: auto;
    min-height: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.2s;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-body {
    padding: 16px 24px;
}

.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font);
    transition: border-color 0.2s;
    background: var(--card-bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group .input-prefix {
    position: relative;
}

.form-group .input-prefix::before {
    content: attr(data-prefix);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.form-group .input-prefix input {
    padding-left: 28px;
}

/* ===== Stitch Counters ===== */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.counter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
}

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

.counter-name {
    font-size: 16px;
    font-weight: 600;
}

.counter-actions {
    display: flex;
    gap: 2px;
}

.counter-actions .btn-icon {
    min-height: 32px;
    min-width: 32px;
    padding: 4px;
    font-size: 14px;
}

.counter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.counter-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 700;
    background: #F5F5F5;
    color: var(--text);
    border: 2px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

.counter-btn:active {
    transform: scale(0.95);
}

.counter-value {
    font-size: 36px;
    font-weight: 700;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}

/* ===== Progress Timeline ===== */
.progress-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: relative;
}

.timeline-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-photo {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
    cursor: pointer;
}

.timeline-photo img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.timeline-photo:hover img {
    transform: scale(1.02);
}

.timeline-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
}

.timeline-delete {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-hover);
    animation: slideInRight 0.3s, fadeOut 0.3s 2.7s;
    max-width: 320px;
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: #2196F3; }

/* ===== Loading ===== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #E0E0E0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

/* ===== Confirm Dialog ===== */
.confirm-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 8px;
}

/* ===== Upload Button ===== */
.upload-btn {
    cursor: pointer;
}

/* ===== Mobile Bottom Sheet ===== */
@media (max-width: 767px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 85vh;
    }

    .header h1 {
        font-size: 20px;
    }

    .project-title {
        font-size: 24px;
    }

    .card-actions {
        opacity: 1;
    }

    .toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .toast {
        max-width: none;
    }

    /* Card-based tables on mobile */
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        background: none;
        box-shadow: none;
    }

    .data-table tr {
        background: var(--card-bg);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow);
        padding: 12px 16px;
        margin-bottom: 12px;
    }

    .data-table td {
        padding: 4px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 13px;
        color: var(--text-secondary);
        margin-right: 12px;
        flex-shrink: 0;
    }

    .data-table td:last-child {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid #EEE;
        margin-top: 4px;
    }

    .data-table td:last-child::before {
        display: none;
    }

    .table-responsive {
        overflow-x: visible;
    }
}

@media (min-width: 1025px) {
    .header h1 {
        font-size: 32px;
    }

    .container {
        padding: 24px;
    }
}
