:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #0F0F0F;
    --bg-card: #1A1A1A;
    --bg-card-hover: #1F1F1F;
    --gold: #C9A961;
    --gold-rgb: 201, 169, 97;
    --gold-light: #D4B872;
    --gold-dim: rgba(201, 169, 97, 0.7);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-subtle: rgba(255, 255, 255, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-gold: rgba(201, 169, 97, 0.2);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--gold);
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Shared site header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--gold);
    text-decoration: none;
}

.btn-cta {
    padding: 6px 16px;
    background: var(--gold);
    color: #000;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
}

.btn-cta:hover {
    background: var(--gold-light);
}

.header-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-nav .nav-links {
    display: flex;
    gap: 10px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.header-nav .nav-links::-webkit-scrollbar {
    display: none;
}

.header-nav .nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s;
    flex-shrink: 0;
}

.header-nav .nav-links a:hover {
    color: var(--gold);
}

.login-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.login-link:hover {
    color: var(--gold);
}

.user-menu-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notify-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.notify-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.user-menu-trigger {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Pretendard', sans-serif;
}

.menu-caret {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: #f4f4f4;
    color: #0f0f0f;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    z-index: 120;
}

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

.user-menu-top {
    padding: 18px 18px 8px;
    display: flex;
    justify-content: center;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d8d8d8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-name {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    padding: 0 18px;
}

.user-menu-role {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 2px 18px 14px;
}

.user-menu-actions {
    border-top: 1px solid #e0e0e0;
    display: flex;
}

.user-menu-actions > a,
.user-menu-actions > form {
    flex: 1;
    min-width: 0;
}

.user-menu-actions > * + * {
    border-left: 1px solid #e0e0e0;
}

.user-menu-actions a,
.user-menu-actions button {
    display: block;
    width: 100%;
    padding: 12px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Pretendard', sans-serif;
}

.user-menu-actions form {
    margin: 0;
}

.user-menu-actions a:hover,
.user-menu-actions button:hover {
    background: #e8e8e8;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-body {
    padding: 24px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gold);
    color: #000;
}

.btn-primary:hover {
    background: var(--gold-light);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-gold);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-back {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-back:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label,
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-select,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-subtle);
}

.form-input:focus,
.form-select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.1);
}

.form-group select option {
    background: var(--bg-primary);
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.table thead {
    background: var(--bg-secondary);
}

.table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.user-role-badge {
    background: rgba(201, 169, 97, 0.16);
    color: var(--gold);
    border: 1px solid var(--border-gold);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    animation: slideUp 0.22s ease-out;
}

/* Toast / Alert */
.toast,
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fca5a5;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* Responsive utilities */
.hide-mobile {
    display: block;
}

.hide-desktop {
    display: none;
}

@media (min-width: 768px) {
    .header-nav .nav-links {
        gap: 16px;
        overflow-x: visible;
    }

    .header-nav .nav-links a,
    .login-link {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .navbar-container,
    .header-top,
    .header-nav {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hide-mobile {
        display: none;
    }

    .hide-desktop {
        display: block;
    }
}

/* Scrollbar */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.35);
    border-radius: 999px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

/* Motion */
.fade-in {
    animation: fadeIn 0.35s ease-out both;
}

.slide-up {
    animation: slideUp 0.28s ease-out both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
