/* ══════════════════════════════════════
   DG Atlas — Dark Theme (MVP Style)
   ══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #000000;
    --bg-card: #1a1a1a;
    --bg-card-alt: #0d0d0d;
    --bg-hover: #222222;
    --text-primary: #ffffff;
    --text-secondary: #666666;
    --text-muted: #444444;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-orange: #FF9800;
    --accent-red: #FF3B30;
    --accent-blue: #3B82F6;
    --accent-emerald: #10B981;
    --accent-purple: #8B5CF6;
    --accent-amber: #F59E0B;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    padding: 0;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    position: relative;
    z-index: 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
}

.screen {
    animation: fadeIn 0.3s ease-in;
}

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

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

.d-none {
    display: none !important;
}

/* ══════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════ */

#loginScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

#loginScreen .container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 380px;
}

/* Decorative rings */
.login-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.login-rings .ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.login-rings .ring:nth-child(1) { width: 400px; height: 400px; border-color: rgba(255,255,255,0.03); }
.login-rings .ring:nth-child(2) { width: 300px; height: 300px; border-color: rgba(255,255,255,0.04); }
.login-rings .ring:nth-child(3) { width: 200px; height: 200px; border-color: rgba(255,255,255,0.05); }

/* Logo area */
.login-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-logo-area.shifted {
    transform: translateY(-40px);
}

.login-logo-area.shifted .login-logo {
    transform: scale(0.85);
}

.login-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-brand {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 300;
    margin: 0;
}

/* Login form */
.login-form-area {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.login-form-area.visible {
    opacity: 1;
    transform: translateY(0);
}

.login-form-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 40px 0 8px;
}

.login-form-desc {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 300;
    text-align: center;
    margin: 0 0 24px;
}

.login-input {
    width: 100%;
    height: 56px;
    font-size: 18px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: #fff;
    outline: none;
    padding: 0 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    border-color: rgba(255, 255, 255, 0.2);
}

.login-error {
    color: var(--accent-red);
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
}

/* Slide to confirm */
.slide-to-confirm {
    position: relative;
    height: 64px;
    border-radius: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    margin-top: 16px;
}

.slide-to-confirm.disabled {
    opacity: 0.4;
}

.slide-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    pointer-events: none;
    transition: opacity 0.2s;
}

.slide-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.slide-spinner svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    animation: spin 1s linear infinite;
}

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

.slide-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10;
    touch-action: none;
}

.slide-thumb svg {
    width: 24px;
    height: 24px;
    color: #000;
}

.slide-thumb:active {
    cursor: grabbing;
}

/* ══════════════════════════════════════
   MAIN SCREEN
   ══════════════════════════════════════ */

#mainScreen {
    padding-top: 0;
}

#mainScreen .container {
    padding: 0 16px;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

.main-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.main-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-header-greeting {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 300;
    margin: 0;
}

.main-header-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.main-header-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.main-header-bell svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.main-header-bell .badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: var(--accent-red);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Hero Project Card */
.hero-card {
    margin: 8px 16px 20px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hero-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a, #111, #000);
}

/* Decorative circles */
.hero-card .deco-circle-outer {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-card .deco-circle-inner {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.hero-card-content {
    position: relative;
    z-index: 10;
    padding: 32px 24px 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 152, 0, 0.15);
    margin-bottom: 12px;
    width: fit-content;
}

.hero-stage-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-orange);
}

.hero-stage-badge span {
    color: var(--accent-orange);
    font-size: 11px;
    font-weight: 600;
}

.hero-project-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}

.hero-project-desc {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 300;
    margin: 0;
}

.hero-progress {
    margin-top: 24px;
}

.hero-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hero-progress-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.hero-progress-value {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.hero-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.hero-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #fff, #ccc);
    transition: width 0.7s ease;
}

.hero-roadmap-link {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.hero-roadmap-link svg {
    width: 14px;
    height: 14px;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 24px;
}

.stat-tile {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
}

.stat-tile.blue { background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.05)); }
.stat-tile.emerald { background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.05)); }
.stat-tile.purple { background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(139,92,246,0.05)); }
.stat-tile.amber { background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.05)); }

.stat-tile svg {
    width: 18px;
    height: 18px;
    margin: 0 auto 6px;
    display: block;
}

.stat-tile.blue svg { color: var(--accent-blue); }
.stat-tile.emerald svg { color: var(--accent-emerald); }
.stat-tile.purple svg { color: var(--accent-purple); }
.stat-tile.amber svg { color: var(--accent-amber); }

.stat-tile .stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.stat-tile .stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* "Ваш голос" banner */
.voice-banner {
    margin: 0 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.2s;
}

.voice-banner:active {
    background: var(--bg-hover);
}

.voice-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 152, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voice-banner-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-orange);
}

.voice-banner-text {
    flex: 1;
    min-width: 0;
}

.voice-banner-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0 0 2px;
}

.voice-banner-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 0;
}

.voice-banner-arrow svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Dark Menu Items */
.dark-menu {
    padding: 0 16px;
    margin-bottom: 24px;
}

.dark-menu-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 4px;
}

.dark-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dark-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.dark-menu-item:active {
    background: var(--bg-hover);
}

.dark-menu-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dark-menu-item-icon svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.dark-menu-item-text {
    flex: 1;
    min-width: 0;
}

.dark-menu-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
    margin: 0 0 2px;
}

.dark-menu-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 0;
}

.dark-menu-item-chevron svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   OTHER SCREENS — preserve Bootstrap look
   with dark overrides where needed
   ══════════════════════════════════════ */

/* Cards on other screens keep light theme via Bootstrap */
.card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
}

.card-body {
    padding: 20px;
}

.form-control {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
}

.form-control:focus {
    border-color: #000;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

.form-control:read-only {
    background-color: #f8f9fa;
}

.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-dark {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

.btn-dark:hover {
    background-color: #333;
    border-color: #333;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #dee2e6;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #000;
}

.alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.alert-danger {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background-color: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.text-muted {
    color: #6c757d !important;
}

.list-group-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    border-color: #000;
}

.list-group-item:last-child {
    margin-bottom: 0;
}

.list-group-item svg {
    color: #6c757d;
}

.list-group-item:hover svg {
    color: #000;
}

.btn-link {
    text-decoration: none;
    color: #000;
}

.btn-link:hover {
    color: #000;
    opacity: 0.7;
}

/* Documents styles */
.document-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.document-card svg {
    color: #6c757d;
}

.nav-pills .nav-link {
    border-radius: 8px;
    margin: 0 4px 4px 0;
    padding: 8px 12px;
    font-size: 14px;
    color: #6c757d;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.nav-pills .nav-link.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.form-select-sm {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 8px;
}

/* Project Card Styles */
.project-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #000000 0%, #333333 100%);
}

.project-card.active {
    border-color: #000000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.project-card.active:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.project-card.inactive {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
    opacity: 0.7;
    cursor: not-allowed;
}

.project-card.inactive::before {
    background: linear-gradient(180deg, #6c757d 0%, #adb5bd 100%);
}

.project-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin-bottom: 16px;
    line-height: 1.4;
}

.project-card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-info-label {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    min-width: 70px;
}

.project-info-value {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    flex: 1;
}

.project-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-badge.badge-category { background-color: #e3f2fd; color: #1976d2; }
.project-badge.badge-stage { background-color: #f3e5f5; color: #7b1fa2; }
.project-badge.badge-active { background-color: #e8f5e9; color: #2e7d32; }
.project-badge.badge-inactive { background-color: #fafafa; color: #757575; }

.project-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.project-card-icon svg { color: white; }

.project-card.inactive .project-card-icon {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

/* Project Detail Styles */
.project-detail-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.project-detail-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-detail-info {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.project-detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.project-detail-label {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.project-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    text-align: right;
}

/* Request Styles */
.white-space-pre-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge.bg-warning { background-color: #fff3cd !important; color: #856404 !important; }
.badge.bg-info { background-color: #d1ecf1 !important; color: #0c5460 !important; }
.badge.bg-success { background-color: #d4edda !important; color: #155724 !important; }
.badge.bg-danger { background-color: #f8d7da !important; color: #721c24 !important; }
.badge.bg-secondary { background-color: #e2e3e5 !important; color: #383d41 !important; }

#attachmentsList .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

#requestsList .card {
    transition: all 0.2s ease;
}

#requestsList .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #000;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

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

/* Camera View Styles */
#cameraViewScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    padding: 0 !important;
    margin: 0 !important;
    animation: none !important;
}

.camera-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
}

.camera-view-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 28px 20px 16px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 10001;
}

.camera-back-btn {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.camera-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.camera-view-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.camera-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000;
}

.camera-external-link-btn {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.camera-external-link-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.camera-external-link-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .camera-external-link-btn {
        width: 48px;
        height: 48px;
        bottom: 40px;
        right: 16px;
    }

    .camera-external-link-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ══════════════════════════════════════
   STAGES / STATUSES SCREEN
   ══════════════════════════════════════ */

#statusesScreen {
    background-color: #000 !important;
    min-height: 100vh;
    padding-top: 0 !important;
}

#statusesScreen .container {
    padding: 0;
}

#statusesScreen .card {
    background: none;
    border: none;
    box-shadow: none;
}

#statusesScreen .card-header {
    display: none;
}

#statusesScreen .card-body {
    padding: 0;
}

/* Stages header */
.stages-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 16px;
}

.stages-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.stages-back-btn:active {
    background: var(--bg-hover);
}

.stages-back-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.stages-header-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
}

.stages-header-text p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 2px 0 0;
}

/* Infographic summary card */
.stages-summary {
    margin: 0 16px 24px;
    padding: 20px;
    border-radius: 24px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.stages-summary-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Circular progress ring */
.stages-ring {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
}

.stages-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stages-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}

.stages-ring .ring-fill {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.stages-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

/* Summary stats */
.stages-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stages-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stages-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stages-stat-icon.green { background: rgba(76, 217, 100, 0.1); }
.stages-stat-icon.orange { background: rgba(255, 152, 0, 0.1); }
.stages-stat-icon.gray { background: rgba(255, 255, 255, 0.06); }

.stages-stat-icon svg {
    width: 16px;
    height: 16px;
}

.stages-stat-icon.green svg { color: #4cd964; }
.stages-stat-icon.orange svg { color: #FF9800; }
.stages-stat-icon.gray svg { color: #555; }

.stages-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
}

.stages-stat-label {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 0;
}

/* Summary progress bar */
.stages-summary-bar {
    margin-top: 20px;
}

.stages-summary-bar .bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.stages-summary-bar .bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #fff, #999);
    transition: width 0.7s ease;
}

.stages-summary-bar .bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: #555;
}

/* Timeline */
.stages-timeline {
    padding: 0 16px 32px;
}

.stage-item {
    display: flex;
    gap: 16px;
}

/* Timeline dot + line */
.stage-timeline-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
    flex-shrink: 0;
}

.stage-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.stage-dot.completed {
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.stage-dot.active {
    background: rgba(255, 152, 0, 0.15);
    border: 2px solid #FF9800;
    box-shadow: 0 0 16px rgba(255, 152, 0, 0.2);
}

.stage-dot.upcoming {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.stage-dot svg {
    width: 20px;
    height: 20px;
}

.stage-dot.completed svg { color: #000; }

.stage-dot-number {
    font-size: 12px;
    font-weight: 700;
}

.stage-dot.active .stage-dot-number { color: #FF9800; }
.stage-dot.upcoming .stage-dot-number { color: #555; }

.stage-line {
    width: 2px;
    flex: 1;
}

.stage-line.completed {
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
}

.stage-line.active {
    background: linear-gradient(to bottom, rgba(255,152,0,0.3), rgba(255,255,255,0.04));
}

.stage-line.upcoming {
    background: rgba(255, 255, 255, 0.04);
}

/* Stage content */
.stage-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 20px;
}

.stage-content.upcoming {
    opacity: 0.4;
}

.stage-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 8px;
    margin-bottom: 8px;
}

.stage-title {
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.stage-title.active {
    color: #fff;
    font-size: 17px;
}

.stage-title.completed {
    color: #fff;
    font-size: 15px;
}

.stage-title.upcoming-text {
    color: var(--text-secondary);
    font-size: 15px;
}

.stage-desc {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 2px 0 0;
}

.stage-badge {
    flex-shrink: 0;
    margin-left: 12px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.stage-badge.done {
    background: rgba(76, 217, 100, 0.1);
    color: #4cd964;
}

.stage-badge.now {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

/* Stage photo card */
.stage-photo {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.stage-photo.active-photo {
    height: 240px;
}

.stage-photo.completed-photo {
    height: 240px;
}

.stage-photo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
}

.stage-photo-gradient {
    position: absolute;
    inset: 0;
}

.stage-photo-gradient.active-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2), transparent);
}

.stage-photo-gradient.completed-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

/* Active stage progress inside photo */
.stage-photo-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
}

.stage-photo-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stage-photo-progress-label {
    font-size: 11px;
    font-weight: 500;
    color: #FF9800;
}

.stage-photo-progress-value {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.stage-photo-progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.stage-photo-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #FF9800, #FFB74D);
    transition: width 0.5s ease;
}

/* ── Sub-stages ── */
.substages-info {
    margin-top: 10px;
}

.substages-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.substages-counter {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

.substages-minibar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.substages-minibar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #fff 0%, #999 100%);
    transition: width 0.5s ease;
}

.substages-percent {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.substages-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.substages-toggle:active {
    background: rgba(255,255,255,0.08);
}

.substages-toggle-text {
    color: inherit;
}

.substages-toggle-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.substages-toggle.open .substages-toggle-arrow {
    transform: rotate(180deg);
}

.substages-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
}

.substages-panel.open {
    max-height: 600px;
    opacity: 1;
    margin-top: 10px;
}

.substage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.substage-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.substage-item.done .substage-dot {
    background: rgba(76, 217, 100, 0.15);
}

.substage-item.done .substage-dot svg {
    width: 12px;
    height: 12px;
    color: #4cd964;
}

.substage-item.current .substage-dot {
    background: rgba(255, 152, 0, 0.15);
    border: 1.5px solid #FF9800;
}

.substage-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF9800;
    animation: substage-pulse 1.5s infinite;
}

@keyframes substage-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.substage-item.pending .substage-dot {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.substage-name {
    font-size: 13px;
    color: #666;
}

.substage-item.done .substage-name {
    color: #999;
}

.substage-item.current .substage-name {
    color: #fff;
    font-weight: 500;
}

/* Other screens need white bg for readability */
#profileScreen,
#projectsScreen,
#projectDetailScreen,
#documentsScreen,
#requestsScreen,
#createRequestScreen,
#requestDetailScreen,
#chatsScreen,
#managerChatsScreen,
#managerChatDetailScreen,
#managerClientsScreen,
#managerClientDetailScreen,
#faqScreen,
#partnersScreen {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding-top: 20px;
}
