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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
}

.config-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.config-status.configured {
    background: #10b981;
    color: white;
}

.config-status.not-configured {
    background: #ef4444;
    color: white;
}

.config-panel, .main-content {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.config-panel h2, .main-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.toolbar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.vaults-list, .certificates-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.vault-card, .cert-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vault-card:hover, .cert-card:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.vault-card h3, .cert-card h3 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.vault-card p, .cert-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.cert-card .cert-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-status.enabled {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.cert-status.disabled {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.cert-card .cert-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

.cert-card .cert-actions button {
    padding: 6px 12px;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #dc2626;
    font-weight: 500;
}

.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #10b981;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 40px auto;
    padding: 40px;
    border-radius: 12px;
    width: 95%;
    max-width: 900px;
    max-height: calc(100vh - 80px);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.modal-content h2 {
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #3b82f6;
}

.close {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    z-index: 10;
    background: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close:hover {
    color: #ef4444;
    background: #fee2e2;
    transform: rotate(90deg);
}

#certDetails {
    margin-top: 20px;
}

#certDetails h3 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3b82f6;
}

#certDetails .detail-row {
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
}

#certDetails .detail-row:last-of-type {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 10px;
}

#certDetails .detail-label {
    font-weight: 600;
    color: #64748b;
    font-size: 15px;
}

#certDetails .detail-value {
    color: #1e293b;
    font-size: 15px;
    word-break: break-all;
}

.certificates-section {
    margin-top: 20px;
}

#backBtn {
    margin-bottom: 15px;
}

#uploadBtn {
    margin-bottom: 15px;
    margin-left: 10px;
}


/* Versions List */
.versions-list {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.versions-list::-webkit-scrollbar {
    width: 10px;
}

.versions-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.versions-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.versions-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.version-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 14px;
    transition: all 0.2s ease;
}

.version-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
}

.version-item.current-version {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    border-width: 3px;
}

.version-item > div {
    margin-bottom: 8px;
    font-size: 15px;
}

.version-item strong {
    color: #1e293b;
    font-weight: 600;
}

.version-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}
