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

body {
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 260px;
    background: #071a2f;
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.brand h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.brand p {
    font-size: 13px;
    color: #b8d7f0;
    margin-bottom: 32px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    color: #dbeafe;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    transition: 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(116, 227, 255, 0.16);
    color: #ffffff;
}

.logout-btn {
    margin-top: auto;
    background: #ef4444;
    border: none;
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 30px;
    margin-bottom: 6px;
}

.page-header p {
    color: #6b7280;
}

.create-btn {
    background: #0f2f52;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: bold;
}

.create-btn.small {
    display: inline-block;
    margin-top: 14px;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.toolbar input,
.toolbar select {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
}

.toolbar input {
    flex: 1;
}

.questionnaire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.card h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.card p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
}

.status {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: bold;
    height: fit-content;
}

.status.DRAFT {
    background: #fef3c7;
    color: #92400e;
}

.status.PUBLISHED {
    background: #dcfce7;
    color: #166534;
}

.status.ARCHIVED {
    background: #e5e7eb;
    color: #374151;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.card-actions button,
.card-actions a {
    border: none;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    color: white;
}

.edit-btn {
    background: #2563eb;
}

.preview-btn {
    background: #7c3aed;
}

.answer-btn {
    background: #0f766e;
}

.duplicate-btn {
    background: #0891b2;
}

.publish-btn {
    background: #16a34a;
}

.archive-btn {
    background: #6b7280;
}

.delete-btn {
    background: #dc2626;
}

.state-box {
    background: white;
    padding: 30px;
    border-radius: 18px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    color: #6b7280;
}

.hidden {
    display: none;
}

/* BUILDFRAME FOOTER */

.buildframe-footer {
    width: 100%;
    padding: 16px 18px;
    background: linear-gradient(135deg, #071a2f, #0f2f52);
    color: #ffffff;
    text-align: center;
    border-top: 1px solid rgba(116, 227, 255, 0.22);
}

.buildframe-credit {
    max-width: 980px;
    margin: 0 auto;
}

.buildframe-credit strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 3px;
}

.buildframe-credit span {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.buildframe-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.buildframe-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
}

.buildframe-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 800px) {
    .app-shell {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
    }

    .page-header,
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}