/* ===========================================
   Clair de Lune Illustrate - /create2 Styles
   Brand colour: #c99c9d
   =========================================== */

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

/* ---- Login Page ---- */
.login-page {
    background: #c99c9d;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-header {
    background: #c99c9d;
    padding: 2rem;
    text-align: center;
    color: #fff;
}

.login-header h1 {
    font-weight: 300;
    font-size: 1.6rem;
    margin-top: 0.5rem;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.login-logo {
    max-width: 180px;
    height: auto;
}

.login-body {
    padding: 2rem;
}

.login-instruction {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.login-success {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d4edda;
    color: #28a745;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.login-success h3 {
    color: #333;
    margin-bottom: 0.75rem;
}

.login-success p {
    color: #666;
    margin-bottom: 0.5rem;
}

.order-note {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin-top: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #c99c9d;
    box-shadow: 0 0 0 3px rgba(201,156,157,0.15);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .help-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

/* ---- Buttons ---- */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #c99c9d;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #b88b8c;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 2px solid #c99c9d;
    color: #c99c9d;
}

.btn-outline:hover:not(:disabled) {
    background: #c99c9d;
    color: #fff;
}

.btn-full {
    width: 100%;
}

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

/* ---- Alerts ---- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

/* ---- Dashboard Layout ---- */
.app-header {
    background: #c99c9d;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-header .logo {
    height: 40px;
}

.app-header .nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-header .nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s;
}

.app-header .nav-links a:hover {
    color: #fff;
}

.app-header .user-email {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ---- Project Cards ---- */
.project-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.project-card-header {
    background: #fafafa;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card-header h3 {
    font-weight: 500;
    font-size: 1.1rem;
    color: #333;
}

.project-card-body {
    padding: 1.5rem;
}

.project-card-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---- Status Timeline ---- */
.status-timeline {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 0;
    overflow-x: auto;
}

.status-step {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
}

.status-step .step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.status-step .step-line {
    width: 30px;
    height: 2px;
    background: #ddd;
    margin: 0 0.4rem;
    flex-shrink: 0;
}

.status-step.completed .step-dot {
    background: #28a745;
}

.status-step.completed .step-line {
    background: #28a745;
}

.status-step.completed {
    color: #28a745;
}

.status-step.active .step-dot {
    background: #c99c9d;
    box-shadow: 0 0 0 3px rgba(201,156,157,0.3);
}

.status-step.active {
    color: #c99c9d;
    font-weight: 500;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-setup { background: #d1ecf1; color: #0c5460; }
.badge-customising { background: #cce5ff; color: #004085; }
.badge-submitted { background: #e8daef; color: #6c3483; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-production { background: #ffeaa7; color: #856404; }
.badge-completed { background: #d4edda; color: #155724; }

/* ---- Progress Info ---- */
.progress-info {
    display: flex;
    gap: 1.5rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.progress-info .info-item {
    font-size: 0.85rem;
    color: #666;
}

.progress-info .info-item strong {
    color: #333;
}

.progress-bar-track {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #c99c9d;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ---- Proofs Grid ---- */
.proofs-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}

.proofs-section h4 {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.proofs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.proof-thumb {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.proof-thumb:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.proof-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.proof-thumb .proof-meta {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: #888;
    background: #fafafa;
}

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

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

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.empty-state p {
    color: #888;
    margin-bottom: 1.5rem;
}

/* ---- Setup Wizard ---- */
.progress-steps {
    display: flex;
    justify-content: space-around;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.progress-step-item {
    text-align: center;
    flex: 1;
    padding: 0.5rem;
    color: #aaa;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
}

.progress-step-item.active {
    color: #c99c9d;
    border-bottom: 3px solid #c99c9d;
}

.progress-step-item.completed {
    color: #28a745;
}

.setup-card {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
}

.stage {
    display: none;
}

.stage.active {
    display: block;
}

.stage h2 {
    color: #333;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.stage-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.stage-navigation button {
    flex: 1;
}

.table-input-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 2px solid #c99c9d;
}

.table-input-group h3 {
    color: #c99c9d;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ---- Colour Pickers ---- */
.colour-picker-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.colour-picker-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.colour-picker-group input[type="text"] {
    flex: 1;
}

.colour-picker-group label {
    font-weight: 500;
    min-width: 70px;
    font-size: 0.9rem;
}

/* ---- File Upload ---- */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover {
    border-color: #c99c9d;
    background: #fdf9f9;
}

.file-upload-area input[type="file"] {
    display: none;
}

.file-upload-area .upload-label {
    cursor: pointer;
    color: #c99c9d;
    font-weight: 500;
}

/* ---- Review Summary ---- */
.summary-section {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #c99c9d;
}

.summary-section h3,
.summary-section h4 {
    color: #c99c9d;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.summary-section p {
    margin-bottom: 0.4rem;
}

.summary-section ul {
    margin-left: 1.25rem;
    margin-top: 0.4rem;
}

.colour-box {
    display: inline-block;
    width: 25px;
    height: 25px;
    border: 2px solid #ddd;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* ---- Admin Tabs ---- */
.admin-tabs {
    display: flex;
    background: #fff;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #eee;
    overflow-x: auto;
}

.admin-tab {
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: #888;
    border: none;
    background: none;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.admin-tab:hover {
    color: #333;
}

.admin-tab.active {
    color: #c99c9d;
    border-bottom-color: #c99c9d;
}

.admin-tab-content {
    display: none;
    background: #fff;
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

/* ---- Admin Tables ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem;
    background: #f8f9fa;
    color: #555;
    font-weight: 500;
    border-bottom: 2px solid #eee;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

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

/* ---- Asset Picker (Admin Defaults) ---- */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 6px;
}

.asset-item {
    border: 2px solid #eee;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.asset-item:hover {
    border-color: #c99c9d;
}

.asset-item.selected {
    border-color: #c99c9d;
    background: #fdf9f9;
    box-shadow: 0 0 0 2px rgba(201,156,157,0.3);
}

.asset-item img {
    width: 100%;
    height: auto;
    display: block;
}

.asset-item .asset-name {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Config Preview ---- */
.config-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.config-preview .preview-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.75rem;
}

.config-preview svg {
    max-width: 200px;
    margin: 0 auto;
}

/* ---- Lightbox / Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0.25rem;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---- Customise Page ---- */
.customise-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
}

.customise-nav {
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customise-nav a {
    color: #c99c9d;
    text-decoration: none;
    font-size: 0.9rem;
}

.customise-iframe {
    flex: 1;
    border: none;
    width: 100%;
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }

    .app-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .app-header .logo {
        height: 30px;
    }

    .project-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-card-actions {
        flex-direction: column;
    }

    .project-card-actions .btn {
        width: 100%;
    }

    .status-timeline {
        flex-wrap: wrap;
    }

    .progress-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .setup-card {
        padding: 1.25rem;
    }

    .stage-navigation {
        flex-direction: column;
    }

    .login-body {
        padding: 1.5rem;
    }

    .admin-pipeline {
        min-width: 100px;
    }
}

/* ---- Admin Progress Pipeline ---- */
.admin-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
}

.pipeline-step {
    display: flex;
    align-items: center;
}

.pipeline-step .pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    flex-shrink: 0;
}

.pipeline-step .pip-line {
    width: 8px;
    height: 2px;
    background: #ddd;
    flex-shrink: 0;
}

.pipeline-step.done .pip {
    background: #28a745;
}

.pipeline-step.done .pip-line {
    background: #28a745;
}

.pipeline-step.active .pip {
    background: #c99c9d;
    box-shadow: 0 0 0 3px rgba(201,156,157,0.3);
}

.pipeline-label {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    line-height: 1.3;
}

.status-select {
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.75rem;
    width: 100%;
    max-width: 170px;
    background: #fff;
}

/* ---- Link 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;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}
