:root {
    --navy-900: #081b38;
    --navy-800: #0f2b56;
    --navy-700: #1a4277;
    --slate-100: #f3f6fb;
    --slate-200: #e9eef6;
    --slate-300: #dce4ef;
    --text-900: #1e2b3d;
    --text-700: #4f5f74;
    --panel: #ffffff;
    --accent: #1f5fbf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text-900);
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(1200px 450px at -15% -20%, #dfe9f8 0%, transparent 65%),
        radial-gradient(1000px 420px at 110% -15%, #d8e6ff 0%, transparent 60%),
        linear-gradient(180deg, #f3f7fc 0%, #f8fbff 100%);
}

a {
    color: var(--accent);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 265px;
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 45%, #214c86 100%);
    color: #fff;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 12px 0 35px rgba(8, 26, 54, 0.18);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding: 6px 6px 14px;
    margin-bottom: 12px;
}

.sidebar-header h5 {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.sidebar-menu a {
    display: block;
    color: #d8e6fb;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 7px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateX(2px);
}

.main-content {
    flex: 1;
    padding: 18px;
}

.topbar {
    background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
    border: 1px solid var(--slate-300);
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 26px rgba(17, 42, 74, 0.08);
    position: relative;
}

.top-search {
    flex: 1;
    max-width: 760px;
    position: relative;
}

.top-search .form-control {
    border-radius: 12px;
    border-color: var(--slate-300);
    padding: 10px 12px;
}

.top-search .form-control:focus {
    border-color: #aac4ee;
    box-shadow: 0 0 0 0.2rem rgba(44, 102, 190, 0.15);
}

.live-search-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(13, 36, 66, 0.15);
    z-index: 1055;
    max-height: 420px;
    overflow-y: auto;
}

.live-search-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 11px 12px;
    border-bottom: 1px solid #edf2f8;
}

.live-search-item:hover {
    background: #f5f8fe;
}

.live-search-title {
    font-weight: 700;
    color: #1d2f4a;
    margin-bottom: 2px;
}

.live-search-sub {
    font-size: 0.86rem;
    color: var(--text-700);
    margin-bottom: 3px;
}

.live-search-meta {
    font-size: 0.76rem;
    color: #6f8198;
}

.live-search-empty {
    padding: 12px;
    color: #6f8198;
    font-size: 0.88rem;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #3d4f67;
}

.content-area {
    padding-top: 16px;
}

.alert {
    border-radius: 12px;
}

.stats-card {
    background: var(--panel);
    border: 1px solid var(--slate-300);
    border-radius: 15px;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(16, 39, 68, 0.06);
}

.stats-card h4 {
    font-weight: 800;
    margin: 6px 0 0;
}

.content-card {
    background: var(--panel);
    border: 1px solid var(--slate-300);
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(16, 39, 68, 0.06);
    overflow: hidden;
}

.content-card .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid var(--slate-200);
    font-weight: 800;
    color: #1f3553;
}

.daily-highlight {
    border-left: 4px solid #2b5eab;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 0.7rem;
    border-color: #e6edf6;
}

.table-hover tbody tr:hover {
    background-color: #f5f8ff;
}

.table-light,
.table-light > th,
.table-light > td {
    background: #f6f9fd !important;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d8e2ee;
}

.form-control:focus,
.form-select:focus {
    border-color: #a8c2ea;
    box-shadow: 0 0 0 0.2rem rgba(52, 108, 194, 0.14);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(180deg, #2f6ccb 0%, #2459ab 100%);
    border-color: #2559ab;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #2a63be 0%, #204f99 100%);
    border-color: #204f99;
}

.empty-state {
    text-align: center;
    padding: 34px 18px;
    color: var(--text-700);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    box-shadow: 0 24px 55px rgba(10, 30, 58, 0.16);
}

mark {
    background: #ffe89a;
    padding: 0 2px;
    border-radius: 3px;
}

.file-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.editor-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.rich-editor {
    min-height: 260px;
}

.ql-toolbar.ql-snow {
    border-color: #d8e2ee;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.rich-editor.ql-container.ql-snow {
    min-height: 260px;
    border-color: #d8e2ee;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.rich-editor.ql-container .ql-editor {
    min-height: 220px;
    font-size: 0.95rem;
}

.contact-selection-summary {
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    min-height: 74px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.contact-summary-item {
    min-width: 200px;
    background: #fff;
    border: 1px solid #dbe7f4;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 18px rgba(18, 48, 87, 0.05);
}

.contact-summary-item span {
    color: var(--text-700);
    font-size: 0.9rem;
}

.contact-modal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.contact-option-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-option-card:hover {
    border-color: #a8c2ea;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(17, 42, 74, 0.08);
}

.contact-option-card input[type="checkbox"] {
    margin-top: 4px;
}

.contact-option-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contact-option-title {
    font-weight: 700;
    color: #1d2f4a;
}

.contact-option-company,
.contact-option-description {
    color: var(--text-700);
    font-size: 0.9rem;
}

.contact-option-phone {
    font-weight: 600;
    color: var(--accent);
}

.contact-list-table th,
.contact-list-table td {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .content-card.card.contact-create-card {
        position: fixed;
        top: 92px;
        width: calc((100% - 265px - 36px) * 0.333333);
        max-width: 420px;
        z-index: 1030;
    }

    .contact-list-column {
        margin-left: auto;
    }
}

.password-hero {
    background:
        radial-gradient(800px 280px at 0% 0%, rgba(66, 123, 212, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.password-hero .card-body {
    padding: 22px;
}

.password-hero-meta {
    display: flex;
    gap: 14px;
    align-items: center;
}

.password-hero-stat {
    min-width: 110px;
    padding: 12px 14px;
    border: 1px solid #d9e5f4;
    border-radius: 14px;
    background: #fff;
    text-align: center;
}

.password-hero-stat strong {
    display: block;
    font-size: 1.35rem;
    color: #17325a;
}

.password-hero-stat span {
    color: var(--text-700);
    font-size: 0.85rem;
}

.password-note {
    padding: 14px;
    border: 1px dashed #c8d8ef;
    border-radius: 14px;
    background: #f8fbff;
    color: var(--text-700);
}

.password-entry-card {
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 10px 22px rgba(16, 39, 68, 0.05);
}

.password-entry-secret {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eff5ff;
    border: 1px solid #d4e1f4;
    margin-bottom: 14px;
}

.password-entry-secret-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #587196;
}

.password-media-card {
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
}

.password-entry-edit {
    position: relative;
}

.password-entry-edit summary {
    cursor: pointer;
    font-weight: 700;
    color: #214d88;
    list-style: none;
}

.password-entry-edit summary::-webkit-details-marker {
    display: none;
}

.password-entry-edit[open] {
    min-width: 280px;
}

.password-entry-edit-form {
    width: 280px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(17, 42, 74, 0.08);
}

.password-inline-secret {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 10px;
    background: #eff5ff;
    border: 1px solid #d4e1f4;
    font-weight: 700;
    color: #17325a;
}

.password-entry-table td {
    vertical-align: middle;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 1045;
        transition: left 0.25s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        padding: 14px;
    }

    .user-box span {
        display: none;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .top-search {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .contact-modal-list {
        grid-template-columns: 1fr;
    }

    .password-hero-meta {
        width: 100%;
        justify-content: space-between;
    }
}
