* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #111827;
    color: #f9fafb;
    font-family: Arial, sans-serif;
}

button,
a {
    font-family: inherit;
}

/* HEADER */

header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px;
    background: #1f2937;
    border-bottom: 1px solid #374151;
}

header h1 {
    margin: 0;
    font-size: 20px;
}

header .user {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* USER MENU */

.user-menu {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: center;
}

.user-menu-arrow {
    font-size: 10px;
    transition: transform 0.15s ease;
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 100%;
    padding: 5px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 1000;
}

.user-menu.open .user-dropdown {
    display: block;
}

.user-dropdown button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #d1d5db;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}

.user-dropdown button:hover {
    background: #374151;
}

.user-dropdown .logout-button {
    color: #fca5a5;
}

.user-dropdown .logout-button:hover {
    background: #451a1a;
}

/* STATUS */

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    white-space: nowrap;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6b7280;
}

.online {
    color: #4ade80;
}

.online .status-dot {
    background: #22c55e;
}

.offline {
    color: #9ca3af;
}

/* COMMON BUTTONS */

header button,
header a,
.back-button {
    padding: 8px 14px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

header button:hover,
header a:hover,
.back-button:hover {
    background: #374151;
}

.download-button {
    padding: 8px 14px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.download-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* PAGE TITLE */

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-title h2 {
    margin: 0;
    font-size: 26px;
}

/* COMMON BUTTONS */

.primary-button {
    padding: 10px 16px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    cursor: pointer;
}

.primary-button:hover {
    background: #1d4ed8;
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.secondary-button {
    padding: 10px 16px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
}

.secondary-button:hover {
    background: #374151;
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* COMMON STATES */

.empty {
    padding: 30px;
    text-align: center;
    color: #9ca3af;
    background: #1f2937;
    border-radius: 10px;
}

.error {
    padding: 20px;
    background: #451a1a;
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    color: #fca5a5;
}

.loading {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
}