@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --ttnda-primary: #2c3e80;
    --ttnda-primary-rgb: 44, 62, 128;
    --ttnda-primary-dark: #1a2754;
    --ttnda-accent: #d97706;
    --ttnda-bg: #f3f4f6;
    --ttnda-sidebar-bg: #0f2754;
    --ttnda-sidebar-active: #2e3863;
    --ttnda-surface: #ffffff;
    --ttnda-text: #1f2937;
    --ttnda-text-muted: #6b7280;
    --ttnda-text-sidebar: #e5e7eb;
    --ttnda-border: #e5e7eb;
    --ttnda-input-card-border: #929bad;
    --dash-card-bg: #ffffff;
    --dash-card-border: #f1f5f9;
    --dash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --dash-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --sidebar-width: 300px;
    --topbar-height: 64px;
    --context-sidebar-width: 320px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--ttnda-bg);
    color: var(--ttnda-text);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero-welcome,
.stat-value,
.fw-bold {
    font-family: 'Poppins', sans-serif;
}


a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

table th {
    font-size: 12px;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

table td {
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
}

.text-primary {
    color: var(--ttnda-primary) !important;
}

.bg-primary {
    background-color: var(--ttnda-primary) !important;
}

.btn-primary {
    background-color: var(--ttnda-primary);
    border-color: var(--ttnda-primary);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: var(--ttnda-primary-dark);
    border-color: var(--ttnda-primary-dark);
}

.btn-outline-primary {
    color: var(--ttnda-primary);
    border-color: var(--ttnda-primary);
}

.btn-outline-primary:hover {
    background-color: var(--ttnda-primary);
    color: white;
}

.step-content .form-input-card:last-child {
    margin-bottom: 0;
}

.form-input-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 1);
    border-radius: 12px;
    padding: 16px 16px 14px;
    margin-bottom: 1rem;
    transition: box-shadow .2s ease, border-color .2s ease;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .05),
        0 8px 18px rgba(15, 23, 42, .07);
    margin-top: 1.5rem;
}

.form-section-title {
    font-weight: 600;
    color: var(--ttnda-primary);
    font-size: 0.95rem;
    background-color: #fff;
    padding: 5px 10px;
    position: absolute;
    top: -15px;
    left: 12px;
    display: inline-block;
    z-index: 10;
    margin: 0;
    border: 1px solid var(--ttnda-input-card-border);
    border-radius: 5px;
    box-shadow: none;
}

.form-section-title i {
    margin-right: 5px;
    font-size: 1rem;
    /* color: var(--ttnda-accent); */
}

.form-control,
.form-select {
    border-color: var(--ttnda-border);
    padding: 0.3rem 0.6rem;
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ttnda-primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 128, 0.15);
}

.form-label {
    font-size: 13px;
    margin: 0;
}

.fhn-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--ttnda-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: var(--ttnda-text-sidebar);
    transition: transform 0.3s ease;
}

.fhn-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.fhn-topbar {
    height: var(--topbar-height);
    background-color: var(--ttnda-surface);
    border-bottom: 1px solid var(--ttnda-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.fhn-content {
    padding: 1rem;
    flex-grow: 1;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-block {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.user-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-weight: 400;
    cursor: pointer;
}

.sidebar-badge,
.notif-badge {
    margin-left: auto;
    margin-right: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    background-color: var(--ttnda-sidebar-active);
    color: white;
    border-left-color: var(--ttnda-accent);
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 5px;
    text-align: center;
}

.sidebar-submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar-submenu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: transparent;
    border-left-color: var(--ttnda-accent);
}

.sidebar-caret {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}

.nav-link[aria-expanded="true"] .sidebar-caret {
    transform: rotate(180deg);
}

.nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: none !important;
}

.project-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.context-sidebar {
    height: calc(100vh - var(--topbar-height) - 2rem);
    width: var(--context-sidebar-width);
    background: var(--ttnda-surface);
    border: 1px solid var(--ttnda-border);
    border-radius: 12px;
    flex-shrink: 0;
    position: sticky;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border: 1px solid var(--ttnda-border);
}

.main-stage {
    height: calc(100vh - var(--topbar-height) - 2rem);
    border: 1px solid var(--ttnda-border);
    border-radius: 12px;
    padding: 0.5rem;
    flex-grow: 1;
    min-width: 0;
    background: var(--ttnda-surface);
    overflow-y: auto;
}

.card-app {
    background: var(--ttnda-surface);
    border-radius: 12px;
    transition: all 0.2s;
}

.quick-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--ttnda-border);
    text-decoration: none;
    color: var(--ttnda-text);
    transition: all 0.2s;
}

.quick-card:hover {
    border-color: var(--ttnda-primary);
}

.quick-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--ttnda-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.quick-card-action {
    margin-left: auto;
    color: var(--ttnda-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* dashboard */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
}

.hero-section {
    background: var(--ttnda-sidebar-bg);
    border-radius: 24px;
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(44, 62, 128, 0.2), 0 10px 10px -5px rgba(44, 62, 128, 0.1);
    margin-bottom: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-welcome h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-date {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card-modern {
    background: var(--dash-card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--dash-card-border);
    box-shadow: var(--dash-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--dash-shadow-hover);
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.stat-card-modern:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    background: #ecfdf5;
    color: #059669;
}

.trend-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.action-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--dash-card-border);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--ttnda-text);
}

.action-card:hover {
    border-color: var(--ttnda-primary);
    background: #f8fafc;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--ttnda-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.activity-feed {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--dash-shadow);
    height: 100%;
}

.feed-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.feed-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 48px;
    bottom: 0;
    width: 2px;
    background: #f1f5f9;
}

.feed-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ttnda-text-muted);
    z-index: 1;
}

.feed-item.active .feed-icon {
    background: var(--ttnda-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(44, 62, 128, 0.1);
}

.widget-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--dash-card-border);
    margin-bottom: 1.5rem;
    box-shadow: var(--dash-shadow);
}

.glass-card {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.glass-card .btn-glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(4px);
}

.glass-card .btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
}

.section-title-chart {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-type-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.75rem;
    background: rgba(44, 62, 128, 0.08);
    color: var(--ttnda-primary);
    padding: 4px 8px;
    border-radius: 100px;
    font-weight: 600;
}

.project-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.status--draft {
    color: #6c757d;
}

.status--draft .project-status-dot {
    background-color: #6c757d;
}

.status--submitted {
    color: #d97706;
}

.status--submitted .project-status-dot {
    background-color: #d97706;
}

.status--approved {
    color: #059669;
}

.status--approved .project-status-dot {
    background-color: #059669;
}

.status--review {
    color: #2563eb;
}

.status--review .project-status-dot {
    background-color: #2563eb;
}

.search-pill {
    border-radius: 50px;
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 1rem center;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.6rem;
    color: var(--ttnda-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: 1px solid var(--ttnda-border);
}

.service-item:hover {
    background-color: #eff6ff;
    color: var(--ttnda-primary);
}

.service-item i {
    color: var(--ttnda-text-muted);
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

.service-item.active {
    background-color: #eff6ff;
    color: var(--ttnda-primary);
    font-weight: 600;
}

.service-item.active i {
    color: var(--ttnda-primary);
}

.service-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.service-name{
    line-height: 25px;
}

.service-count-box{
    background-color: #d0def1;
    width: 25px;
    height: 25px;
    min-width: 25px;
    display: flex;
    flex: 0 0 25px;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    color: var(--ttnda-primary);
}

.service-item.active .service-count-box{
    background-color: var(--ttnda-primary);
    color: white;
}

.service-count {
    font-size: 0.75rem;
    font-weight: 600;
}

.fhn-timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--ttnda-border);
}

.timeline-card-body {
    max-height: calc(100vh - var(--topbar-height) - 6rem);
    overflow-y: auto;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ttnda-surface);
    border: 2px solid var(--ttnda-text-muted);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item.active .timeline-marker {
    background: var(--ttnda-primary);
    border-color: var(--ttnda-primary);
}

.timeline-item.completed .timeline-marker {
    background: #059669;
    border-color: #059669;
}

.context-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.context-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ttnda-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.context-tab-btn:hover {
    color: var(--ttnda-text);
}

.context-tab-btn.active {
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: var(--ttnda-primary);
    font-weight: 600;
}

.doc-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--ttnda-border);
    border-radius: 8px;
    background: white;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.doc-item:hover {
    border-color: var(--ttnda-primary);
}

.doc-icon {
    width: 36px;
    height: 36px;
    background: #f8fafc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ttnda-text-muted);
    margin-right: 0.75rem;
}

.notif-card {
    background: white;
    border-left: 3px solid transparent;
    transition: background 0.2s;
}

.notif-card.unread {
    background: #f0f9ff;
    border-left-color: var(--ttnda-primary);
}

.notif-badge {
    background: #ef4444;
    color: white;
}

.topbar-btn {
    width: 40px;
    height: 40px;
}

.sidebar-logo-img {
    height: 40px;
    width: auto;
}

.agency-text {
    font-size: 13px;
}

.user-id-text {
    font-size: 0.8rem;
}

.cursor-pointer {
    cursor: pointer;
}

.new-project-modal .modal-header {
    border-bottom: 0;
    padding-bottom: 0;
}

.new-project-modal .modal-footer {
    border-top: 0;
    padding-top: 0;
}

/* responsive */
@media (max-width: 991.98px) {
    .fhn-sidebar {
        transform: translateX(-100%);
    }

    .sidebar-logo div {
        flex-direction: column;
        text-align: center;
    }

    .sidebar-logo-img {
        height: 50px !important;
    }

    .user-avatar img {
        width: 50px !important;
        height: 50px !important;
    }

    .fhn-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }

    .fhn-main {
        margin-left: 0;
        width: 100%;
    }

    .hero-section {
        padding: 1.5rem;
        text-align: center;
    }

    .hero-content {
        flex-direction: column;
        gap: 1rem;
    }

    .project-wrapper {
        flex-direction: column;
    }

    .context-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 0.5rem;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-close-btn {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s;
        z-index: 1045;
    }

    .sidebar-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

@media (max-width: 600px) {
    .hero-actions .btn {
        width: 100%;
    }
}