html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

@keyframes taadaa {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.loader {
    background-image: url(../img/loading.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    animation:taadaa 2s;
}

.hd-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(180deg, #f8fffd 0%, #eef7f4 100%);
    border-bottom: 1px solid #cfe6df;
    box-shadow: 0 10px 30px rgba(16, 78, 68, 0.08);
    padding: 0.45rem 0;
}

.hd-topbar .container-fluid {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hd-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 8px 4px 4px;
    border-radius: 16px;
}

.hd-brand:hover {
    background: rgba(26, 188, 156, 0.08);
}

.hd-brand-mark {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.hd-brand-text {
    font-weight: 700;
    color: #145c52;
    letter-spacing: -0.03em;
    font-size: 1.05rem;
}

.hd-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.hd-icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(20, 70, 62, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #2c3e50;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hd-icon-btn:hover,
.hd-icon-btn.is-active {
    transform: translateY(-1px);
    background: #e7f8f3;
    box-shadow: 0 8px 18px rgba(26, 188, 156, 0.18);
}

.hd-icon-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.hd-icon-btn i {
    font-size: 1rem;
}

.hd-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.hd-view-toggle {
    display: inline-flex;
    background: #fff;
    border-radius: 14px;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(20, 70, 62, 0.08);
    flex: 0 0 auto;
}

.hd-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hd-view-btn {
    width: 36px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5b6b68;
    text-decoration: none;
}

.hd-view-btn.is-active,
.hd-view-btn:hover {
    background: #14b8a6;
    color: #fff;
}

.hd-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.hd-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.hd-search-box input {
    width: 240px;
    height: 42px;
    border: 1px solid #d7e8e3;
    border-radius: 999px;
    padding: 0 72px 0 16px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hd-search-box input:focus {
    outline: none;
    border-color: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
}

.hd-search-clear {
    position: absolute;
    right: 40px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #dbe7e3;
    color: #4b5d59;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

.hd-search-clear.is-visible {
    display: inline-flex;
}

.hd-search-submit {
    position: absolute;
    right: 6px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #1abc9c;
    color: #fff;
}

.hd-more-btn {
    width: 42px;
    height: 42px;
}

.hd-comment-menu {
    width: 360px;
    max-width: calc(100vw - 24px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 40, 36, 0.18);
}

.hd-comment-head,
.hd-comment-all {
    padding: 10px 14px;
    font-weight: 600;
    color: #145c52;
    background: #f3fbf8;
}

.hd-comment-all {
    display: block;
    text-align: center;
    text-decoration: none;
    border-top: 1px solid #e3eee9;
}

.hd-comment-all:hover {
    background: #e7f8f3;
    color: #0f766e;
}

.hd-comment-empty {
    padding: 18px 14px;
    color: #6b7c78;
    text-align: center;
}

.hd-comment-item {
    width: 100%;
    border: 0;
    background: #fff;
    display: flex;
    gap: 10px;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eef3f1;
}

.hd-comment-item:hover {
    background: #f7fbfa;
}

.hd-comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 34px;
}

.hd-comment-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #14b8a6;
    color: #fff;
    font-weight: 700;
}

.hd-comment-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hd-comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.hd-comment-title,
.hd-comment-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.hd-comment-title {
    color: #145c52;
    font-weight: 600;
}

.hd-comment-text {
    color: #60706c;
}

#hdNavbar.show,
#hdNavbar.collapsing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

@media (max-width: 992px) {
    .hd-search-box input {
        width: 180px;
    }

    .hd-search-wrap {
        margin-left: 0;
        width: 100%;
        padding-top: 8px;
    }
}

.hd-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    background: linear-gradient(90deg, #f4fbf8 0%, #ffffff 55%);
    border: 1px solid #d7ece6;
}

.hd-actionbar-left,
.hd-actionbar-mid {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hd-action-btn,
.hd-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #d5e8e2;
    border-radius: 12px;
    background: #fff;
    color: #1f4f47;
    font-weight: 600;
    text-decoration: none;
    box-shadow: none !important;
}

.hd-action-btn:hover,
.hd-filter-toggle:hover {
    background: #eef8f4;
    color: #145c52;
}

.hd-filter-toggle .hd-filter-glyph {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #14b8a6;
    color: #fff;
}

.hd-filter-toggle.is-open,
.hd-filter-toggle[aria-expanded="true"] {
    background: #145c52;
    color: #fff;
    border-color: #145c52;
}

.hd-filter-toggle.is-open .hd-filter-glyph,
.hd-filter-toggle[aria-expanded="true"] .hd-filter-glyph {
    background: #fff;
    color: #145c52;
}

.hd-new-task {
    background: #111827 !important;
    color: #fff !important;
    border-color: #111827 !important;
}

.hd-user-menu {
    max-height: 360px;
    overflow-y: auto;
    min-width: 240px;
    padding: 6px 0;
}

.hd-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.hd-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 28px;
    border: 1px solid #d7e8e3;
}

.hd-user-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #14b8a6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.hd-filter-deck {
    margin: 4px 0 18px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7ece6;
    box-shadow: 0 18px 40px rgba(16, 70, 62, 0.08);
}

.hd-filter-deck-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background:
        radial-gradient(circle at 12% 20%, rgba(255,255,255,.18), transparent 28%),
        linear-gradient(120deg, #0f766e 0%, #14b8a6 55%, #38bdf8 100%);
    color: #fff;
}

.hd-filter-deck-head strong {
    display: block;
    font-size: 1.05rem;
}

.hd-filter-deck-head span {
    font-size: 12px;
    opacity: .9;
}

.hd-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.hd-filter-tile {
    min-width: 0;
    border-radius: 16px;
    background: #f7fbfa;
    border: 1px solid #e3eee9;
    padding: 10px;
}

.hd-filter-tile header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #145c52;
}

.hd-filter-tile header i {
    width: 22px;
    text-align: center;
}

.hd-filter-tile.tone-type { border-top: 3px solid #14b8a6; }
.hd-filter-tile.tone-status { border-top: 3px solid #6366f1; }
.hd-filter-tile.tone-project { border-top: 3px solid #f59e0b; }
.hd-filter-tile.tone-user { border-top: 3px solid #0ea5e9; }
.hd-filter-tile.tone-customer { border-top: 3px solid #f43f5e; }
.hd-filter-tile.tone-parent { border-top: 3px solid #8b5cf6; }
.hd-filter-tile.tone-date { border-top: 3px solid #22c55e; }
.hd-filter-tile.tone-group { border-top: 3px solid #64748b; }

.hd-filter-checks {
    max-height: 220px;
    overflow: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hd-filter-checks .list-group-item {
    border: 0;
    background: transparent;
    padding: 4px 0;
}

.hd-filter-checks .form-check-label {
    border-radius: 999px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e3eee9;
}

.hd-filter-checks .list-group-item:has(.form-check-input:checked) .form-check-label {
    background: #d7f6ef;
    border-color: #14b8a6;
    color: #0f766e;
}

.hd-filter-mini {
    margin-bottom: 8px;
    font-size: 12px;
}

.hd-filter-foot {
    display: flex;
    justify-content: flex-end;
    padding: 0 14px 14px;
}

.hd-filter-apply {
    min-width: 180px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, #0f766e, #14b8a6);
    color: #fff;
    font-weight: 700;
    box-shadow: none !important;
}

@media (max-width: 1199px) {
    .hd-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .hd-filter-grid {
        grid-template-columns: 1fr;
    }
}

body.hd-ai-waiting {
    overflow: hidden;
}

.hd-ai-loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(45, 212, 191, 0.22), transparent 32%),
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.18), transparent 30%),
        rgba(4, 16, 22, 0.78);
    backdrop-filter: blur(10px);
}

.hd-ai-loader[hidden] {
    display: none !important;
}

.hd-ai-loader-card {
    width: min(360px, calc(100vw - 32px));
    text-align: center;
    color: #e7fffb;
    padding: 28px 22px 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 42, 48, 0.92), rgba(8, 22, 28, 0.92));
    border: 1px solid rgba(45, 212, 191, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hd-ai-stage {
    width: 132px;
    height: 132px;
    margin: 0 auto 18px;
    position: relative;
}

.hd-ai-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.28) 0%, rgba(20, 184, 166, 0.04) 62%, transparent 70%);
    animation: hd-ai-spin 8s linear infinite;
}

.hd-ai-orbit::before,
.hd-ai-orbit::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px dashed rgba(125, 211, 252, 0.45);
}

.hd-ai-orbit::after {
    inset: 24px;
    border-style: solid;
    border-color: rgba(45, 212, 191, 0.25);
    animation: hd-ai-spin 3.4s linear infinite reverse;
}

.hd-ai-core {
    position: absolute;
    inset: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #5eead4 0%, #0f766e 70%);
    color: #042f2e;
    font-size: 28px;
    box-shadow: 0 0 28px rgba(45, 212, 191, 0.7);
    animation: hd-ai-pulse 1.6s ease-in-out infinite;
}

.hd-ai-node {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 12px #7dd3fc;
}

.hd-ai-node.n1 { top: 4px; left: 61px; }
.hd-ai-node.n2 { bottom: 14px; left: 16px; background: #c4b5fd; box-shadow: 0 0 12px #c4b5fd; }
.hd-ai-node.n3 { bottom: 18px; right: 14px; background: #5eead4; box-shadow: 0 0 12px #5eead4; }

.hd-ai-title {
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.hd-ai-text {
    font-size: 13px;
    color: #9fdad0;
    min-height: 20px;
}

.hd-ai-bars {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 16px;
    height: 22px;
    align-items: flex-end;
}

.hd-ai-bars span {
    width: 5px;
    border-radius: 99px;
    background: linear-gradient(#5eead4, #6366f1);
    animation: hd-ai-eq 1s ease-in-out infinite;
}

.hd-ai-bars span:nth-child(2) { animation-delay: .12s; }
.hd-ai-bars span:nth-child(3) { animation-delay: .24s; }
.hd-ai-bars span:nth-child(4) { animation-delay: .36s; }
.hd-ai-bars span:nth-child(5) { animation-delay: .48s; }

@keyframes hd-ai-spin {
    to { transform: rotate(360deg); }
}

@keyframes hd-ai-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 18px rgba(45, 212, 191, 0.45); }
    50% { transform: scale(1.08); box-shadow: 0 0 32px rgba(45, 212, 191, 0.9); }
}

@keyframes hd-ai-eq {
    0%, 100% { height: 7px; opacity: .65; }
    50% { height: 22px; opacity: 1; }
}

.hd-auth-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(26, 188, 156, 0.18), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(20, 92, 82, 0.16), transparent 40%),
        linear-gradient(180deg, #f8fffd 0%, #eef7f4 100%);
}

.hd-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hd-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #cfe6df;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(16, 78, 68, 0.12);
    padding: 32px 28px 24px;
}

.hd-auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.hd-auth-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.hd-auth-brand strong {
    display: block;
    color: #145c52;
    font-size: 1.05rem;
}

.hd-auth-brand span {
    color: #6a8a84;
    font-size: 0.85rem;
}

.hd-auth-card h1 {
    font-size: 1.45rem;
    color: #145c52;
    margin-bottom: 6px;
}

.hd-auth-lead {
    color: #5e7873;
    margin-bottom: 20px;
}

.hd-auth-input {
    border-radius: 12px;
    border-color: #cfe6df;
    min-height: 44px;
}

.hd-auth-submit {
    background: #145c52;
    color: #fff;
    border-radius: 12px;
    min-height: 44px;
    font-weight: 600;
}

.hd-auth-submit:hover {
    background: #0f4a42;
    color: #fff;
}

.hd-auth-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #145c52;
    text-decoration: none;
    font-weight: 600;
}

.hd-auth-link:hover {
    text-decoration: underline;
    color: #0f4a42;
}

.hd-user-wrap {
    margin-left: 6px;
}