* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ─── Login ─────────────────────────────────────── */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

.login-container h1 {
    font-size: 2rem;
    color: #1a73e8;
}

.login-container p {
    color: #666;
    margin-bottom: 1rem;
}

/* ─── Buttons ───────────────────────────────────── */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: #1a73e8;
    color: white;
}
.btn-primary:hover { background: #1557b0; }

.btn-secondary {
    background: #e8eaed;
    color: #333;
}
.btn-secondary:hover { background: #d2d5d9; }

.btn-danger {
    background: #d93025;
    color: white;
}
.btn-danger:hover { background: #b3261e; }

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* ─── Header ────────────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#user-email {
    color: #666;
    font-size: 0.85rem;
}

/* ─── Projects Grid ─────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.project-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.project-card .icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.project-card h3 {
    font-size: 1.1rem;
    color: #1a73e8;
}

.project-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 3rem;
}

/* ─── Admin Layout ──────────────────────────────── */
.admin-layout {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: #1a73e8; }
.tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.tab-content { display: block; }
.tab-content.hidden { display: none; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ─── Tables ────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafafa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td { font-size: 0.9rem; }

tr:last-child td { border-bottom: none; }

/* ─── Modal ─────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal h3 {
    margin-bottom: 1.2rem;
    color: #1a73e8;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

/* ─── Checkbox-Liste (User-Zuweisungen) ─────────── */
.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
}

.checkbox-item:hover {
    background: #f5f7fa;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.modal hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1rem 0;
}

/* ─── Feedback-Widget (Chatbot) ─────────────────── */
.feedback-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 900;
}

.feedback-bubble {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    border: none;
    border-radius: 999px;
    background: #1a73e8;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,115,232,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.feedback-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,115,232,0.5);
}

.feedback-bubble-icon { font-size: 1.2rem; }

.feedback-panel {
    width: 340px;
    max-width: calc(100vw - 3rem);
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: feedback-pop 0.18s ease-out;
}

@keyframes feedback-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.feedback-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem;
    background: #1a73e8;
    color: white;
    font-weight: 600;
}

.feedback-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
.feedback-close:hover { background: rgba(255,255,255,0.2); }

.feedback-panel-body {
    padding: 1.1rem;
    overflow-y: auto;
    max-height: 70vh;
}

.feedback-intro {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.feedback-hint {
    font-size: 0.75rem;
    color: #888;
    margin: 0.5rem 0 1rem;
    line-height: 1.4;
}

.feedback-status {
    margin-top: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}
.feedback-status.success { background: #e6f4ea; color: #1e7e34; }
.feedback-status.error { background: #fce8e6; color: #c5221f; }

/* ─── Sterne-Rating ─────────────────────────────── */
.star-rating {
    display: flex;
    gap: 0.2rem;
}

.star-rating .star {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #d0d0d0;
    cursor: pointer;
    padding: 0;
    transition: color 0.1s, transform 0.1s;
}
.star-rating .star:hover { transform: scale(1.1); }
.star-rating .star.filled { color: #fbbc04; }

/* ─── Badges ────────────────────────────────────── */
.tab-badge,
.inbox-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d93025;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 0.3rem;
}

/* ─── Admin: Feedback-Liste ─────────────────────── */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-card {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.feedback-card.unread {
    border-left: 4px solid #1a73e8;
}

.feedback-card-head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    flex-wrap: wrap;
}
.feedback-card-head:hover { background: #f8f9fb; }

.feedback-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.feedback-card-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a73e8;
    flex-shrink: 0;
}

.feedback-card-stars {
    color: #fbbc04;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.feedback-card-meta {
    font-size: 0.78rem;
    color: #888;
}

.feedback-card-body {
    padding: 0 1.1rem 1rem;
    border-top: 1px solid #f0f0f0;
}

.feedback-card-text {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
    margin: 0.8rem 0;
    white-space: pre-wrap;
}

.feedback-card-actions {
    display: flex;
    justify-content: flex-end;
}

.feedback-read-label {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* ─── Mobile ────────────────────────────────────── */
@media (max-width: 600px) {
    .feedback-widget {
        right: 1rem;
        bottom: 1rem;
    }
    .feedback-panel {
        position: fixed;
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        width: auto;
        max-width: none;
    }
    .feedback-panel-body { max-height: 65vh; }
    .feedback-card-head { gap: 0.4rem; }
}

/* ─── Admin: ausklappbare User-Zeilen ───────────── */
.user-row { cursor: pointer; }
.user-row:hover { background: #f8f9fb; }

.user-caret {
    display: inline-block;
    font-size: 0.7rem;
    color: #999;
    transition: transform 0.15s;
    margin-right: 0.3rem;
}
.user-caret.open { transform: rotate(90deg); }

.user-detail-row td {
    background: #f8f9fb;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.user-detail {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #555;
}

.user-detail-label {
    display: inline-block;
    font-weight: 600;
    color: #888;
    margin-right: 0.4rem;
}

.user-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

/* Zugewiesene Apps: einzeilig, bei Bedarf horizontal scrollbar */
.user-detail-apps {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #555;
    min-width: 0;
}
.user-apps-list {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
}
.user-app-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    cursor: default;
}
.user-app-icon-emoji {
    font-size: 1.25rem;
    line-height: 1;
}
.user-app-icon-img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}
.user-apps-empty {
    color: #999;
    font-style: italic;
}

/* ─── Section-Header: mehrere Aktionen ──────────── */
.section-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ─── User-Verwaltung: Suche + Pagination ─────────────────────────── */
.users-toolbar {
    margin-bottom: 1rem;
}

.user-search-input {
    width: 100%;
    max-width: 360px;
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.user-search-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination.hidden {
    display: none;
}

.pagination-info {
    font-size: 0.85rem;
    color: #666;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
