:root {
    --primary-color: #2E7D32;
    --primary-dark: #1B5E20;
    --accent-color: #FBC02D;
    --bg-color: #F8FAF9;
    --sidebar-bg: #102B13;
    --text-color: #2D3436;
    --text-muted: #636E72;
    --white: #FFFFFF;
    --border-color: #DFE6E9;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Sidebar */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 3rem;
    text-decoration: none;
    color: var(--white);
    line-height: 1.2;
}

.sidebar-header .logo .text {
    line-height: 1.3;
}

.logo .icon {
    font-size: 1.8rem;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item i {
    width: 20px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #FF7675;
    text-decoration: none;
    padding: 0.8rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.top-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.admin-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #E8F5E9;
    color: var(--primary-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.used .stat-icon {
    background: #E3F2FD;
    color: #1E88E5;
}

.stat-card.pending .stat-icon {
    background: #FFFDE7;
    color: #FBC02D;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 800;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-header.flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card.narrow {
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--bg-color);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-issued {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-used {
    background: #ECEFF1;
    color: #607D8B;
}

/* Forms */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Login Page Only */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2E7D32 0%, #102B13 100%);
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-header .logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-msg {
    color: #E74C3C;
    background: #FDEDEC;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

/* Copy Box */
.copy-box {
    background: #F4F7F6;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

#copy-text {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    resize: none;
    height: 300px;
    line-height: 1.5;
}

.btn-copy {
    background: #636E72;
    color: white;
    margin-top: 1rem;
}

/* Scan View Search */
.search-container {
    display: flex;
    gap: 1rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-color);
}