/* Shared styles for Feedback App */
:root {
    --bg: #0f1220;
    --text: #eaeaf0;
    --card: #151936;
    --border: #2a2f4a;
    --field: #0f132a;
    --accent: #8ad;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    font-family: system-ui, Arial, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    margin: 0
}

a {
    color: var(--accent)
}

.card {
    max-width: 960px;
    margin: 40px auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25)
}

.card.narrow {
    max-width: 420px
}

.card.medium {
    max-width: 560px
}

input,
select,
textarea,
button {
    width: 100%;
    padding: 12px 14px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #39406b;
    background: var(--field);
    color: var(--text)
}

textarea {
    min-height: 120px;
    resize: vertical
}

button {
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease
}

button:hover {
    opacity: .95
}

button:active {
    opacity: .9
}

/* Button-like anchor */
.btn {
    display: inline-block;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #39406b;
    background: var(--field);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease
}

.btn:hover {
    opacity: .95
}

.btn:active {
    opacity: .9
}

label {
    display: block;
    margin-top: 8px
}

/* Layout rows with wrapping */
.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.row>* {
    flex: 1 1 220px;
    min-width: 200px
}

/* Table styles with horizontal scroll on small screens */
.table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 12px
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 720px
}

th,
td {
    border: 1px solid var(--border);
    padding: 8px;
    vertical-align: top
}

th {
    background: var(--card);
    position: sticky;
    top: 0
}

.pager {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap
}

.muted {
    opacity: .8;
    font-size: 14px
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.ml-auto {
    margin-left: auto
}

/* Top bar with user avatar */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar h2 {
    margin: 0 0 8px 0;
}

.user-menu {
    margin-left: auto;
    position: relative;
}

.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    padding: 0;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #2b2f58;
    display: none; /* hidden by default; shown if image fails */
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #cfd3ff;
}

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: #1a1e3d;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    padding: 6px;
    display: none;
    z-index: 10;
}

.dropdown.open {
    display: block;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 10px 12px;
    border-radius: 8px;
}

.dropdown-item:hover {
    background: #242a59;
}

.dropdown-item.danger:hover {
    background: #4a2434;
}

/* Toast */
.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: #1b2040;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease
}

.toast.show {
    opacity: 1;
    transform: translateY(0)
}

/* Inputs of fixed small width when needed */
input[type="number"].w90 {
    width: 90px
}

/* Responsive tweaks */
@media (max-width:600px) {
    body {
        padding: 12px
    }

    .card {
        padding: 16px;
        margin: 20px auto
    }
}
