/* CSS Variables & Global */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #818cf8;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --success: #10b981;
    --danger: #ef4444;
}

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

input,
select,
textarea,
button {
    font-family: inherit;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#layout-header {
    width: 100%;
    z-index: 2000;
    position: sticky;
    top: 0;
    background: var(--bg);
}

#layout-main {
    flex: 1;
    width: 100%;
}

#layout-footer {
    width: 100%;
    padding: 0.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.9);
}

/* Test Mode Borders */
body.test-mode #layout-header {
    border: 2px solid red !important;
}

body.test-mode #layout-main {
    border: 2px solid yellow !important;
}

body.test-mode #layout-footer {
    border: 2px solid blue !important;
}

.footer-container {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-biz-name {
    font-size: 0.5rem;
    color: var(--text);
    opacity: 0.9;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.footer-info-details {
    display: none;
    width: 100%;
    padding: 1rem 0;
    font-size: 0.5rem;
    color: var(--text);
    opacity: 0.6;
    text-align: left;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
}

.footer-info-details.show {
    display: block;
}

.footer-links {
    display: flex;
    gap: 0.8rem;
}

.footer-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.5rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.4;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.footer-btn:hover {
    opacity: 0.8;
}

/* Navbar styles */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.nav-back-btn:hover {
    opacity: 0.7;
}

.nav-right {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.5rem 0.8rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.nav-user-info:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-user-info span {
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.9;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

/* Notification Bell */
.nav-noti-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

.nav-noti-wrapper:hover {
    background: rgba(255, 255, 255, 0.05);
}

.noti-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* User Profile Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: none;
    overflow-y: auto;
    max-height: 66vh;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.nav-dropdown.show {
    display: block;
}

.dropdown-header {
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    overflow: hidden;
}

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

.header-text {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-text .name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-text .role {
    font-size: 0.7rem;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dropdown-items {
    padding: 0.6rem;
}

.dropdown-items a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0.8rem;
    transition: all 0.2s;
}

.dropdown-items a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-items hr {
    margin: 0.6rem;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-items .logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Layout */
.container {
    width: 100%;
    max-width: none;
    margin: 2rem 0;
    padding: 0 1.5rem;
    overflow: auto;
}

.card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Buttons */
.btn {
    height: 3rem;
    padding: 0 1.4rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
}

.btn-primary {
    background: rgba(99, 102, 241, 0.3);
    color: white;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glass {
    height: auto;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glass:active {
    transform: translateY(0);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Calendar */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav button {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 0.6rem;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
}

.calendar-day-header {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.4;
    background: var(--card-bg);
}

.calendar-day {
    background: var(--card-bg);
    min-height: 100px;
    padding: 0.75rem;
    position: relative;
    transition: background 0.2s;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.02);
}

.day-number {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.calendar-day.today .day-number {
    color: var(--primary);
    font-weight: 800;
    opacity: 1;
}

.day-event {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.4rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.1);
    cursor: pointer;
}

.day-event.event-start {
    border-left: 3px solid var(--primary);
}

/* Status Badges */
.stat-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Transactions */
.transaction-item {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tx-info .tx-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.tx-info .tx-date {
    font-size: 0.8rem;
    opacity: 0.4;
}

.tx-amount {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tx-amount.unpaid {
    color: #f87171;
}

.tx-amount.paid {
    color: #4ade80;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.unpaid .status-dot {
    background: #f87171;
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

.paid .status-dot {
    background: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1e293b;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.8rem;
    color: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

option {
    background-color: #1e293b;
    color: #f8fafc;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.add-small-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.delete-small-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* User Status Badges */
.user-status-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.user-status-badge.status-승인 {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.user-status-badge.status-임시 {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.user-status-badge.status-신청 {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.user-status-badge.status-종료,
.user-status-badge.status-거절 {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}