/*
 * File name : tags.css
 * Author    : mayuri@rtac.in
 * DOC       : 01-Sep-2026
 * Use       : Styles for §6.1 Manage Contact -> Tags submenu.
 *             Prefix every class with "dcT" so nothing collides with
 *             main.css / dashboard.css / contacts.css.
 */

/* ============================================================
   Colour tokens, scoped to the tags page so they never leak.
   ============================================================ */
#sectionTags {
    --dct-orange       : #F4623A;
    --dct-orange-soft  : #FDEFEA;
    --dct-green        : #16A34A;
    --dct-green-soft   : #E7F6EC;
    --dct-green-dark   : #12833C;
    --dct-bg           : #F7F8FB;
    --dct-card         : #FFFFFF;
    --dct-border       : #EAEDF3;
    --dct-text         : #1F2937;
    --dct-text-muted   : #6B7280;
    --dct-text-soft    : #9CA3AF;
    --dct-danger-soft  : #FEE2E2;
    --dct-danger       : #DC2626;

    background: var(--dct-bg);
    min-height: calc(100vh - 60px);
    padding: 28px 32px 40px;
}

/* ============================================================
   Header row.
   ============================================================ */
.dcTHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dcTTitleWrap { display: flex; align-items: center; gap: 14px; }

.dcTTitleBadge {
    width: 46px; height: 46px;
    border-radius: 13px;
    background: linear-gradient(135deg, #16A34A 0%, #4ADE80 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.30);
}

.dcTTitle {
    font-size: 22px;
    font-weight: 700;
    color: var(--dct-text);
    margin: 0;
    line-height: 1.1;
}
.dcTSubtitle {
    font-size: 13px;
    color: var(--dct-text-muted);
    margin: 3px 0 0;
}

/* ============================================================
   Stats KPI cards.
   ============================================================ */
.dcTStatsRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.dcTStat {
    background: var(--dct-card);
    border: 1px solid var(--dct-border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dcTStat:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
    border-color: transparent;
}

.dcTStatIcon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.dcTStatIcon.orange { background: var(--dct-orange-soft); color: var(--dct-orange); }
.dcTStatIcon.green  { background: var(--dct-green-soft);  color: var(--dct-green);  }

.dcTStatValue {
    font-size: 22px;
    font-weight: 700;
    color: var(--dct-text);
    line-height: 1;
}
.dcTStatLabel {
    font-size: 12px;
    color: var(--dct-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   Card containing toolbar + table.
   ============================================================ */
.dcTPanel {
    background: var(--dct-card);
    border: 1px solid var(--dct-border);
    border-radius: 14px;
    overflow: hidden;
}

.dcTToolbar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--dct-border);
    background: var(--dct-card);
}

.dcTSearch {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 240px;
}
.dcTSearch .bi-search {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--dct-text-soft);
    pointer-events: none;
    font-size: 15px;
}
.dcTSearch input {
    width: 100%;
    border: 1px solid var(--dct-border);
    background: var(--dct-bg);
    border-radius: 10px;
    padding: 10px 14px 10px 40px;
    font-size: 14px;
    color: var(--dct-text);
    transition: border .15s, background .15s, box-shadow .15s;
}
.dcTSearch input::placeholder { color: var(--dct-text-soft); }
.dcTSearch input:focus {
    outline: none;
    border-color: var(--dct-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.dcTActions { display: flex; gap: 8px; }

.dcTBtn {
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .1s;
    border: 1px solid transparent;
}
.dcTBtn:active { transform: translateY(1px); }

.dcTBtnOutline {
    background: var(--dct-card);
    color: var(--dct-text);
    border-color: var(--dct-border);
}
.dcTBtnOutline:hover { background: var(--dct-bg); color: var(--dct-text); }

.dcTBtnPrimary {
    background: var(--dct-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}
.dcTBtnPrimary:hover { background: var(--dct-green-dark); color: #fff; }

.dcTBtnDanger {
    background: var(--dct-danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.24);
}
.dcTBtnDanger:hover { background: #B91C1C; color: #fff; }

/* ============================================================
   Table.
   ============================================================ */
#tagsTable { margin: 0 !important; }

#tagsTable thead th {
    background: #FAFBFC;
    border-bottom: 1px solid var(--dct-border);
    border-top: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--dct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 20px;
}

#tagsTable tbody td {
    padding: 14px 20px;
    border-top: 1px solid var(--dct-border);
    vertical-align: middle;
    font-size: 14px;
    color: var(--dct-text);
    background: transparent;
}
#tagsTable tbody tr:first-child td { border-top: none; }
#tagsTable tbody tr { transition: background .12s; }
#tagsTable tbody tr:hover { background: #FAFBFC; }

/* Tag cell: colour dot + pill using the tag's own ColorHex */
.dcTTagCell { display: flex; align-items: center; gap: 10px; }

.dcTSwatch {
    width: 14px; height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.dcTPill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.dcTDescription { color: var(--dct-text-muted); font-size: 13px; }
.dcTMuted { color: var(--dct-text-soft); font-size: 13px; }

.dcTCountPill {
    display: inline-block;
    background: var(--dct-green-soft);
    color: var(--dct-green);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.dcTDate {
    font-family: "SF Mono", ui-monospace, "Segoe UI Mono", Menlo, monospace;
    font-size: 12.5px;
    color: var(--dct-text-muted);
}

/* ============================================================
   Row actions.
   ============================================================ */
.dcTRowActions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.dcTIconBtn {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border: none;
    background: transparent;
    color: var(--dct-text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    font-size: 15px;
}
.dcTIconBtn:hover { background: var(--dct-bg); color: var(--dct-text); }
.dcTIconBtn.danger:hover { background: var(--dct-danger-soft); color: var(--dct-danger); }

/* ============================================================
   DataTables footer.
   ============================================================ */
#tagsTableWrap .dataTables_wrapper .dataTables_info,
#tagsTableWrap .dataTables_wrapper .dataTables_paginate {
    padding: 14px 20px !important;
    color: var(--dct-text-muted);
    font-size: 13px;
}
#tagsTableWrap .dataTables_wrapper .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px !important;
    font-size: 13px !important;
    border: 1px solid transparent !important;
    padding: 5px 11px !important;
}
#tagsTableWrap .dataTables_wrapper .paginate_button.current,
#tagsTableWrap .dataTables_wrapper .paginate_button.current:hover {
    background: var(--dct-green) !important;
    border-color: var(--dct-green) !important;
    color: #fff !important;
}
#tagsTableWrap .dataTables_wrapper .paginate_button:hover {
    background: var(--dct-bg) !important;
    border-color: var(--dct-border) !important;
    color: var(--dct-text) !important;
}

/* ============================================================
   Empty state.
   ============================================================ */
.dcTEmpty {
    padding: 72px 20px;
    text-align: center;
}
.dcTEmptyIcon {
    width: 84px; height: 84px;
    background: var(--dct-green-soft);
    color: var(--dct-green);
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin-bottom: 20px;
}
.dcTEmptyTitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--dct-text);
    margin-bottom: 4px;
}
.dcTEmptySub {
    color: var(--dct-text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}
.dcTEmptyActions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Add / Edit modal.
   ============================================================ */
#modalTagForm .modal-content,
#modalTagDelete .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
}
#modalTagForm .modal-header,
#modalTagDelete .modal-header {
    background: #fff;
    border-bottom: 1px solid var(--dct-border);
    padding: 18px 24px;
}
#modalTagForm .modal-title,
#modalTagDelete .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dct-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
#modalTagForm .modal-title .dcTModalIcon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--dct-green-soft);
    color: var(--dct-green);
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 16px;
}
#modalTagForm .modal-body,
#modalTagDelete .modal-body {
    padding: 22px 24px;
    font-size: 14px;
    color: var(--dct-text);
}
#modalTagForm .modal-footer,
#modalTagDelete .modal-footer {
    background: #FAFBFC;
    border-top: 1px solid var(--dct-border);
    padding: 14px 24px;
}

.dcTLabel {
    font-size: 11px;
    font-weight: 700;
    color: var(--dct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}
.dcTLabel .req { color: var(--dct-green); margin-left: 3px; }

.dcTInput {
    border: 1px solid var(--dct-border) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    background: #fff;
    transition: border .15s, box-shadow .15s;
    box-shadow: none !important;
}
.dcTInput:focus {
    outline: none !important;
    border-color: var(--dct-green) !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
}
textarea.dcTInput { resize: vertical; }

/* Native colour picker input */
.dcTColorInput {
    padding: 4px !important;
    height: 44px;
    width: 100%;
    cursor: pointer;
}

/* ============================================================
   Responsive.
   ============================================================ */
@media (max-width: 992px) {
    .dcTStatsRow { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    #sectionTags { padding: 20px 16px 32px; }
    .dcTToolbar { flex-direction: column; align-items: stretch; }
    .dcTSearch { max-width: none; }
    .dcTActions { justify-content: stretch; }
    .dcTActions .dcTBtn { flex: 1; justify-content: center; }
}