*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', 'Segoe UI', system-ui, sans-serif;
    background: #f0f2f8;
    color: #1a1a2e;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 1.75rem;
    background: #f0f2f8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-left: auto;
}

.btn-nav {
    font-size: .8rem;
    font-weight: 500;
    padding: .38rem 1rem;
    background: #2e88ff;
    color: #fff;
    border-radius: 10px;
    transition: background .2s;
}

.btn-nav:hover {
    background: #63b4ff;
}

.sidebar-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: .67rem;
    background: rgba(46, 136, 255, .10);
    color: #2e88ff;
    border-radius: 5px;
    padding: .12em .5em;
    border: 1px solid rgba(46, 136, 255, .15);
}

.search-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 56px);
    padding-bottom: 4rem;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem 2rem;
    animation: fadeUp .5s ease;
}

.site-logo {
    max-height: 90px;
    max-width: 280px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1.5rem;
    display: block;
}

.searchbar-wrap {
    width: 100%;
    max-width: 620px;
    padding: 0 1.5rem;
    animation: fadeUp .45s .06s ease both;
}

.searchbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #ffffff;
    border: 1.5px solid #dde1f0;
    border-radius: 99px;
    padding: .35rem .35rem .35rem 1.1rem;
    box-shadow: 0 4px 24px rgba(30, 30, 60, .12);
}

.searchbar:focus-within {
    border-color: #2e88ff;
}

.searchbar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #1a1a2e;
    font-size: .95rem;
    font-family: 'Sora', sans-serif;
    caret-color: #2e88ff;
}

.searchbar input::placeholder {
    color: #9898b0;
}

.clear-btn {
    background: none;
    border: none;
    color: #9898b0;
    font-size: .8rem;
    cursor: pointer;
    padding: .25rem .4rem;
    border-radius: 50%;
    transition: color .15s;
}

.clear-btn:hover {
    color: #1a1a2e;
}

.search-btn {
    background: #2e88ff;
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
    padding: .55rem 1.35rem;
    cursor: pointer;
    transition: background .2s;
}

.search-btn:hover {
    background: #63b4ff;
}

.results {
    width: 100%;
    max-width: 680px;
    padding: 1.75rem 1.5rem 0;
    animation: fadeUp .25s ease;
}

.results-meta {
    font-size: .78rem;
    color: #5c5c78;
    border-bottom: 1px solid #dde1f0;
    padding-bottom: .6rem;
    margin-bottom: 1rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.result-card {
    background: #ffffff;
    border: 1px solid #dde1f0;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    cursor: pointer;
}

.rc-name {
    font-size: .95rem;
    font-weight: 600;
    color: #2e88ff;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.rc-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: .67rem;
    color: #9898b0;
    margin-bottom: .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-desc {
    font-size: .82rem;
    color: #5c5c78;
    margin-bottom: .5rem;
}

.rc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
}

.empty-icon {
    font-size: 2.5rem;
    color: #9898b0;
    margin-bottom: .75rem;
}

.dash-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    height: 100vh;
}

.dash-sidebar {
    background: #ffffff;
    border-right: 1px solid #dde1f0;
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 0 .65rem;
    flex: 1;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #5c5c78;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-size: .82rem;
    padding: .55rem .85rem;
    text-align: left;
    transition: all .18s;
    width: 100%;
}

.tab-btn:hover {
    background: #f7f8fc;
    color: #1a1a2e;
}

.tab-btn.active {
    background: rgba(46, 136, 255, .10);
    color: #2e88ff;
    font-weight: 600;
}

.sidebar-stat {
    padding: 1rem 1.25rem;
    border-top: 1px solid #dde1f0;
    margin-top: auto;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -.04em;
    color: #1a1a2e;
    line-height: 1;
}

.stat-label {
    font-size: .7rem;
    color: #5c5c78;
}

.dash-main {
    padding: 2rem 2.5rem;
    overflow-y: auto;
    background: #f0f2f8;
}

.tab-panel {
    display: none;
    animation: fadeUp .2s ease;
}

.tab-panel.active {
    display: block;
}

.panel-head {
    margin-bottom: 1.75rem;
}

.panel-head h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
}

.add-form {
    max-width: 540px;
    background: #ffffff;
    border: 1px solid #dde1f0;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(30, 30, 60, .08);
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

.field label {
    font-size: .75rem;
    font-weight: 600;
    color: #5c5c78;
    text-transform: uppercase;
}

.field input,
.field textarea {
    background: #f7f8fc;
    border: 1.5px solid #dde1f0;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: .9rem;
    font-family: 'Sora', sans-serif;
    padding: .62rem .9rem;
    width: 100%;
    outline: none;
    transition: border-color .18s;
}

.field input:focus,
.field textarea:focus {
    border-color: #2e88ff;
    background: #ffffff;
}

.form-actions {
    display: flex;
    gap: .65rem;
    padding-top: .5rem;
}

.btn-primary {
    background: #2e88ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Sora', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    padding: .62rem 1.2rem;
    cursor: pointer;
    transition: background .2s;
}

.btn-primary:hover {
    background: #63b4ff;
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.feedback {
    margin-top: 1rem;
    font-size: .85rem;
    color: #1a1a2e;
    padding: 0;
}

.manager-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
}

.list-toolbar {
    margin-bottom: 1.5rem;
}

.filter-input {
    width: 100%;
    max-width: 300px;
    padding: 0.6rem 1rem;
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    background: #ffffff;
    border: 1.5px solid #dde1f0;
    border-radius: 40px;
    transition: border-color .2s;
}

.filter-input:focus {
    outline: none;
    border-color: #2e88ff;
}

#listWrap {
    overflow-x: auto;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: 'Sora', sans-serif;
    min-width: 600px;
}

.entries-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #5c5c78;
    border-bottom: 1.5px solid #dde1f0;
    font-family: 'Sora', sans-serif;
}

.entries-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dde1f0;
    vertical-align: middle;
    color: #1a1a2e;
    font-family: 'Sora', sans-serif;
}

.entries-table tbody tr:hover {
    background: #f7f8fc;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    background: rgba(46, 136, 255, .10);
    color: #2e88ff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: 'Sora', sans-serif;
}

.mono-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #2e88ff;
    word-break: break-all;
}

.date-cell {
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    color: #9898b0;
    white-space: nowrap;
}

.btn-del {
    background: transparent;
    border: 1px solid #dde1f0;
    border-radius: 8px;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 4px 10px;
    transition: all 0.2s;
    font-family: 'Sora', sans-serif;
}

.btn-del:hover {
    background: rgba(220, 38, 38, .08);
    border-color: #dc2626;
}

.list-empty {
    text-align: center;
    padding: 2rem;
    color: #9898b0;
    font-family: 'Sora', sans-serif;
}

@media (max-width: 700px) {
    .dash-layout {
        grid-template-columns: 1fr;
    }
    .dash-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #dde1f0;
        padding: 0.6rem;
    }
    .dash-nav {
        flex-direction: row;
        padding: 0;
        gap: 0.3rem;
    }
    .tab-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
    }
    .sidebar-stat {
        display: none;
    }
    .dash-main {
        padding: 1.25rem;
    }
    .add-form {
        padding: 1.25rem;
    }
    .manager-panel {
        padding: 1rem;
    }
}