:root {

    --bg:
        #f1f5f9;

    --card:
        #ffffff;

    --card-hover:
        #f8fafc;

    --text:
        #1e293b;

    --muted:
        #64748b;

    --border:
        #e2e8f0;

    --accent:
        #2563eb;

    --accent-hover:
        #1d4ed8;

    --danger:
        #dc2626;

    --danger-bg:
        #fef2f2;

    --success:
        #15803d;

    --success-bg:
        #f0fdf4;

    --shadow:
        0 4px 15px rgba(15, 23, 42, 0.06);

    --shadow-hover:
        0 8px 25px rgba(15, 23, 42, 0.10);

    --radius:
        14px;
}


html[data-theme="dark"] {

    --bg:
        #0f172a;

    --card:
        #1e293b;

    --card-hover:
        #273449;

    --text:
        #e2e8f0;

    --muted:
        #94a3b8;

    --border:
        #334155;

    --accent:
        #60a5fa;

    --accent-hover:
        #93c5fd;

    --danger:
        #f87171;

    --danger-bg:
        #451a1a;

    --success:
        #4ade80;

    --success-bg:
        #052e16;

    --shadow:
        0 4px 20px rgba(0, 0, 0, 0.25);

    --shadow-hover:
        0 8px 30px rgba(0, 0, 0, 0.35);
}


* {
    box-sizing: border-box;
}


html {
    min-height: 100%;
}


body {

    margin: 0;

    min-height: 100vh;

    background:
        var(--bg);

    color:
        var(--text);

    font-family:
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


/*
|--------------------------------------------------------------------------
| APP
|--------------------------------------------------------------------------
*/

.app {

    width: 100%;

    max-width: 1500px;

    margin: 0 auto;

    padding:
        25px;
}


/*
|--------------------------------------------------------------------------
| TOPBAR
|--------------------------------------------------------------------------
*/

.topbar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;

    padding-bottom: 20px;

    border-bottom:
        1px solid var(--border);
}


.brand {

    display: flex;

    align-items: center;

    gap: 13px;
}


.brand-icon {

    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 13px;

    background:
        var(--accent);

    color: white;

    font-size: 25px;

    box-shadow:
        var(--shadow);
}


.brand-icon-link {

    text-decoration: none;
}


.brand h1 {

    margin: 0;

    font-size: 1.45rem;

    line-height: 1.2;
}


.brand span {

    display: block;

    margin-top: 3px;

    color:
        var(--muted);

    font-size: 0.85rem;
}


.topbar-right {

    display: flex;

    align-items: center;

    gap: 12px;
}


.theme-indicator {

    color:
        var(--muted);

    font-size: 1.15rem;
}


/*
|--------------------------------------------------------------------------
| PROFILE
|--------------------------------------------------------------------------
*/

.profile-wrapper {

    position: relative;
}


.profile-button {

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 6px 10px 6px 6px;

    border:
        1px solid var(--border);

    border-radius: 30px;

    background:
        var(--card);

    color:
        var(--text);

    cursor: pointer;

    font: inherit;
}


.avatar {

    width: 34px;

    height: 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        var(--accent);

    color: white;

    font-weight: 700;
}


.profile-name {

    font-size: 0.9rem;

    font-weight: 600;
}


.profile-arrow {

    font-size: 0.65rem;

    color:
        var(--muted);
}


.profile-menu {

    display: none;

    position: absolute;

    z-index: 100;

    right: 0;

    top: calc(100% + 8px);

    min-width: 220px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius: 12px;

    box-shadow:
        var(--shadow-hover);

    overflow: hidden;
}


.profile-menu.show {

    display: block;
}


.profile-menu-header {

    padding: 15px;

    border-bottom:
        1px solid var(--border);
}


.profile-menu-header strong {

    display: block;
}


.profile-menu-header span {

    color:
        var(--muted);

    font-size: 0.8rem;
}


.profile-menu a {

    display: block;

    padding: 12px 15px;

    text-decoration: none;

    color:
        var(--text);

    font-size: 0.9rem;
}


.profile-menu a:hover {

    background:
        var(--card-hover);
}


.menu-divider {

    height: 1px;

    background:
        var(--border);
}


.profile-menu .logout-link {

    color:
        var(--danger);
}


/*
|--------------------------------------------------------------------------
| DASHBOARD
|--------------------------------------------------------------------------
*/

.dashboard {

    display: flex;

    flex-direction: column;

    gap: 28px;
}


.dashboard-section {

    min-width: 0;
}


.section-heading {

    display: flex;

    align-items: center;

    gap: 9px;

    margin-bottom: 12px;
}


.section-heading h2 {

    margin: 0;

    font-size: 0.95rem;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    color:
        var(--muted);
}


.section-count {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 23px;

    height: 23px;

    padding: 0 7px;

    border-radius: 20px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    color:
        var(--muted);

    font-size: 0.75rem;
}


.link-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );

    gap: 12px;
}


.link-card {

    display: flex;

    align-items: center;

    min-height: 65px;

    padding: 13px 15px;

    gap: 12px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);

    color:
        var(--text);

    text-decoration: none;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}


.link-card:hover {

    transform:
        translateY(-2px);

    background:
        var(--card-hover);

    border-color:
        var(--accent);

    box-shadow:
        var(--shadow-hover);
}


.link-icon {

    width: 34px;

    min-width: 34px;

    height: 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.25rem;
}


.link-title {

    flex: 1;

    font-size: 0.92rem;

    font-weight: 600;
}


.link-arrow {

    color:
        var(--muted);

    font-size: 0.95rem;
}


/*
|--------------------------------------------------------------------------
| LOGIN
|--------------------------------------------------------------------------
*/

.login-page {

    display: flex;

    align-items: center;

    justify-content: center;

    min-height: 100vh;

    padding: 20px;
}


.login-container {

    width: 100%;

    max-width: 390px;
}


.login-card {

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius:
        18px;

    padding: 35px;

    box-shadow:
        var(--shadow-hover);
}


.login-logo {

    width: 62px;

    height: 62px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 0 auto 20px;

    border-radius: 18px;

    background:
        var(--accent);

    color: white;

    font-size: 30px;
}


.login-card h1 {

    text-align: center;

    margin: 0 0 8px;

    font-size: 1.6rem;
}


.login-subtitle {

    text-align: center;

    margin: 0 0 25px;

    color:
        var(--muted);

    font-size: 0.9rem;
}


/*
|--------------------------------------------------------------------------
| FORMS
|--------------------------------------------------------------------------
*/

.form-group {

    margin-bottom: 17px;
}


.form-group label {

    display: block;

    margin-bottom: 7px;

    font-size: 0.85rem;

    font-weight: 600;
}


input,
select {

    width: 100%;

    min-height: 44px;

    padding:
        10px 12px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background:
        var(--card);

    color:
        var(--text);

    font: inherit;

    outline: none;
}


input:focus,
select:focus {

    border-color:
        var(--accent);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.12);
}


.button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 43px;

    padding:
        9px 15px;

    border: none;

    border-radius: 9px;

    font: inherit;

    font-weight: 600;

    cursor: pointer;

    text-decoration: none;

    transition:
        0.15s ease;
}


.button-primary {

    background:
        var(--accent);

    color: white;
}


.button-primary:hover {

    background:
        var(--accent-hover);
}


.button-danger {

    background:
        var(--danger-bg);

    color:
        var(--danger);

    border:
        1px solid var(--border);
}


.button-danger:hover {

    border-color:
        var(--danger);
}


.button-full {

    width: 100%;
}


.button-small {

    min-height: 34px;

    padding:
        6px 10px;

    font-size: 0.8rem;
}


/*
|--------------------------------------------------------------------------
| ALERTS
|--------------------------------------------------------------------------
*/

.alert {

    padding:
        12px 14px;

    margin-bottom: 18px;

    border-radius: 9px;

    font-size: 0.88rem;
}


.alert-error {

    color:
        var(--danger);

    background:
        var(--danger-bg);

    border:
        1px solid var(--border);
}


.alert-success {

    color:
        var(--success);

    background:
        var(--success-bg);

    border:
        1px solid var(--border);
}


/*
|--------------------------------------------------------------------------
| EMPTY DASHBOARD
|--------------------------------------------------------------------------
*/

.empty-dashboard {

    text-align: center;

    padding: 70px 20px;

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);
}


.empty-icon {

    font-size: 3rem;

    margin-bottom: 15px;
}


.empty-dashboard h2 {

    margin: 0 0 8px;
}


.empty-dashboard p {

    color:
        var(--muted);

    margin-bottom: 22px;
}


/*
|--------------------------------------------------------------------------
| PAGE CONTAINER
|--------------------------------------------------------------------------
*/

.page-container {

    max-width: 850px;

    margin: 0 auto;
}


.page-card {

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);

    padding: 25px;
}


.page-card h2 {

    margin-top: 0;
}


.page-card h3 {

    margin-top: 25px;
}


.page-description {

    color:
        var(--muted);
}


/*
|--------------------------------------------------------------------------
| PROFILE INFO
|--------------------------------------------------------------------------
*/

.profile-information {

    margin:
        20px 0;
}


.information-row {

    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding:
        13px 0;

    border-bottom:
        1px solid var(--border);
}


.information-row span {

    color:
        var(--muted);
}


hr {

    border: 0;

    border-top:
        1px solid var(--border);

    margin:
        25px 0;
}


/*
|--------------------------------------------------------------------------
| SETTINGS
|--------------------------------------------------------------------------
*/

.settings-container {

    display: grid;

    gap: 20px;
}


.settings-card {

    background:
        var(--card);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    padding: 22px;

    box-shadow:
        var(--shadow);
}


.settings-card-header {

    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.settings-card-header h2 {

    margin:
        0 0 5px;

    font-size: 1.05rem;
}


.settings-card-header p {

    margin: 0;

    color:
        var(--muted);

    font-size: 0.85rem;
}


.theme-options {

    display: flex;

    gap: 12px;

    margin-bottom: 18px;
}


.theme-option {

    display: flex;

    align-items: center;

    gap: 8px;

    padding:
        10px 14px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    cursor: pointer;
}


.theme-option input {

    width: auto;

    min-height: auto;
}


.inline-form {

    display: flex;

    gap: 10px;
}


.inline-form input {

    flex: 1;
}


.notice,
.empty-category {

    padding:
        13px;

    background:
        var(--card-hover);

    border:
        1px solid var(--border);

    border-radius: 9px;

    color:
        var(--muted);

    font-size: 0.85rem;
}


.form-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap:
        0 15px;
}


.manage-category {

    border:
        1px solid var(--border);

    border-radius: 11px;

    margin-bottom: 14px;

    overflow: hidden;
}


.manage-category-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        13px 15px;

    background:
        var(--card-hover);

    border-bottom:
        1px solid var(--border);
}


.manage-category-header h3 {

    margin: 0;

    font-size: 0.95rem;
}


.manage-links {

    padding:
        5px 15px;
}


.manage-link {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        11px 0;

    border-bottom:
        1px solid var(--border);
}


.manage-link:last-child {

    border-bottom: none;
}


.manage-link-info {

    display: flex;

    align-items: center;

    gap: 10px;

    min-width: 0;
}


.manage-link-icon {

    font-size: 1.25rem;
}


.manage-link-info strong {

    display: block;

    font-size: 0.88rem;
}


.manage-link-info small {

    display: block;

    margin-top: 2px;

    color:
        var(--muted);

    font-size: 0.75rem;

    overflow:
        hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;

    max-width: 500px;
}


/*
|--------------------------------------------------------------------------
| MOBILE
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

    .app {

        padding:
            15px;
    }


    .topbar {

        align-items:
            flex-start;
    }


    .profile-name {

        display: none;
    }


    .link-grid {

        grid-template-columns:
            1fr;
    }


    .form-grid {

        grid-template-columns:
            1fr;
    }


    .inline-form {

        flex-direction:
            column;
    }


    .theme-options {

        flex-direction:
            column;
    }


    .manage-category-header {

        align-items:
            flex-start;

        flex-direction:
            column;
    }


    .manage-link-info small {

        max-width:
            220px;
    }


    .login-card {

        padding:
            25px;
    }

}
