/* ========================================
   Master Pages — 세무사 관리자 공통
   ======================================== */

.ms-page {
    background: #0B1120;
    min-height: 100vh;
    font-family: var(--font-family);
    color: #E2E8F0;
}

.ms-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* --- Sidebar --- */
.ms-sidebar {
    background: #0F172A;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ms-sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.ms-sidebar-logo a { font-size: 20px; font-weight: 500; color: #FFFFFF; text-decoration: none; }
.ms-sidebar-logo a strong { font-weight: 800; color: #93B4FF; }
.ms-sidebar-logo small { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.3); margin-top: 4px; }

.ms-sidebar-nav { padding: 0 12px; }

.ms-nav-label {
    font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em; text-transform: uppercase; padding: 12px 12px 8px;
}

.ms-nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 8px; color: rgba(255, 255, 255, 0.5); font-size: 13px;
    font-weight: 500; cursor: pointer; transition: all 0.15s; text-decoration: none; margin-bottom: 2px;
}
.ms-nav-item i { font-size: 14px; width: 18px; text-align: center; }
.ms-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.8); }
.ms-nav-item.active { background: rgba(37, 99, 235, 0.15); color: #93B4FF; font-weight: 600; }

.ms-nav-badge {
    margin-left: auto; font-size: 11px; background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5; padding: 2px 8px; border-radius: 6px; font-weight: 600;
}

.ms-sidebar-user {
    margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; gap: 10px; position: absolute; bottom: 0; left: 0; right: 0;
    background: #0F172A;
}
.ms-sidebar-user-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(37, 99, 235, 0.15);
    display: flex; align-items: center; justify-content: center; font-size: 14px; color: #93B4FF;
}
.ms-sidebar-user-name { font-size: 13px; font-weight: 600; color: #FFFFFF; }
.ms-sidebar-user-role { font-size: 11px; color: rgba(255, 255, 255, 0.35); }

/* --- Main --- */
.ms-main { padding: 32px; overflow-y: auto; }

.ms-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px;
}
.ms-title { font-size: 24px; font-weight: 800; color: #FFFFFF; }
.ms-subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.4); margin-top: 4px; }

/* --- Dashboard Stats --- */
.ms-stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px;
}

.ms-stat-card {
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px; padding: 24px;
}
.ms-stat-card-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.ms-stat-card-icon {
    width: 40px; height: 40px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; font-size: 16px;
}
.ms-stat-card-icon.blue { background: rgba(37, 99, 235, 0.12); color: #93B4FF; }
.ms-stat-card-icon.green { background: rgba(16, 185, 129, 0.12); color: #6EE7B7; }
.ms-stat-card-icon.yellow { background: rgba(245, 158, 11, 0.12); color: #FCD34D; }
.ms-stat-card-icon.red { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; }
.ms-stat-card-icon.purple { background: rgba(99, 102, 241, 0.12); color: #A5B4FC; }

.ms-stat-change {
    font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.ms-stat-change.up { background: rgba(16, 185, 129, 0.12); color: #6EE7B7; }
.ms-stat-change.down { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; }

.ms-stat-value { font-size: 28px; font-weight: 800; color: #FFFFFF; margin-bottom: 4px; }
.ms-stat-label { font-size: 13px; color: rgba(255, 255, 255, 0.4); }

/* --- Table --- */
.ms-table-wrap {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px; overflow: hidden; margin-bottom: 24px;
}
.ms-table-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ms-table-title { font-size: 16px; font-weight: 700; color: #FFFFFF; }

.ms-table { width: 100%; border-collapse: collapse; }
.ms-table th {
    padding: 14px 20px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.4);
    text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.02);
}
.ms-table td {
    padding: 16px 20px; font-size: 14px; color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ms-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Status */
.ms-status {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    border-radius: 6px; font-size: 11px; font-weight: 600;
}
.ms-status-active { background: rgba(16, 185, 129, 0.15); color: #6EE7B7; }
.ms-status-pending { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
.ms-status-completed { background: rgba(37, 99, 235, 0.15); color: #93B4FF; }
.ms-status-cancelled { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }

/* Buttons */
.ms-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; font-family: var(--font-family); border: none;
}
.ms-btn-primary { background: var(--primary); color: #FFFFFF; }
.ms-btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.ms-btn-ghost {
    background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ms-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.ms-btn-danger { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }
.ms-btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.ms-btn-sm { padding: 6px 12px; font-size: 12px; }

/* --- Form --- */
.ms-form-card {
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px; padding: 32px; margin-bottom: 24px;
}
.ms-form-card h3 { font-size: 17px; font-weight: 700; color: #FFFFFF; margin-bottom: 6px; }
.ms-form-card > p { font-size: 13px; color: rgba(255, 255, 255, 0.35); margin-bottom: 24px; }

.ms-field { margin-bottom: 20px; }
.ms-field label { display: block; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.6); margin-bottom: 8px; }
.ms-field input, .ms-field select, .ms-field textarea {
    width: 100%; padding: 12px 16px; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; color: #FFFFFF;
    font-size: 14px; font-family: var(--font-family); outline: none; transition: all 0.2s; box-sizing: border-box;
}
.ms-field input:focus, .ms-field select:focus, .ms-field textarea:focus {
    border-color: rgba(37, 99, 235, 0.5); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ms-field textarea { min-height: 100px; resize: vertical; }
.ms-field select option { background: #1E293B; color: #E2E8F0; }
.ms-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- Empty --- */
.ms-empty {
    text-align: center; padding: 60px 24px;
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}
.ms-empty i { font-size: 40px; color: rgba(255, 255, 255, 0.1); margin-bottom: 16px; }
.ms-empty h3 { font-size: 17px; color: rgba(255, 255, 255, 0.5); margin-bottom: 8px; }
.ms-empty p { font-size: 14px; color: rgba(255, 255, 255, 0.3); }

/* --- Responsive --- */
@media (max-width: 1023px) {
    .ms-layout { grid-template-columns: 1fr; }
    .ms-sidebar { display: none; }
    .ms-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .ms-main { padding: 20px; }
    .ms-stat-grid { grid-template-columns: 1fr; }
    .ms-table-wrap { overflow-x: auto; }
    .ms-table { min-width: 600px; }
    .ms-field-row { grid-template-columns: 1fr; }
}
