:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-bg: #f8f9fc;
    --dark-text: #5a5c69;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --hover-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.25);
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
}

/* Header Styles */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.header-actions .btn {
    height: 40px;
    border-radius: 12px;
    padding: 0 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
#setKeyBtn i,
.btn-add-new i {
    margin-right: 6px;
    font-size: 1rem;
    vertical-align: middle;
}
#setKeyBtn i {
    color: var(--primary-color);
}
#setKeyBtn {
    background-color: #ffffff;
    border: 1px solid #e3e6f0;
    color: var(--primary-color);
}
#setKeyBtn:hover {
    background-color: #f8f9fc;
    border-color: #d7dceb;
}
.btn-add-new {
    background: linear-gradient(180deg, #4e73df 0%, #2e59d9 100%);
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-add-new:hover {
    filter: brightness(1.05);
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e3e6f0;
    border-radius: 25px;
    background-color: #f8f9fc;
    transition: all 0.3s ease;
    height: 40px;
    line-height: 40px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn-add-new {
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.btn-add-new:hover {
    transform: translateY(-1px);
}

/* Tabs */
.custom-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e3e6f0;
    padding-bottom: 1px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    color: var(--secondary-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -3px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Section Content */
.section-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.section-content.active {
    display: block;
}

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

/* Password Cards */
.passwords-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 60%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.passwords-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    cursor: pointer;
}
.passwords-item:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-1px);
}
.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6e7ff3 0%, #8c6ff0 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.item-title {
    font-weight: 700;
    color: #2e384d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-arrow {
    color: #98a2b3;
}

@media (max-width: 992px) {
    .passwords-list {
        width: 80%;
        max-width: 640px;
    }
}
@media (max-width: 768px) {
    .passwords-list {
        width: 100%;
        max-width: none;
    }
}

/* Documents Table */
.custom-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.custom-table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    color: #4e73df;
    font-weight: 600;
    padding: 1rem;
}

.custom-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e3e6f0;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover {
    background-color: #fafbfc;
}

.doc-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
    color: var(--info-color);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: var(--hover-shadow);
}
.modal-header h5 {
    font-weight: 700;
}
.copy-field .input-group .form-control {
    border-right: 0;
    height: 42px;
    line-height: 42px;
}
.copy-field .input-group .btn {
    border-left: 0;
    border-color: #e3e6f0;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-field .input-group .btn i {
    font-size: 1rem;
}
.modal-footer .btn {
    min-width: 100px;
    border-radius: 10px;
    font-weight: 600;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.view-inline .btn.btn-sm {
    height: 30px;
    line-height: 30px;
    padding: 0 12px;
    border-radius: 8px;
}
.view-inline #viewUrlDomain {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-header {
    border-bottom: 1px solid #f1f3f9;
    background-color: #f8f9fc;
    border-radius: 15px 15px 0 0;
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    border-color: var(--primary-color);
}

.copy-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
}

.type-selector {
    display: flex;
    gap: 10px;
}

.type-selector .btn {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-header {
        flex-direction: row;
        gap: 0.75rem;
    }
    .search-bar {
        flex: 1 1 auto;
        min-width: 160px;
        margin: 0;
    }
    .header-actions {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .btn-add-new,
    #setKeyBtn {
        width: auto;
    }
}
