/* ===== CSS VARIABLES – CHANGE THESE TO CUSTOMIZE ===== */
:root {
    --primary: #5b9bd5;
    --primary-dark: #4a8bc2;
    --primary-light: #f4f9ff;
    --primary-gradient: linear-gradient(135deg, #5b9bd5, #7bafd8);

    --sidebar-bg: #1a2634;
    --sidebar-text: #b0c4d9;
    --sidebar-active: #2c3e50;
    --sidebar-border: #2c3e50;

    --body-bg: #f4f7fc;
    --card-bg: #ffffff;
    --card-border: #f0f2f5;

    --text-dark: #1a2634;
    --text-muted: #6c7a89;
    --text-light: #8a9aa8;

    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    --progress-bg: #e9ecef;
    --progress-fill: #5b9bd5;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(91,155,213,0.10);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.2);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}
a {
    text-decoration: none;
    color: inherit;
}
a:hover {
    text-decoration: none;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--sidebar-bg);
    color: #fff;
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
}
.sidebar.open {
    left: 0;
}
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-header h2 i {
    color: var(--primary);
}
.sidebar-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
}
.sidebar-close:hover {
    color: #fff;
}
.sidebar-nav {
    flex: 1;
    padding: 100px 0;
    display: flex;
    flex-direction: column;
}
.sidebar-nav a {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--sidebar-text);
    transition: 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a i {
    width: 20px;
    text-align: center;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--primary);
}
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 16px 80px 16px;
    min-height: 100vh;
}
.main-content.shifted {
    margin-left: 280px;
}

/* ===== TOP HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 20px 0;
    border-bottom: 1px solid var(--card-border);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hamburger {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
}
.hamburger:hover {
    color: var(--primary);
}
.greeting {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.time-display {
    font-size: 14px;
    color: var(--text-muted);
}
.header-right i {
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}
.header-right i:hover {
    color: var(--primary);
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}

/* ===== MAIN HABIT CARD (deprecated – now using progress pie) ===== */
.main-habit-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 16px;
    align-items: center;
    border: 1px solid rgba(91, 155, 213, 0.08);
}
.habit-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    flex-shrink: 0;
}
.habit-info {
    flex: 1;
}
.habit-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-dark);
}
.habit-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.habit-progress-circle {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 8px 0;
}
.habit-progress-circle svg {
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
}
.habit-progress-circle .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}
.habit-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    flex-wrap: wrap;
}
.habit-meta span i {
    margin-right: 4px;
    color: var(--primary);
}

/* ===== CALENDAR ===== */
.calendar-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.month-year {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}
.calendar-nav button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 6px;
}
.calendar-nav button:hover {
    color: var(--primary);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    padding: 6px 0;
}
.day {
    font-size: 14px;
    padding: 8px 0;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-dark);
    transition: 0.15s;
}
.day.completed {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
.day.today {
    border: 2px solid var(--primary);
    font-weight: 700;
}
.day.empty {
    visibility: hidden;
}
.day:not(.empty):hover {
    background: var(--primary-light);
}

/* ===== STATS ===== */
.stats-section {
    margin: 0;
}
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}
.stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ===== HABIT LIST ===== */
.habit-list-section h3 {
    font-size: 16px;
    margin: 16px 0 10px 0;
    color: var(--text-dark);
}
.habit-list {
    list-style: none;
    padding: 0;
}
.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    transition: 0.2s;
}
.habit-item.done {
    background: var(--primary-light);
    border-color: #d0e4f7;
}
.habit-item .habit-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.habit-name {
    font-weight: 500;
    color: var(--text-dark);
}
.habit-points {
    font-size: 13px;
    color: var(--text-light);
    background: var(--progress-bg);
    padding: 2px 10px;
    border-radius: 30px;
}
.btn-done {
    background: var(--progress-bg);
    border: none;
    border-radius: 30px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    min-width: 64px;
}
.btn-done.done {
    background: var(--primary);
    color: white;
}
.btn-done:hover {
    opacity: 0.8;
}

/* ===== FAB ===== */
.create-habit-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}
.create-habit-fab button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(91, 155, 213, 0.4);
    transition: 0.2s;
}
.create-habit-fab button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    max-width: 460px;
    width: 92%;
    padding: 28px 24px 32px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}
.modal-close:hover {
    color: var(--text-dark);
}
.modal-content h2 {
    font-size: 22px;
    margin-bottom: 18px;
    color: var(--text-dark);
}
.habit-type-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.type-option {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--card-border);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}
.type-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.type-option i {
    display: block;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 4px;
}
.type-option span {
    font-weight: 600;
    font-size: 14px;
    display: block;
}
.type-option small {
    font-size: 11px;
    color: var(--text-light);
}
#create-habit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#create-habit-form input,
#create-habit-form select {
    padding: 12px 16px;
    border: 1px solid #dce2eb;
    border-radius: 12px;
    font-size: 15px;
    background: #fafbfc;
}
#create-habit-form input:focus,
#create-habit-form select:focus {
    border-color: var(--primary);
    outline: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.category-suggestions {
    margin-top: 24px;
}
.category-suggestions p {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.category-item {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: 0.2s;
}
.category-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.category-item .cat-icon {
    font-size: 24px;
    display: block;
}
.category-item .cat-name {
    font-weight: 600;
    font-size: 13px;
    display: block;
    margin: 4px 0 2px;
}
.category-item small {
    font-size: 10px;
    color: var(--text-light);
}

/* ===== DAY DETAILS MODAL ===== */
#day-detail-modal .modal-content {
    max-width: 420px;
}
#day-detail-body ul {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}
#day-detail-body ul li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}
#day-detail-body ul li:last-child {
    border-bottom: none;
}

/* ===== OTHER ELEMENTS ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.login-container {
    max-width: 400px;
    margin: 80px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}
.login-container input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.login-container button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.login-container button:hover {
    background: var(--primary-dark);
}
.error, .warning, .info, .success {
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
}
.error {
    background: #f8d7da;
    color: #721c24;
}
.warning {
    background: #fff3cd;
    color: #856404;
}
.info {
    background: #d1ecf1;
    color: #0c5460;
}
.success {
    background: #d4edda;
    color: #155724;
}
.progress-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
.progress-label {
    font-weight: 600;
    margin-bottom: 8px;
}
.progress-bar {
    background: var(--progress-bg);
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
}
.progress-bar > div {
    background: var(--progress-fill);
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease;
}
.progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #555;
}
.progress-bar.small {
    height: 12px;
}
.progress-bar.small > div {
    background: #6c5b7b;
}

/* Settings list */
.settings-list li {
    justify-content: space-between;
}
.actions {
    display: flex;
    gap: 10px;
}
.edit-btn, .delete-btn, .btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}
.edit-btn {
    background: var(--warning);
    color: #212529;
}
.edit-btn:hover {
    background: #e0a800;
}
.delete-btn, a.delete-btn {
    background: var(--danger);
    color: white;
}
.delete-btn:hover {
    background: #c82333;
}
.btn {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-block;
}
.btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

/* Forms */
.form-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}
.form-card form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.form-card input, .form-card select {
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    flex: 1 0 150px;
}
.form-card button {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.form-card button:hover {
    background: var(--primary-dark);
}

/* ===== GOAL PAGE ===== */
.goal-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: 0.2s;
}
.goal-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.goal-card.completed {
    border-left: 4px solid var(--success);
}
.goal-card.active {
    border-left: 4px solid var(--primary);
}
.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.goal-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}
.goal-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 30px;
    text-transform: uppercase;
}
.goal-status.completed {
    background: #d4edda;
    color: #155724;
}
.goal-status.active {
    background: #d1ecf1;
    color: #0c5460;
}
.goal-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}
.goal-meta i {
    margin-right: 4px;
    color: var(--primary);
}
.days-remaining {
    margin-left: auto;
}
.goal-points {
    margin-top: 8px;
    font-size: 14px;
}
.goal-points strong {
    color: var(--text-dark);
}
.goal-card .delete-btn {
    margin-top: 12px;
    display: inline-block;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    color: #dce2eb;
}

/* Tables */
.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-table th, .user-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}
.user-table th {
    background: #f1f4f8;
    font-weight: 600;
}
.user-table tr:hover {
    background: #f8f9fa;
}

/* Charts */
.chart-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin: 25px 0;
}
.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* Edit modal (simple) */
#edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
#edit-modal .modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
}
#edit-modal .modal-content h3 {
    margin-bottom: 15px;
}
#edit-modal .modal-content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#edit-modal .modal-content input {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
}
#edit-modal .modal-content button {
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
#edit-modal .modal-content button:hover {
    background: var(--primary-dark);
}

/* ===== ANALYTICS SUMMARY CARDS ===== */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.summary-icon {
    font-size: 28px;
    color: var(--primary);
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.summary-info {
    flex: 1;
}
.summary-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}
.summary-label {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== CHARTS GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.chart-container {
    background: var(--card-bg);
    padding: 18px 20px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.chart-container h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* ===== SETTINGS SUMMARY CARDS ===== */
.settings-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.settings-summary .summary-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.settings-summary .summary-icon {
    font-size: 24px;
    color: var(--primary);
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-summary .summary-info {
    flex: 1;
}
.settings-summary .summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}
.settings-summary .summary-label {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== PROGRESS CONTAINER (Settings) ===== */
.progress-container {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    margin-bottom: 24px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.progress-label span:first-child {
    font-weight: 600;
    color: var(--text-dark);
}
.progress-bar {
    background: var(--progress-bg);
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
}
.progress-bar > div {
    background: var(--primary-gradient);
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s ease;
}

/* ===== HABIT LIST IMPROVEMENTS (Settings) ===== */
.settings-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.settings-list .habit-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.settings-list .habit-icon {
    color: var(--primary);
    font-size: 18px;
    width: 28px;
    text-align: center;
}
.settings-list .habit-name {
    font-weight: 500;
    color: var(--text-dark);
}
.settings-list .habit-points {
    font-size: 13px;
    padding: 2px 12px;
    border-radius: 30px;
    background: var(--progress-bg);
    color: var(--text-muted);
}
.settings-list .habit-points.high {
    background: #f8d7da;
    color: #721c24;
}
.settings-list .habit-points.medium {
    background: #fff3cd;
    color: #856404;
}
.settings-list .habit-points.low {
    background: #d4edda;
    color: #155724;
}
.settings-list .actions {
    display: flex;
    gap: 8px;
}
.settings-list .edit-btn,
.settings-list .delete-btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.2s;
}
.settings-list .edit-btn {
    background: var(--warning);
    color: #212529;
}
.settings-list .edit-btn:hover {
    background: #e0a800;
}
.settings-list .delete-btn {
    background: var(--danger);
    color: white;
}
.settings-list .delete-btn:hover {
    background: #c82333;
}

/* ===== EDIT MODAL (Settings) ===== */
#edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
#edit-modal .modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    padding: 28px 24px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
#edit-modal .modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
}
#edit-modal .modal-close:hover {
    color: var(--text-dark);
}
#edit-modal h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}
#edit-modal h3 i {
    color: var(--primary);
    margin-right: 8px;
}
#edit-modal form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#edit-modal label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: -4px;
}
#edit-modal input {
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    font-size: 15px;
}
#edit-modal input:focus {
    border-color: var(--primary);
    outline: none;
}
#edit-modal button {
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
#edit-modal button:hover {
    background: var(--primary-dark);
}
/* ===== ADMIN TABLE ===== */
.table-responsive {
    overflow-x: auto;
    margin-top: 8px;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-table thead {
    background: var(--body-bg);
}
.user-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.user-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    font-size: 14px;
    vertical-align: middle;
}
.user-table tbody tr:hover {
    background: var(--primary-light);
}
.user-table .badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.user-table .btn-sm {
    padding: 4px 14px;
    font-size: 13px;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    transition: 0.2s;
}
.user-table .btn-sm:hover {
    background: var(--primary-dark);
    color: white;
}
.user-table .empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}
/* ===== USER DETAILS ===== */
.badge.done-badge {
    background: var(--secondary-light);
    color: var(--secondary);
}
.habit-item .habit-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.habit-item .habit-dot.purple { background: var(--primary); }
.habit-item .habit-dot.green { background: var(--secondary); }
.habit-item .habit-dot.orange { background: #FF9800; }
.habit-item .habit-dot.blue { background: var(--info); }
.habit-item .habit-dot.red { background: var(--danger); }
/* ===== PROFILE HEADER ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--card-bg);
    padding: 24px 28px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    margin-bottom: 24px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-name h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}
.profile-name p {
    margin: 4px 0;
    color: var(--text-muted);
    font-size: 14px;
}
.profile-name p i {
    width: 20px;
    color: var(--primary);
}

/* ===== PROFILE STATS ===== */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.profile-stats .stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--card-border);
}
.profile-stats .stat-icon {
    font-size: 28px;
    color: var(--primary);
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-stats .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}
.profile-stats .stat-label {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== PROFILE FORM ===== */
.profile-form-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid var(--card-border);
}
.profile-form-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}
.profile-form-card h3 i {
    color: var(--primary);
    margin-right: 8px;
}
.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.profile-form .form-group {
    display: flex;
    flex-direction: column;
}
.profile-form .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.profile-form .form-group label .required {
    color: var(--danger);
}
.profile-form .form-group input {
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.2s;
}
.profile-form .form-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}
.profile-form .password-wrapper {
    position: relative;
}
.profile-form .password-wrapper input {
    width: 100%;
    padding-right: 40px;
}
.profile-form .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
}
.profile-form .toggle-password:hover {
    color: var(--primary);
}
.profile-form hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 20px 0;
}
.profile-form .btn-primary {
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.profile-form .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

/* ===== PROGRESS PIE CARD ===== */
.progress-pie-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px 20px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(91, 155, 213, 0.06);
    text-align: center;
}
.pie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.pie-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}
.pie-percentage {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}
.pie-chart-wrapper {
    max-width: 200px;
    margin: 4px auto 6px;
}
.pie-stats {
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: var(--text-muted);
}
.pie-stats strong {
    color: var(--text-dark);
}

/* ===== DAY DETAILS MODAL IMPROVEMENTS ===== */
.detail-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
}
.chart-wrapper {
    max-width: 250px;
    margin: 10px auto;
}
#day-habit-list {
    margin-top: 15px;
}
#day-habit-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--card-border);
}
#day-habit-list li:last-child {
    border-bottom: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        left: -280px;
    }
    .sidebar.open {
        left: 0;
    }
    .hamburger {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 12px 12px 80px 12px;
    }
    .main-content.shifted {
        margin-left: 0;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .main-habit-card {
        flex-direction: row;
        align-items: center;
    }
    .calendar-section {
        grid-column: auto;
    }
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .habit-list {
        grid-template-columns: 1fr;
    }
    .goal-list {
        grid-template-columns: 1fr;
    }
    .form-card form {
        flex-direction: column;
        align-items: stretch;
    }
    .form-card input, .form-card select {
        flex: auto;
        width: 100%;
    }
    .create-habit-fab {
        bottom: 20px;
        right: 20px;
    }
    .create-habit-fab button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .header-left .greeting {
        font-size: 16px;
    }
    .time-display {
        display: none;
    }
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
    .analytics-summary {
        grid-template-columns: 1fr 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .settings-summary {
        grid-template-columns: 1fr 1fr;
    }
    .settings-list li {
        flex-direction: column;
        align-items: stretch;
    }
    .settings-list .actions {
        justify-content: flex-end;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }
    .profile-form .form-row {
        grid-template-columns: 1fr;
    }
    .profile-form .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .goal-meta {
        flex-direction: column;
        gap: 4px;
    }
    .days-remaining {
        margin-left: 0;
    }
}

@media (min-width: 769px) {
    .sidebar {
        left: 0;
    }
    .sidebar-close {
        display: none;
    }
    .hamburger {
        display: none;
    }
    .main-content {
        margin-left: 280px;
        padding: 30px 40px 30px 40px;
        max-width: 100%;
    }
    .main-content.shifted {
        margin-left: 280px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .main-habit-card {
        grid-column: 1 / 2;
        flex-direction: row;
        align-items: center;
    }
    .calendar-section {
        grid-column: 2 / 3;
    }
    .stats-section {
        grid-column: 1 / 3;
    }
    .habit-list-section {
        grid-column: 1 / 3;
    }
    .habit-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .habit-item {
        margin-bottom: 0;
    }
    .create-habit-fab {
        position: fixed;
        bottom: 30px;
        right: 30px;
        left: auto;
        transform: none;
    }
}