/**
 * Final Countdown — ελάχιστα brand overrides πάνω από Velzon
 */
:root {
    --fc-brand-navy: #1e3a5f;
    --fc-brand-teal: #2dd4bf;
    --fc-sidebar-bg: var(--fc-brand-navy);
    --fc-sidebar-border: var(--fc-brand-navy);
    --fc-sidebar-item-color: #b8cfe0;
    --fc-sidebar-item-hover-color: #ffffff;
    --fc-sidebar-title-color: rgba(255, 255, 255, 0.55);
}

[data-bs-theme="dark"] {
    --fc-sidebar-bg: #0b1220;
    --fc-sidebar-border: #162032;
    --fc-sidebar-item-color: #94a3b8;
    --fc-sidebar-item-hover-color: #f1f5f9;
    --fc-sidebar-title-color: #64748b;
}

:root[data-sidebar="dark"] {
    --vz-vertical-menu-bg: var(--fc-sidebar-bg);
    --vz-vertical-menu-border: var(--fc-sidebar-border);
    --vz-vertical-menu-item-color: var(--fc-sidebar-item-color);
    --vz-vertical-menu-item-hover-color: var(--fc-sidebar-item-hover-color);
    --vz-vertical-menu-item-active-color: var(--fc-brand-teal);
    --vz-vertical-menu-sub-item-color: var(--fc-sidebar-item-color);
    --vz-vertical-menu-sub-item-hover-color: var(--fc-sidebar-item-hover-color);
    --vz-vertical-menu-sub-item-active-color: var(--fc-brand-teal);
    --vz-vertical-menu-title-color: var(--fc-sidebar-title-color);
}

[data-bs-theme="dark"][data-sidebar="dark"] {
    --vz-vertical-menu-bg: var(--fc-sidebar-bg);
    --vz-vertical-menu-border: var(--fc-sidebar-border);
    --vz-vertical-menu-item-color: var(--fc-sidebar-item-color);
    --vz-vertical-menu-item-hover-color: var(--fc-sidebar-item-hover-color);
    --vz-vertical-menu-item-active-color: var(--fc-brand-teal);
    --vz-vertical-menu-sub-item-color: var(--fc-sidebar-item-color);
    --vz-vertical-menu-sub-item-hover-color: var(--fc-sidebar-item-hover-color);
    --vz-vertical-menu-sub-item-active-color: var(--fc-brand-teal);
    --vz-vertical-menu-title-color: var(--fc-sidebar-title-color);
}

.navbar-menu .navbar-nav .nav-link.active {
    color: #ffffff !important;
}

/* Ενεργό στοιχείο sidebar — bold + διακριτικό background */
#navbar-nav .nav-link.menu-link {
    margin: 0.1rem 0.5rem;
    border-radius: 0.4rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#navbar-nav .nav-link.menu-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--fc-sidebar-item-hover-color) !important;
}

#navbar-nav .nav-link.menu-link.active {
    font-weight: 600;
    color: #ffffff !important;
    background-color: rgba(45, 212, 191, 0.18);
    box-shadow: inset 3px 0 0 var(--fc-brand-teal);
}

#navbar-nav .nav-link.menu-link.active i {
    color: var(--fc-brand-teal) !important;
}

#navbar-nav .nav-link.menu-link.active span {
    font-weight: 600;
}

.bg-primary,
.dropdown-head.bg-primary {
    background-color: var(--fc-brand-navy) !important;
}

.btn-primary {
    background-color: var(--fc-brand-navy);
    border-color: var(--fc-brand-navy);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #162d4a;
    border-color: #162d4a;
}

.logo-lg span {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* Profile — Disney avatar picker */
.profile-avatar-preview-btn {
    position: relative;
    border-radius: 50%;
    line-height: 0;
}

.profile-avatar-preview-btn:hover .profile-avatar-preview-overlay,
.profile-avatar-preview-btn:focus-visible .profile-avatar-preview-overlay {
    opacity: 1;
}

.profile-avatar-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.profile-avatar-preview-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid var(--vz-border-color);
    background-color: var(--vz-light);
}

#profile-avatar-modal-preview.profile-avatar-preview-img {
    width: 96px;
    height: 96px;
}

.profile-avatar-character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.75rem;
    min-height: 6rem;
}

.profile-avatar-character-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.4rem;
    border: 1px solid var(--vz-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    background: transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-avatar-character-option img {
    border-radius: 50%;
    background-color: var(--vz-light);
    object-fit: cover;
}

.profile-avatar-character-option span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--vz-secondary-color);
}

.profile-avatar-character-option.is-active,
.profile-avatar-character-option:hover {
    border-color: var(--fc-brand-teal);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35);
}

.topbar-user .user-avatar-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

/* Project view — embedded Velzon chat */
.project-chat-panel.user-chat {
    background-color: var(--vz-body-bg);
    border-radius: 0 0 0.25rem 0.25rem;
}

.project-chat-panel .chat-conversation.project-chat-conversation {
    height: auto;
    max-height: 420px;
    min-height: 220px;
    overflow-y: auto;
}

.project-chat-panel .chat-conversation-list > li.chat-list {
    display: flex;
    width: 100%;
}

.project-chat-panel .chat-input textarea.chat-input {
    resize: none;
    min-height: 42px;
    max-height: 120px;
}

.project-chat-panel .chat-send {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-chat-panel .chat-send i {
    font-size: 1.1rem;
    line-height: 1;
}

.project-chat-panel .project-chat-image-preview {
    max-width: 220px;
    max-height: 180px;
    object-fit: cover;
}

.project-chat-panel .btn-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.project-chat-panel .chat-list.is-deleted .ctext-wrap-content {
    background-color: var(--vz-light) !important;
    box-shadow: none;
}

.project-chat-panel .message-box-drop .dropdown-toggle::after {
    display: none;
}

/* Sidebar — ενότητα «Σύστημα» (primary admin tools) */
#navbar-nav .menu-title--system {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #fbbf24;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#navbar-nav .nav-link.menu-link--system {
    font-size: 0.9rem;
    opacity: 0.95;
    border-left: 2px solid transparent;
    margin-left: 0.25rem;
    padding-left: calc(1.1rem - 2px);
    border-radius: 0 0.35rem 0.35rem 0;
}

#navbar-nav .nav-link.menu-link--system:hover,
#navbar-nav .nav-link.menu-link--system:focus {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--fc-sidebar-item-hover-color);
}

#navbar-nav .nav-link.menu-link--system.active {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.16);
    box-shadow: inset 3px 0 0 #f59e0b;
    color: #ffffff !important;
    font-weight: 600;
}

#navbar-nav .nav-link.menu-link--system i {
    color: #fbbf24;
}

/* Φ22 — Mobile & PWA polish */
@media (max-width: 991.98px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    #layout-wrapper,
    .main-content,
    .page-content,
    .container-fluid {
        max-width: 100%;
        overflow-x: clip;
    }

    /* Velzon overlay uses 100vw — causes horizontal scroll on mobile */
    .vertical-overlay {
        width: 100% !important;
        max-width: 100%;
        left: 0 !important;
        right: 0 !important;
    }

    .page-title-box {
        margin-left: 0;
        margin-right: 0;
    }

    .main-content {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #page-topbar .navbar-header {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0));
    }

    .navbar-menu {
        padding-top: env(safe-area-inset-top, 0);
    }

    #navbar-nav .nav-link.menu-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .project-chat-panel .chat-input-section {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background-color: var(--vz-body-bg);
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0));
    }

    .project-chat-panel .chat-conversation.project-chat-conversation {
        max-height: min(55vh, 420px);
    }

    .project-chat-panel .chat-send,
    .project-chat-panel .btn-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .project-chat-panel .chat-input textarea.chat-input,
    .project-chat-panel .form-control.chat-input {
        font-size: 16px;
        min-height: 44px;
    }

    .topbar-user .btn {
        min-height: 44px;
    }

    .btn-topbar {
        min-width: 44px;
        min-height: 44px;
    }

    .project-chat-panel .chat-input-section .col {
        min-width: 0;
    }

    .project-chat-panel .chat-input-section .row {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 575.98px) {
    .project-chat-panel .chat-input-section .row {
        --bs-gutter-x: 0.35rem;
    }
}

/* Login — touch-friendly inputs (iOS zoom prevention) */
.fc-auth-form .form-control,
.login-page .form-control,
body.bg-light .card .form-control {
    font-size: 16px;
    min-height: 44px;
}

body.bg-light .card .btn-primary {
    min-height: 44px;
}

.fc-trusted-device-check .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
}

/* Φ22.1 — project list cards (Velzon apps-projects-list) */
.project-card .card,
.account-card .card {
    transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.fc-entity-card {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 0.125rem 0.35rem rgba(15, 23, 42, 0.06);
}

.fc-entity-card .fc-entity-card-footer {
    border-top-color: rgba(15, 23, 42, 0.08) !important;
}

.project-card .fc-entity-card:hover,
.account-card .fc-entity-card:hover {
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.fc-category-color-swatch.ring-active {
    outline: 2px solid var(--fc-brand-navy);
    outline-offset: 2px;
}

.fc-category-color-preview {
    min-height: 3.5rem;
}

.project-card .card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.08);
}

.project-card .fc-project-card-menu {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-card .dropdown-item {
    min-height: 40px;
    display: flex;
    align-items: center;
}

.project-card .fc-project-card-members {
    line-height: 1.4;
    word-break: break-word;
}

.project-card .fc-project-card-member-name {
    white-space: normal;
}

@media (max-width: 575.98px) {
    .project-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Φ22.2 — project overview hero (Velzon apps-projects-overview) */
.fc-project-overview-hero {
    border: 0;
    box-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.04);
}

.fc-project-overview-hero .nav-tabs-custom .nav-link {
    cursor: pointer;
}

/* Project view — μία κάρτα/ενότητα τη φορά (hero nav) */
.fc-project-view-panels {
    margin-top: 0.25rem;
}

.fc-project-panel {
    display: none !important;
}

.fc-project-panel.is-active {
    display: block !important;
    animation: fc-project-panel-in 0.22s ease-out;
}

.fc-project-overview-hero .nav-tabs-custom button.nav-link {
    border: 0;
    background: transparent;
}

.fc-project-panel.is-active > .card,
.fc-project-panel.is-active > .card.mt-3 {
    margin-top: 0 !important;
}

@keyframes fc-project-panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fc-project-panel .project-chat-panel .chat-conversation.project-chat-conversation {
    max-height: 65vh;
    min-height: 280px;
}

.fc-fin-expand-icon.is-open {
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.15s ease;
}

.fc-fin-expand-icon {
    transition: transform 0.15s ease;
}

#project-payments-section .table td {
    vertical-align: middle;
}

.fc-project-overview-hero .hstack .vr {
    min-height: 1rem;
    opacity: 0.35;
}

.fc-project-overview-notes {
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .fc-project-overview-hero {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
    }

    .fc-project-overview-hero .card-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Φ22.3 / Φ34 — project tasks todo table */
.fc-project-task-order {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    line-height: 1;
}

.fc-project-task-order .btn {
    min-width: 28px;
    min-height: 24px;
    line-height: 1;
}

.fc-project-tasks-table .btn-sm {
    min-width: 36px;
    min-height: 36px;
}

/* Φ34 — nested project tasks */
.fc-project-task-title-wrap {
    min-width: 0;
}

.fc-project-task-children-progress {
    font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
    .fc-project-tasks-table thead {
        display: none;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item {
        display: block;
        border-bottom: 1px solid var(--vz-border-color, #e9ebec);
        padding: 0.75rem 0;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        border: 0;
        padding: 0.35rem 0;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--vz-secondary-color, #878a99);
        min-width: 6.5rem;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item td[data-label="Εργασία"] {
        display: block;
        padding-bottom: 0.5rem;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item td[data-label="Εργασία"]::before {
        display: none;
    }

    .fc-project-tasks-table tbody tr.js-project-task-item td[data-label="Ενέργειες"]::before {
        display: none;
    }

    .fc-project-tasks-table tbody tr.js-project-tasks-empty-row td {
        display: table-cell;
    }
}

/* Φ23.2 — Quill rich notes modal + read-only display */
.fc-rich-notes-display,
.fc-project-task-notes-display {
    line-height: 1.5;
    word-break: break-word;
}

.fc-project-task-notes-display {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-rich-notes-modal-editor .ql-container {
    min-height: 180px;
    font-size: 0.9375rem;
}

.fc-rich-notes-modal-editor .ql-editor {
    min-height: 180px;
}

.fc-rich-notes-modal-editor .ql-toolbar.ql-snow {
    border-radius: 0.25rem 0.25rem 0 0;
    flex-wrap: wrap;
}

.fc-rich-notes-modal-editor .ql-container.ql-snow {
    border-radius: 0 0 0.25rem 0.25rem;
}

@media (max-width: 575.98px) {
    .fc-rich-notes-modal-editor .ql-toolbar.ql-snow {
        padding: 0.35rem;
    }

    .fc-rich-notes-modal-editor .ql-toolbar.ql-snow .ql-formats {
        margin-right: 0.35rem;
    }
}
