:root {
    --tp-primary:   #1ac4f3;
    --tp-primary-dk:#0ea8d4;
    --tp-dark:      #111827;
    --tp-sidebar:   #18212f;
    --tp-sidebar-border: rgba(255,255,255,.07);
    --tp-green:     #16a34a;
    --tp-red:       #dc2626;
    --tp-blue:      #1ac4f3;
    --tp-border:    #e5e7eb;
    --tp-bg:        #f3f4f6;
    --tp-text:      #111827;
    --tp-muted:     #6b7280;
    --tp-card-bg:   #fff;
}

/* Cards */
.tpdb-card {
    background: var(--tp-card-bg);
    border: 1px solid var(--tp-border);
    border-radius: 6px;
    overflow: hidden;
}

/* Tables */
.tpdb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tpdb-table th { padding: 9px 14px; font-size: 11px; font-weight: 600; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--tp-border); text-align: left; background: #f9fafb; }
.tpdb-table td { padding: 11px 14px; border-bottom: 1px solid var(--tp-border); color: var(--tp-text); }
.tpdb-table tr:last-child td { border-bottom: none; }

/* Badges — flat, no pill */
.tpdb-badge { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.tpdb-badge-orange { background: #fef9c3; color: #854d0e; }
.tpdb-badge-green  { background: #dcfce7; color: #15803d; }
.tpdb-badge-blue   { background: #e8f9fe; color: #0a6b87; }
.tpdb-badge-red    { background: #fee2e2; color: #991b1b; }
.tpdb-badge-gray   { background: #f3f4f6; color: #374151; }

/* Buttons */
.tpdb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: background .12s; }
.tpdb-btn-primary { background: var(--tp-primary); color: #fff; border-color: var(--tp-primary); }
.tpdb-btn-primary:hover { background: var(--tp-primary-dk); border-color: var(--tp-primary-dk); color: #fff; }
.tpdb-btn-secondary { background: #fff; color: #374151; border-color: var(--tp-border); }
.tpdb-btn-secondary:hover { background: #f9fafb; }
.tpdb-btn:focus, .tpdb-btn:focus-visible { outline: 2px solid var(--tp-primary); outline-offset: 2px; box-shadow: none !important; }

/* Section */
.tpdb-section { padding-top: 20px; }
.tpdb-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tpdb-section-title { font-size: 18px; font-weight: 600; color: var(--tp-text); margin: 0; }
.tpdb-section-sub { font-size: 13px; color: var(--tp-muted); margin: 3px 0 0; }

/* Status tabs */
.tpdb-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tpdb-tab { padding: 5px 11px; font-size: 12px; font-weight: 500; border-radius: 4px; text-decoration: none; color: var(--tp-muted); border: 1px solid transparent; }
.tpdb-tab.active { background: #fff; color: var(--tp-text); border-color: var(--tp-border); }
.tpdb-tab:hover:not(.active) { background: #fff; color: var(--tp-text); }

/* Forms */
.tpdb-input {
    width: 100%; padding: 7px 10px;
    border: 1px solid #d1d5db; border-radius: 4px;
    font-size: 13px; color: var(--tp-text);
    box-sizing: border-box; outline: none;
}
.tpdb-input:focus { border-color: var(--tp-primary) !important; box-shadow: none !important; }
.tpdb-label { font-size: 11px; font-weight: 600; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 4px; }

/* Alerts */
.tpdb-alert { padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 14px; border-left: 3px solid; }
.tpdb-alert-success { background: #f0fdf4; border-color: #16a34a; color: #15803d; }
.tpdb-alert-error   { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
.tpdb-alert-warning { background: #fefce8; border-color: #ca8a04; color: #854d0e; }
.tpdb-alert-info    { background: #e8f9fe; border-color: #1ac4f3; color: #0a6b87; }

/* ── Topbar ──────────────────────────────────────────────────── */
.tpdb-topbar {
    height: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px; padding: 0 22px;
    background: #fff; border-bottom: 1px solid var(--tp-border);
}
.tpdb-topbar-icon-btn {
    position: relative;
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    color: #6b7280; font-size: 18px; transition: background .12s, color .12s;
}
.tpdb-topbar-icon-btn:hover { background: #f3f4f6; color: #111827; }
.tpdb-topbar-icon-btn:focus-visible { outline: 2px solid var(--tp-primary); outline-offset: 1px; }

.tpdb-notif-dot {
    position: absolute; top: 5px; right: 5px;
    min-width: 16px; height: 16px; padding: 0 3px;
    border-radius: 8px; background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
[data-theme="dark"] .tpdb-notif-dot { box-shadow: 0 0 0 2px var(--tp-card-bg); }

.tpdb-notif-panel {
    position: absolute; top: 50px; right: 0;
    width: 360px; max-height: 480px;
    background: #fff; border: 1px solid var(--tp-border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17,24,39,.14);
    z-index: 9999; overflow: hidden;
    display: flex; flex-direction: column;
}
.tpdb-notif-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--tp-border); flex-shrink: 0;
}
.tpdb-notif-panel-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--tp-text); }
.tpdb-notif-mark-all { font-size: 11px; color: var(--tp-primary); cursor: pointer; background: none; border: none; font-weight: 600; padding: 0; }
.tpdb-notif-mark-all:hover { text-decoration: underline; }
.tpdb-notif-list { overflow-y: auto; flex: 1; }
.tpdb-notif-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 14px; border-bottom: 1px solid var(--tp-border);
    text-decoration: none; cursor: pointer; position: relative;
}
.tpdb-notif-item:hover { background: #f9fafb; }
.tpdb-notif-item.unread { background: #eff9fe; }
.tpdb-notif-item:last-child { border-bottom: none; }
.tpdb-notif-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--tp-primary); color: #fff; font-size: 14px;
}
.tpdb-notif-body { flex: 1; min-width: 0; }
.tpdb-notif-title { font-size: 12.5px; font-weight: 600; color: var(--tp-text); line-height: 1.35; }
.tpdb-notif-msg { font-size: 11.5px; color: var(--tp-muted); margin-top: 2px; }
.tpdb-notif-time { font-size: 10.5px; color: var(--tp-muted); margin-top: 4px; }
.tpdb-notif-close {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    border: none; background: transparent; color: var(--tp-muted);
    cursor: pointer; font-size: 13px; line-height: 1; display: flex;
    align-items: center; justify-content: center; opacity: 0; transition: opacity .12s;
}
.tpdb-notif-item:hover .tpdb-notif-close { opacity: 1; }
.tpdb-notif-close:hover { background: #e5e7eb; color: #111; }
.tpdb-notif-empty { padding: 40px 20px; text-align: center; color: var(--tp-muted); font-size: 13px; }
.tpdb-notif-panel-foot { padding: 9px 14px; border-top: 1px solid var(--tp-border); text-align: center; flex-shrink: 0; }
.tpdb-notif-panel-foot a { font-size: 11.5px; color: var(--tp-primary); text-decoration: none; font-weight: 600; }

/* ── Theme toggle ────────────────────────────────────────────── */
.tpdb-theme-toggle .ri-sun-line { display: none; }
[data-theme="dark"] .tpdb-theme-toggle .ri-moon-line { display: none; }
[data-theme="dark"] .tpdb-theme-toggle .ri-sun-line { display: inline-flex; }
