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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #eef2fb;
    color: #1e293b;
    min-height: 100vh;
    font-size: 12px;
}

/* ─── Login ─────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
}
.login-box {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(30,58,138,0.25);
    width: 360px;
}
.login-box h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e3a8a;
    font-size: 20px;
    font-weight: 700;
}
.login-box .form-group { margin-bottom: 12px; }
.login-box label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
}
.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"],
.login-box input[type="tel"] {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #bfdbfe;
    border-radius: 6px;
    font-size: 12px;
    background: #f8faff;
    color: #1e293b;
    transition: border-color 0.2s;
}
.login-box input:focus { outline: none; border-color: #2563eb; background: #fff; }
.login-box button {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 4px;
}
.login-box button:hover { opacity: 0.88; }
.login-error {
    color: #3b82f6;
    text-align: center;
    margin-bottom: 10px;
    font-size: 12px;
    background: #eff6ff;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}
.login-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 12px;
    text-align: center;
}

/* ─── Layout ────────────────────────────────── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ─── Sidebar ───────────────────────────────── */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.25s ease;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(30,58,138,0.18);
}
.sidebar-collapsed .sidebar { width: 52px; }
.no-sidebar-transition .sidebar,
.no-sidebar-transition .main-content { transition: none !important; }
.sidebar-header {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s, width 0.25s;
}
.sidebar-collapsed .sidebar-title { opacity: 0; width: 0; pointer-events: none; }
.sidebar-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #bfdbfe;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.28); color: #fff; }
.sidebar-header .user-info {
    font-size: 11px;
    color: #93c5fd;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}
.sidebar-collapsed .user-info { opacity: 0; height: 0; margin-top: 0; }
.sidebar-nav { flex: 1; padding: 5px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #bfdbfe;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; border-left-color: rgba(255,255,255,0.3); }
.sidebar-nav a.active { background: rgba(255,255,255,0.18); color: #fff; border-left-color: #60a5fa; font-weight: 600; }
.sidebar-nav a .icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { transition: opacity 0.2s; }
.sidebar-collapsed .nav-label { opacity: 0; pointer-events: none; }
.sidebar-footer { padding: 7px 12px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #93c5fd;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: color 0.2s;
}
.sidebar-footer a .icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-footer a:hover { color: #fff; }

.main-content {
    flex: 1;
    padding: 30px 32px 28px;
    overflow-y: auto;
    transition: margin-left 0.25s ease;
    min-width: 0;
    background: #ffffff;
    box-sizing: border-box;
}

/* ─── 공통 페이지 상단 타이틀바 ─────────────── */
.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
}

/* ─── Dashboard ─────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}
.page-header h1 { font-size: 15px; color: #1e3a8a; font-weight: 700; }
.week-label {
    font-size: 11px;
    color: #2563eb;
    background: #dbeafe;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid #bfdbfe;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(30,58,138,0.08);
    border: 1px solid #e8eef8;
    border-left: 4px solid #bfdbfe;
}
.stat-card .stat-label { font-size: 10px; color: #64748b; margin-bottom: 2px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: #1e3a8a; }
.stat-card.total { border-left-color: #93c5fd; }
.stat-card.active { border-left-color: #60a5fa; }
.stat-card.completed { border-left-color: #3b82f6; }
.stat-card.total .stat-value { color: #1d4ed8; }
.stat-card.active .stat-value { color: #2563eb; }
.stat-card.completed .stat-value { color: #1e3a8a; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dash-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(30,58,138,0.08);
    border: 1px solid #e8eef8;
}
.dash-card h3 { font-size: 12px; margin-bottom: 8px; color: #1e3a8a; font-weight: 600; }
.quadrant-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    height: 120px;
}
.q-mini { border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.q-mini .q-mini-label { font-size: 9px; font-weight: 500; margin-top: 1px; }
.q-mini.q1 { background: #dbeafe; color: #1d4ed8; }
.q-mini.q2 { background: #eff6ff; color: #2563eb; }
.q-mini.q3 { background: #f1f5f9; color: #64748b; }
.q-mini.q4 { background: #e0e7ff; color: #4338ca; }
.recent-list { list-style: none; }
.recent-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f4fc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list .todo-title { font-size: 12px; color: #475569; text-decoration: line-through; opacity: 0.7; }
.recent-list .todo-date { font-size: 11px; color: #93c5fd; white-space: nowrap; margin-left: 6px; }

/* ─── Top Title Bar (ToDo관리 버튼 묶음) ────── */
.top-title-actions { display: flex; align-items: center; gap: 5px; }

.btn-search {
    padding: 4px 12px;
    background: #1e3a8a;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-search:hover { background: #1d4ed8; }

.btn-excel {
    padding: 4px 10px;
    background: #fff;
    color: #1e3a8a;
    border: 1.5px solid #93c5fd;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-excel:hover { background: #dbeafe; border-color: #2563eb; color: #1d4ed8; }

/* ─── Top Control Bar ───────────────────────── */
.top-control-bar {
    background-color: #f8faff;
    background-image: linear-gradient(90deg, #ff0000, #ff7700, #ffdd00, #00cc00, #0099ff, #6633cc, #cc00cc);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 8px;
    padding: 5px 10px;
    padding-top: 7px;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(30,58,138,0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#topControlBody { display: flex; flex-direction: column; gap: 4px; }
.top-control-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 6px;
}
.top-control-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 14px;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    border-top: none;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 8px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(30,58,138,0.08);
    transition: background 0.15s, color 0.15s;
}
.top-control-toggle:hover { background: #cbd5e1; color: #475569; }
.top-control-toggle:hover { background: #dbeafe; color: #2563eb; border-color: #93c5fd; }
.top-bar-row { display: flex; align-items: center; gap: 5px; }
.top-bar-label {
    font-size: 11px;
    font-weight: 700;
    color: #1e3a8a;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 52px;
}

/* 조회조건 50/50 레이아웃 */
.top-bar-half {
    display: flex;
    align-items: center;
    gap: 0;
}
.top-bar-half-left {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 50%;
    flex-shrink: 0;
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid #e8eef8;
}
.top-bar-half-right {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 50%;
    flex-shrink: 0;
    min-width: 0;
    padding-left: 12px;
    overflow: hidden;
}
.search-input-full {
    flex: 1;
    min-width: 0;
}

/* 그룹 토글 버튼 바 */
.group-toggle-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.group-toggle-btn {
    padding: 3px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    background: #f8faff;
    color: #4472ca;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.group-toggle-btn:hover { background: #dbeafe; }
.group-toggle-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }

/* 할일등록 그룹 선택 */
.add-group-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start;
}
.add-group-btn {
    padding: 0 5px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.8;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.add-group-btn:hover { background: #e2e8f0; color: #475569; border-color: #94a3b8; }
.add-group-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.group-add-hint {
    font-size: 9px;
    color: #94a3b8;
    align-self: center;
    white-space: nowrap;
}

/* ─── Todos Page ────────────────────────────── */
.todos-layout {
    display: flex;
    gap: 8px;
    flex: 1;
    min-height: 0;
}
.left-panel {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}
.right-panel { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.panel-card {
    background: #f5f8ff;
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 1px 3px rgba(30,58,138,0.07);
    border: 1px solid #d0e1fb;
}
#addTodoCard {
    background-color: #f0f9ff;
    background-image: linear-gradient(90deg, #1e3a8a, #2563eb, #60a5fa);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top;
    border: 1px solid #bfdbfe;
    border-top: none;
    padding-top: 0px;
}
.add-todo-wrap {
    display: flex;
    flex-direction: column;
    background-color: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.add-todo-wrap:hover {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12), 0 4px 16px rgba(124, 58, 237, 0.10);
}
.add-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8faff;
    background-image: linear-gradient(90deg, #1e3a8a, #2563eb, #60a5fa);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top;
    border-radius: 0;
    border-bottom: 1px solid #e2e8f0;
    height: 34px;
    min-height: 34px;
    padding: 3px 8px 0 8px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ─── Panel card 헤더 ───────────────────────── */
.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.panel-card-title { font-size: 12px; font-weight: 700; color: #1e3a8a; }
.btn-collapse {
    background: none;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    color: #3b82f6;
    font-size: 13px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.btn-collapse:hover { background: #dbeafe; border-color: #2563eb; color: #1d4ed8; }

/* ─── Add todo form ─────────────────────────── */
.add-todo-form { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: #ffffff; }
.add-todo-form textarea {
    width: 100%;
    padding: 5px 7px;
    border: 2px solid #bfdbfe;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 56px;
    line-height: 1.4;
    background: #f8faff;
    color: #1e293b;
    transition: border-color 0.2s;
}
.add-todo-form textarea:focus { outline: none; border-color: #2563eb; background: #fff; }
.btn-add-todo {
    display: block;
    margin: 0 auto;
    padding: 4px 28px;
    background: #1e3a8a;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-add-todo:hover { background: #1d4ed8; }

/* ─── 목표일 입력 ────────────────────────────── */
.add-target-row, .edit-target-row { display: flex; align-items: center; gap: 5px; }
.add-target-label { font-size: 11px; color: #64748b; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.add-target-input {
    flex: 1;
    padding: 3px 6px;
    border: 1.5px solid #bfdbfe;
    border-radius: 5px;
    font-size: 12px;
    background: #f8faff;
    color: #1e293b;
    cursor: pointer;
}
.add-target-input:focus { outline: none; border-color: #2563eb; }

/* ─── Filters ───────────────────────────────── */
.filter-section { display: flex; flex-direction: column; gap: 4px; }
.radio-group { display: flex; gap: 2px; flex-shrink: 0; }
.radio-group label {
    padding: 3px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    color: #4472ca;
    background: #f8faff;
    white-space: nowrap;
}
.radio-group label:hover { background: #dbeafe; }
.radio-group input { display: none; }
.radio-group input:checked + label { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }
.search-input {
    padding: 3px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    font-size: 12px;
    flex: 1;
    min-width: 100px;
    background: #f8faff;
    color: #1e293b;
    transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: #2563eb; background: #fff; }

/* ─── Week nav ──────────────────────────────── */
.week-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.week-nav > button {
    padding: 0 8px;
    background: #f1f5f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.8;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.week-nav > button:hover { background: #e2e8f0; color: #475569; border-color: #94a3b8; }

.btn-copy-prev {
    padding: 4px 12px;
    background: #1e3a8a;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-copy-prev:hover { background: #1d4ed8; }

/* ─── Todo list (left) ──────────────────────── */
.todo-list-panel {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background-color: #f5f8ff;
    background-image: linear-gradient(90deg, #1e3a8a, #2563eb, #60a5fa);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top;
    border-top: none !important;
    padding-top: 9px;
    display: flex;
    flex-direction: column;
    padding: 7px 6px 5px 6px;
}
.q-filter-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
/* 그룹 버튼과 동일 디자인 */
.q-filter-btn {
    padding: 0 5px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.8;
    text-align: center;
    width: auto;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.q-filter-btn:hover  { background: #e2e8f0; color: #475569; border-color: #94a3b8; }
.q-filter-btn.active { background: #3b82f6; color: #fff;     border-color: #3b82f6; }

.todo-list { list-style: none; flex: 1; overflow-y: auto; min-height: 0; }
.todo-list li {
    padding: 6px 4px;
    border-bottom: 1px solid #f0f4fc;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.todo-list li:last-child { border-bottom: none; }
.todo-list .q-badge { font-size: 10px; padding: 1px 4px; border-radius: 3px; font-weight: 700; flex-shrink: 0; }
.q-badge.q1 { background: #dbeafe; color: #1d4ed8; }
.q-badge.q2 { background: #eff6ff; color: #2563eb; }
.q-badge.q3 { background: #f1f5f9; color: #475569; }
.q-badge.q4 { background: #e0e7ff; color: #4338ca; }
.todo-list .todo-text {
    flex: 1;
    line-height: 1.3;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.todo-list .todo-text.done { text-decoration: line-through; opacity: 0.55; }
.fail-badge {
    font-size: 8px;
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 3px;
    padding: 1px 3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}
/* 반복 할일 배지 */
.rec-badge {
    font-size: 9px;
    flex-shrink: 0;
    margin-right: 1px;
    line-height: 1.4;
}
li.is-recurring-item {
    border-left: 2px solid #f59e0b;
    background: #fffbeb;
}
li.is-recurring-item.done .todo-label {
    opacity: 0.65;
}
.todo-actions { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.btn-edit {
    background: none;
    border: none;
    color: #93c5fd;
    cursor: pointer;
    font-size: 12px;
    padding: 1px 3px;
    transition: color 0.2s;
    line-height: 1;
}
.btn-edit:hover { color: #2563eb; }
.btn-delete {
    background: none;
    border: none;
    color: #bfdbfe;
    cursor: pointer;
    font-size: 13px;
    padding: 1px 3px;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}
.btn-delete:hover { color: #93c5fd; }

/* ─── 인라인 수정 폼 ─────────────────────────── */
.edit-form { width: 100%; margin-top: 3px; display: flex; flex-direction: column; gap: 3px; }
.edit-group-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start;
}
.edit-input {
    width: 100%;
    padding: 4px 6px;
    border: 1.5px solid #2563eb;
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 96px;
    line-height: 1.4;
    background: #f8faff;
    color: #1e293b;
}
.edit-input:focus { outline: none; }
.edit-form-actions { display: flex; justify-content: center; gap: 6px; }
.btn-save-edit {
    padding: 3px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-save-edit:hover { background: #1d4ed8; }
.btn-cancel-edit {
    padding: 3px 12px;
    background: #fff;
    color: #64748b;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-cancel-edit:hover { background: #f1f5f9; border-color: #94a3b8; }

/* ─── D-day 배지 ────────────────────────────── */
.dday-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
    margin-right: 1px;
}
.dday-ok  { background: #dbeafe; color: #1d4ed8; }
.dday-over{ background: #fee2e2; color: #b91c1c; }

/* ─── 복사 횟수 뱃지 ─────────────────────────── */
.copy-badge { font-size: 11px; font-weight: 700; color: #7c3aed; flex-shrink: 0; margin-right: 1px; line-height: 1; opacity: 0.85; }

/* ─── 과거 주차 안내 배너 ───────────────────── */
.past-week-notice {
    background: #fef9c3;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
}

/* ─── 이월됨 뱃지 ───────────────────────────── */
.copied-badge {
    font-size: 9px;
    font-weight: 700;
    color: #9ca3af;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 1px 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* 이월된 사분면 항목 — 흐리게 + 클릭 커서 제거 */
.quadrant-list li.is-copied {
    opacity: 0.55;
    cursor: default !important;
}
.quadrant-list li.is-copied:hover { box-shadow: none; background: rgba(255,255,255,0.65); }

/* ─── 더보기 점 ─────────────────────────────── */
.more-dot { display: inline; color: #93c5fd; font-size: 10px; font-weight: 700; margin-left: 2px; vertical-align: middle; flex-shrink: 0; }

/* ─── Quadrant Grid ─────────────────────────── */
.quadrant-wrapper { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 0; }
.axis-label-top    { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 10px; margin-bottom: 2px; }
.axis-top-center   { grid-column: 2; text-align: center; color: #2563eb; font-weight: 700; white-space: nowrap; }
.quadrant-hint     { grid-column: 1; text-align: left; font-size: 10px; color: #94a3b8; font-weight: 400; white-space: nowrap; padding: 5px 0; }
.axis-label-bottom { text-align: center; font-size: 10px; color: #93c5fd; margin-top: 2px; font-weight: 600; }
.quadrant-with-axes { display: flex; align-items: stretch; flex: 1; min-height: 0; }
.axis-label-left {
    writing-mode: vertical-rl;
    text-orientation: sideways;
    transform: rotate(180deg);
    font-size: 10px;
    color: #93c5fd;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}
.quadrant-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 4px;
    padding: 0 2px;
}
.axis-label-right {
    writing-mode: vertical-rl;
    font-size: 10px;
    color: #2563eb;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}
.quadrant-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    min-height: 0;
}
.quadrant-box {
    border-radius: 7px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e8edf2;
    transition: box-shadow 0.2s ease;
}
.quadrant-box:hover {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12), 0 4px 16px rgba(124, 58, 237, 0.10);
}
.quadrant-box.q1 { background: #ffffff; border: 1px solid #e8edf2; }
.quadrant-box.q2 { background: #ffffff; border: 1px solid #e8edf2; }
.quadrant-box.q3 { background: #ffffff; border: 1px solid #e8edf2; }
.quadrant-box.q4 { background: #ffffff; border: 1px solid #e8edf2; }
.quadrant-box .q-title {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 0;
    background: #f8faff;
    border-radius: 6px 6px 0 0;
    padding: 5px 8px;
    border-bottom: 1px solid #e8edf2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-align: center;
}
.q1 .q-title { color: #1d4ed8; }
.q2 .q-title { color: #0284c7; }
.q3 .q-title { color: #64748b; }
.q4 .q-title { color: #4338ca; }
.q-count { background: rgba(255,255,255,0.8); padding: 1px 5px; border-radius: 8px; font-size: 10px; border: 1px solid rgba(0,0,0,0.05); }
.q-label {
    font-size: 8px; font-weight: 800; letter-spacing: 0.02em;
    padding: 1px 5px; border-radius: 4px;
    background: #e0f2fe; color: #0369a1;
    border: 1px solid #bae6fd; white-space: nowrap;
}
.q1 .q-label {
    background: #fee2e2; color: #b91c1c;
    border-color: #fecaca;
}
.quadrant-list { list-style: none; flex: 1; min-height: 30px; padding: 5px 6px; margin: 0; }
.quadrant-list li {
    padding: 6px 4px;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.65);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
    border: 1px solid rgba(147,197,253,0.2);
}
.quadrant-list li:not(.is-copied):hover { box-shadow: 0 2px 6px rgba(37,99,235,0.10); background: rgba(255,255,255,0.95); }
.quadrant-list li.ui-sortable-helper { box-shadow: 0 4px 12px rgba(37,99,235,0.18); cursor: grabbing; opacity: 0.92; }
.quadrant-list li .todo-row { cursor: pointer; }
.quadrant-list li .todo-row { display: flex; align-items: center; gap: 4px; }
.quadrant-list li .todo-row input[type="checkbox"] { width: 13px; height: 13px; cursor: pointer; accent-color: #2563eb; flex-shrink: 0; }
.quadrant-list li .todo-label {
    flex: 1;
    cursor: pointer;
    line-height: 1.3;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.quadrant-list li .todo-label.done { text-decoration: line-through; opacity: 0.55; }
.quadrant-list .placeholder { border: 2px dashed #93c5fd; background: rgba(219,234,254,0.3); border-radius: 4px; min-height: 22px; }

/* ─── Click 버튼 (사분면) ───────────────────── */
.click-btn {
    font-size: 8px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    padding: 1px 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
    user-select: none;
}
.click-btn:hover { background: #dbeafe; border-color: #93c5fd; }

/* ─── Complete form ─────────────────────────── */
/* sortable li 의 grab 커서·user-select:none 상속 차단 */
.complete-form,
.complete-form * {
    cursor: auto;
    user-select: text !important;
    -webkit-user-select: text !important;
}
.complete-form textarea,
.complete-form input[type="date"],
.complete-form input[type="text"] { cursor: text !important; }
.complete-form button { cursor: pointer !important; }
.complete-form label  { cursor: pointer !important; }

.form-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    min-width: 44px;
    flex-shrink: 0;
}
.complete-full-content {
    font-size: 11px;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 4px 7px;
    line-height: 1.5;
    margin-bottom: 4px;
    word-break: break-word;
    white-space: pre-wrap;
}
.complete-result-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 3px;
    flex-wrap: nowrap;
}
/* 한 줄 체크박스 행 */
.complete-one-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.chk-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: #334155;
}
.chk-fail-label { color: #b91c1c; }
.chk-fup-label  { color: #d97706; }
/* 완료내용 label + textarea 행 */
.complete-content-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}
.complete-content-label {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}
.ccl-bullet {
    font-size: 11px;
    color: #1e3a8a;
    font-weight: 700;
    align-self: center;
    flex-shrink: 0;
}
.ccl-text {
    font-size: 10px;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
    text-align: left;
    min-width: 28px;   /* 세 행(완료내용/목표일/후속작업) 너비 통일 */
}
.title-with-checks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.title-with-checks .complete-one-row { margin-bottom: 0; }

/* 할일내용 textarea (편집 가능 / readonly) */
.complete-title-ta {
    width: 100%;
    padding: 3px;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    font-size: 11px;
    resize: vertical;
    min-height: 44px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    transition: background 0.2s;
}
.complete-title-ta:focus  { outline: none; border-color: #2563eb; }
.complete-title-ta[readonly] {
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
    border-color: #e2e8f0;
}

.complete-note-ta {
    flex: 1;
    padding: 3px;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    font-size: 11px;
    resize: vertical;
    min-height: 34px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
}
.complete-note-ta:focus { outline: none; border-color: #2563eb; }
/* 후속작업 섹션 */
.followup-section {
    margin-top: 4px;
    padding: 5px 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.followup-date-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.followup-date-input {
    flex: 1;
    padding: 2px 5px;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
}
.followup-date-input:focus { outline: none; border-color: #f59e0b; }

/* 후속작업 textarea */
.followup-ta {
    flex: 1;
    padding: 3px;
    border: 1px solid #fcd34d;
    border-radius: 3px;
    font-size: 11px;
    resize: vertical;
    min-height: 34px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
}
.followup-ta:focus { outline: none; border-color: #f59e0b; }
.result-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.success-label { color: #1d4ed8; }
.failure-label { color: #b91c1c; }
.complete-form {
    margin-top: 3px;
    padding: 4px;
    background: #f0f6ff;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid #bfdbfe;
}
.modal-top-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.modal-group-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.modal-target-date { border: 1px solid #bfdbfe; border-radius: 4px; font-size: 11px; padding: 2px 6px; background: #fff; color: #1e293b; }
.complete-form .modal-group-btn,
.todo-modal-body .complete-form .modal-group-btn {
    padding: 0 5px !important;
    margin-top: 0 !important;
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    line-height: 1.8 !important;
    align-self: auto !important;
}
.complete-form .modal-group-btn:hover,
.todo-modal-body .complete-form .modal-group-btn:hover { background: #e2e8f0 !important; color: #475569 !important; border-color: #94a3b8 !important; }
.complete-form .modal-group-btn.active,
.todo-modal-body .complete-form .modal-group-btn.active { background: #3b82f6 !important; color: #fff !important; border-color: #3b82f6 !important; }
.complete-form button {
    align-self: center;
    padding: 2px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.complete-form button:hover { background: #1d4ed8; }

/* ─── followup_created=1 잠금 상태 ─────────── */
.complete-form.followup-locked .complete-title-ta,
.complete-form.followup-locked .complete-note-ta {
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
}
.complete-form.followup-locked .chk-done,
.complete-form.followup-locked .chk-fail,
.complete-form.followup-locked .chk-fup {
    opacity: 0.5;
    cursor: not-allowed;
}
.complete-form.followup-locked .chk-label {
    color: #94a3b8;
    cursor: default;
}
/* 미도래 반복 할일 — 완료/실패/후속작업 비활성화 스타일 */
.complete-form.not-yet-locked .chk-done,
.complete-form.not-yet-locked .chk-fail,
.complete-form.not-yet-locked .chk-fup {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(1);
}
.complete-form.not-yet-locked .chk-label {
    color: #b0bec5;
    cursor: default;
}
.complete-form.not-yet-locked .chk-fail-label { color: #b0bec5; }
.complete-form.not-yet-locked .chk-fup-label  { color: #b0bec5; }
.followup-locked-notice {
    font-size: 10px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 3px 6px;
    margin-bottom: 2px;
}

/* ─── Todo Item Modal ───────────────────────── */
.todo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.todo-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(30, 58, 138, 0.3);
    width: 480px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.15s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}
.todo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #1e3a8a;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}
.todo-modal-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}
.todo-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.75;
    flex-shrink: 0;
}
.todo-modal-close:hover { opacity: 1; }
.todo-modal-body {
    padding: 14px 16px 16px;
    overflow-y: auto;
    flex: 1;
}
/* ─── 부모 할일 정보 섹션 ───────────────────── */
.parent-info-section {
    background: #f0f6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 11px;
}
.parent-info-loading {
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
    padding: 6px 0;
}
/* 헤더: 제목 왼쪽 + 배지 오른쪽 */
.parent-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #bfdbfe;
}
.pi-header-title {
    font-size: 11px;
    font-weight: 700;
    color: #1e3a8a;
    white-space: nowrap;
}
/* 배지 묶음 (헤더 오른쪽) */
.pi-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}
.pi-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pi-q1 { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.pi-q2 { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.pi-q3 { background:#e0e7ff; color:#3730a3; border-color:#c7d2fe; }
.pi-q4 { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.pi-badge-active { background:#dbeafe; color:#1e40af; border-color:#bfdbfe; }
.pi-badge-done   { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }
.pi-badge-ok     { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.pi-badge-fail   { background:#fee2e2; color:#991b1b; border-color:#fecaca; }

.parent-info-body { display: flex; flex-direction: column; gap: 7px; }

/* 필드 공통 */
.pi-field { display: flex; flex-direction: column; gap: 3px; }
.pi-field-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

/* read-only input (회색 배경) */
.pi-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-family: inherit;
    cursor: default;
    outline: none;
}
.pi-input:focus { border-color: #bfdbfe; background: #f1f5f9; }

/* read-only textarea (회색 배경, 스크롤 없음) */
.pi-ta {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    cursor: default;
    outline: none;
    line-height: 1.5;
    min-height: 30px;
}
.pi-ta:focus { border-color: #bfdbfe; background: #f1f5f9; }

/* 날짜 행: 3개 셀을 가로 배치, 각 셀은 라벨+값 한 줄 */
.pi-date-row {
    display: flex;
    gap: 10px;
}
.pi-date-cell {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}
.pi-date-cell .pi-input {
    font-size: 10px;
    flex: 1;
    min-width: 0;
}

/* 레거시 호환 */
.pi-success { color: #1d4ed8; font-weight: 700; }
.pi-fail    { color: #b91c1c; font-weight: 700; }

/* 모달 내부 complete-form 재정의 */
.todo-modal-body .complete-form {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    gap: 8px;
}
.todo-modal-body .complete-form button {
    margin-top: 8px;
    padding: 6px 36px;
    font-size: 12px;
}

/* ─── Floating Tooltip ──────────────────────── */
.float-tooltip {
    display: none;
    position: fixed;
    z-index: 99999;
    max-width: 270px;
    padding: 0;
    background: #1e3a8a;
    color: #e0eaff;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 7px;
    box-shadow: 0 5px 16px rgba(30,58,138,0.32);
    pointer-events: none;
    word-break: break-word;
    white-space: normal;
    overflow: hidden;
}
.tooltip-dday {
    background: rgba(255,255,255,0.12);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tooltip-dates {
    padding: 3px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tooltip-meta { display: flex; gap: 5px; align-items: baseline; font-size: 9px; line-height: 1.4; }
.tm-label { color: #93c5fd; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.tm-val   { color: #c7d9f5; }
.tooltip-body { padding: 5px 11px; }

/* ─── Toast ─────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 14px;
    right: 14px;
    background: #1e3a8a;
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(30,58,138,0.28);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ─── Empty state ───────────────────────────── */
.empty-state { text-align: center; color: #93c5fd; font-size: 12px; padding: 10px 0; }

/* ─── ToDo Settings Page ─────────────────────── */
.ts-wrap {
    height: 100%;
    box-sizing: border-box;
}
.ts-page-sub { font-size: 12px; color: #64748b; }

/* 카드 */
.ts-card {
    background: #f1f5f9;
    background-image: linear-gradient(90deg, #1e3a8a, #2563eb, #60a5fa);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top;
    border-radius: 12px;
    border-top: none;
    box-shadow: 0 2px 12px rgba(30,58,138,0.08);
    margin-bottom: 20px;
    padding: 20px 50px;
    padding-top: 23px;
}

/* 카드 내 행: 설명 왼쪽 / 컨트롤 오른쪽 */
.ts-card-row {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.ts-card-desc {
    flex: 1;
    min-width: 0;
}
.ts-card-label {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}
.ts-card-hint {
    font-size: 11px;
    color: #64748b;
    line-height: 1.6;
}

/* 오른쪽 컨트롤 영역 */
.ts-card-ctrl {
    width: 320px;
    flex-shrink: 0;
}
/* 카카오 토글처럼 수직 중앙 정렬이 필요한 경우 */
.ts-card-ctrl-center {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}
.ts-toggle-label { font-size: 12px; }

/* 그룹 입력 행 */
.ts-group-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.ts-text-input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #bfdbfe;
    border-radius: 6px;
    font-size: 12px;
    background: #f8faff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}
.ts-text-input:focus { border-color: #2563eb; background: #fff; }

/* 버튼들 */
.ts-btn-add {
    padding: 6px 14px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.ts-btn-add:hover { opacity: 0.88; }

.ts-btn-edit {
    padding: 3px 9px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.ts-btn-edit:hover { background: #dbeafe; }

.ts-btn-del {
    padding: 3px 9px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.ts-btn-del:hover { background: #fecaca; }

.ts-btn-save {
    padding: 3px 9px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.ts-btn-cancel {
    padding: 3px 9px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

/* 그룹 목록 */
.ts-group-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}
.ts-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    transition: background 0.15s;
}
.ts-group-item:hover { background: #eff6ff; }
.ts-group-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}
.ts-group-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.ts-group-default-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

/* 인라인 편집 */
.ts-inline-edit {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}
.ts-edit-input {
    flex: 1;
    padding: 3px 8px;
    font-size: 12px;
}

/* ─── Admin Page ─────────────────────────────── */
.admin-wrap {
    height: 100%;
    box-sizing: border-box;
}
.admin-page-sub {
    font-size: 12px;
    color: #64748b;
}

/* 섹션 카드 */
.admin-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30,58,138,0.08);
    margin-bottom: 24px;
    overflow: hidden;
}
.admin-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(90deg, #f0f6ff 0%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
}
.admin-section-icon { font-size: 16px; }
.admin-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    flex: 1;
}
.admin-section-badge {
    background: #2563eb;
    color: #fff;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
}
.admin-section-body {
    padding: 20px;
}

/* 설정 행 */
.admin-setting-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.admin-setting-row:last-child { border-bottom: none; }
.admin-setting-info { flex: 1; }
.admin-setting-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 3px;
}
.admin-setting-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.6;
}
.toggle-status { min-width: 48px; }

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: background 0.25s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle-switch input:checked + .toggle-slider { background: #2563eb; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* 작은 토글 */
.toggle-sm {
    width: 36px;
    height: 20px;
}
.toggle-sm .toggle-slider::before {
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
}
.toggle-sm input:checked + .toggle-slider::before { transform: translateX(16px); }

/* 배지 */
.badge-on {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.badge-off {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.badge-admin {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* 회원 테이블 */
.admin-table-wrap {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.admin-table thead tr {
    background: #f8faff;
}
.admin-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.admin-table tbody tr:hover { background: #f8faff; }
.td-center { text-align: center; }

.btn-del-user {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-del-user:hover { background: #fecaca; }

.verified-badge, .admin-badge {
    margin-left: 6px;
    vertical-align: middle;
}

/* ════════════════════════════════════════════
   반응형 (Responsive)
   Breakpoints:
     Mobile  : ≤ 768px
     Tablet  : 769px ~ 1024px
     Desktop : ≥ 1025px  (기존 레이아웃)
════════════════════════════════════════════ */

/* ── 햄버거 버튼 (모바일 전용) ──────────────── */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    box-shadow: 0 2px 8px rgba(30,58,138,0.30);
    transition: opacity 0.2s;
}
.hamburger-btn:hover { opacity: 0.88; }
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s;
}

/* ── 사이드바 백드롭 (모바일) ───────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1050;
}
.sidebar-backdrop.active { display: block; }

/* ════════════════════════════════
   Mobile  ≤ 768px
════════════════════════════════ */
@media (max-width: 768px) {
    /* 햄버거 버튼 표시 */
    .hamburger-btn { display: flex; }

    /* 사이드바: 화면 왼쪽 고정 오버레이 */
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1060;
        width: 200px !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease, width 0.25s ease;
        box-shadow: 4px 0 20px rgba(30,58,138,0.25);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* collapsed 상태에서도 모바일은 항상 full sidebar */
    .sidebar-collapsed .sidebar {
        width: 200px !important;
        transform: translateX(-100%);
    }
    .sidebar-collapsed .sidebar.mobile-open {
        transform: translateX(0);
    }
    /* collapsed 된 상태에서 숨겨진 요소들 복원 */
    .sidebar-collapsed .nav-label { opacity: 1 !important; pointer-events: auto !important; }
    .sidebar-collapsed .sidebar-title { opacity: 1 !important; width: auto !important; pointer-events: auto !important; }
    .sidebar-collapsed .user-info { opacity: 1 !important; height: auto !important; margin-top: 3px !important; }

    /* 사이드바 토글 버튼 → 닫기(×) 버튼으로 활용 */
    .sidebar-toggle { display: flex; }

    /* 메인 콘텐츠: 전체 너비 + 상단 햄버거 여백 */
    .main-content {
        padding: 60px 16px 16px;
    }

    /* ── 공통 페이지 헤더 ── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* ── 로그인 / 회원가입 ── */
    .login-box {
        width: calc(100% - 32px);
        max-width: 360px;
        padding: 24px 16px;
    }

    /* 조회조건 바 */
    .top-bar-half {
        flex-direction: column;
        gap: 4px;
    }
    .top-bar-half-left,
    .top-bar-half-right {
        width: 100% !important;
        padding: 0 !important;
        border: none !important;
    }
    .top-title-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .top-title-actions {
        flex-wrap: wrap;
    }

    /* ── ToDo Settings ── */
    .ts-card {
        padding: 16px;
        padding-top: 19px;
    }
    .ts-card-row {
        flex-direction: column;
        gap: 12px;
    }
    .ts-card-ctrl { width: 100% !important; }
    /* ── 관리자 페이지 ── */
    .admin-section-body { padding: 12px; }
    .admin-setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* ── 메모 페이지 ── */
    .memo-top-bar { flex-wrap: wrap; gap: 8px; }
}

/* ════════════════════════════════
   Tablet  769px ~ 1024px
════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 사이드바 축소 */
    .sidebar { width: 160px; }
    .sidebar-collapsed .sidebar { width: 52px; }

    /* 메인 콘텐츠 */
    .main-content { padding: 32px 20px 20px; }

    /* ── ToDo 관리 ── */
    .left-panel { width: 230px; }

    /* 조회조건 바 */
    .top-bar-half-left,
    .top-bar-half-right { padding-left: 8px; padding-right: 8px; }

    /* ── ToDo Settings ── */
    .ts-card { padding: 18px 28px; }
    .ts-card-ctrl { width: 240px; }
}
