/**
 * MuseBugs - Global SaaS UI Styles
 * Pretendard 웹폰트 + 모던 카드/버튼/사이드바 레이아웃
 */

/* -------------------------------------------------------------------------- */
/* Reset & Base                                                               */
/* -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f8fafc;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
}

/* -------------------------------------------------------------------------- */
/* Layout - App Shell (Sidebar + Main)                                        */
/* -------------------------------------------------------------------------- */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-brand-icon {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.nav-link.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-link-icon {
    width: 20px;
    text-align: center;
    opacity: 0.85;
}

.content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    min-width: 0;
}

/* -------------------------------------------------------------------------- */
/* Page Header                                                                */
/* -------------------------------------------------------------------------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-header h1,
.page-header h2 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.page-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-google {
    background-color: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-google:hover {
    background-color: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-kakao {
    background-color: #fee500;
    color: #191919;
}

.btn-kakao:hover {
    background-color: #f5d900;
    box-shadow: 0 2px 8px rgba(254, 229, 0, 0.4);
}

.btn-naver {
    background-color: #03c75a;
    color: #fff;
}

.btn-naver:hover {
    background-color: #02b350;
    box-shadow: 0 2px 8px rgba(3, 199, 90, 0.35);
}

.btn-apple {
    background-color: #000;
    color: #fff;
}

.btn-apple:hover {
    background-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* -------------------------------------------------------------------------- */
/* Form Inputs                                                                */
/* -------------------------------------------------------------------------- */

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* -------------------------------------------------------------------------- */
/* Badges & Stats                                                             */
/* -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.badge-success { background-color: #22c55e; }
.badge-warning { background-color: #f59e0b; }
.badge-danger  { background-color: #ef4444; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.stat-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.stat-box .label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-box .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* -------------------------------------------------------------------------- */
/* Alerts & Meta                                                              */
/* -------------------------------------------------------------------------- */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.text-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
}

.text-meta {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

/* -------------------------------------------------------------------------- */
/* Login Page                                                                 */
/* -------------------------------------------------------------------------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 45%),
        #f8fafc;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 40px 36px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 12px 48px rgba(15, 23, 42, 0.04);
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.login-desc {
    margin: 0 0 32px;
    font-size: 14px;
    color: #64748b;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-footer {
    margin-top: 28px;
    font-size: 12px;
    color: #94a3b8;
}

/* -------------------------------------------------------------------------- */
/* Dashboard Widgets                                                          */
/* -------------------------------------------------------------------------- */

.widget-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.widget-detail {
    font-size: 14px;
    color: #475569;
    margin: 8px 0;
}

.widget-detail code {
    word-break: break-all;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar-nav {
        padding-bottom: 8px;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-menu li {
        margin-bottom: 0;
    }

    .content {
        padding: 20px 16px;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.35rem;
    }
}
