/* Admin Styles */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e0e0e0;
    --sidebar-active: #16213e;
    --primary: #4a6cf7;
    --header-height: 56px;
}

body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.mt-a { margin-top: 2.5rem; }

/* Login Page */
.login-bg { background: linear-gradient(135deg, #38bbbb99 0%, #2575c79e 100%), url(/images/back.jpg) center / cover no-repeat; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: white; border-radius: 16px; padding: 40px 32px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-card h3 { color: #333; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.admin-sidebar.show { transform: translateX(-100%); }

.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}
.admin-content.sidebar-collapsed {
    margin-left: 0 !important;
}

.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h5 { margin: 0; color: white; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active { background: var(--sidebar-active); color: white; }

.admin-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; }

.admin-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-right { display: flex; align-items: center; }
.admin-main { padding: 20px; background: #f8f9fa; flex: 1; }

/* Cards */
.card { border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-radius: 10px; transition:all .3s ease }
.card:hover { box-shadow: 4px 6px 8px rgba(0,0,0,0.15); }
.card-header { background: white; border-bottom: 1px solid #eee; font-weight: 600; }

/* Stats */
.stats-summary { display: flex; gap: 16px; }
.stat-card { background: white; border-radius: 10px; padding: 5px 15px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display:flex; flex-direction:row-reverse; align-items:center;}
.stat-number { font-size: 32px; font-weight: 700; color: var(--primary); margin-left: 10px; }
.stat-label { font-size: 15px; color: #999; margin-top: 4px; }
.big-btn { height: 58px; display:flex; align-items:center;}
/* Question Edit Cards */
.question-edit-card {
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.question-edit-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.question-edit-card.sortable-ghost { opacity: 0.4; }
.question-edit-card.sortable-chosen { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

.q-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}
.q-drag-handle { cursor: grab; color: #999; font-size: 16px; }
.q-drag-handle:active { cursor: grabbing; }
.q-type-badge { font-size: 12px; padding: 2px 8px; border-radius: 4px; color: white; }
.type-singlechoice { background: #4a6cf7; }
.type-multiplechoice { background: #af52de; }
.type-singletext { background: #5ac8fa; }
.type-multipletext { background: #34c759; }
.type-other { background: #ff9500; }
.q-required { font-size: 12px; color: #ff3b30; }
.q-card-actions { margin-left: auto; }
.q-card-body { padding: 12px 16px; font-size: 14px; }
.q-card-options { padding: 8px 16px 12px; }
.q-card-options .badge { margin-right: 6px; margin-bottom: 4px; padding: 4px 10px; }

/* Template Items */
.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.template-item:hover { border-color: var(--primary); background: rgba(74, 108, 247, 0.05); }
.template-name { flex: 1; }

/* Options Editor */
.option-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.option-row .form-control { flex: 1; }
.option-other-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}
.option-other-label input[type="checkbox"] { margin: 0; }

/* Answer Cards */
.answer-card { display: flex; gap: 12px; padding: 12px 16px; background: white; border-radius: 8px; margin-bottom: 8px; }
.answer-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.answer-content { flex: 1; }
.answer-question { font-weight: 500; margin-bottom: 4px; }
.answer-value { color: #666; }

/* Chart Container */
.chart-container { max-width: 100%; position: relative; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .stats-summary { flex-wrap: wrap; }
}
