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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #070b1a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #00FFD9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: #0a1020;
    border-bottom: 1px solid #1a2535;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.logo:hover {
    text-decoration: none;
    color: #00FFD9;
}
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav a:not(.nav-user):not(.btn) {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #A4A4A4;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
}
.nav a:not(.nav-user):not(.btn):hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}
.nav a:not(.nav-user):not(.btn).active {
    color: #00FFD9;
    background: rgba(0, 255, 217, 0.08);
}
.nav a:not(.nav-user):not(.btn).active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: #00FFD9;
    border-radius: 1px;
}
.nav-divider {
    width: 1px;
    height: 20px;
    background: #1a2535;
    margin: 0 4px;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 10px;
    transition: background 0.15s;
}
.nav-user:hover {
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-user-name {
    font-size: 13px;
}
.nav-admin-badge {
    display: inline-block;
    background: #00FFD9;
    color: #070C19;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #A4A4A4;
    border-radius: 1px;
    transition: all 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 640px) {
    .hamburger { display: flex; }
    .nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #0a1020;
        border-bottom: 1px solid #1a2535;
        flex-direction: column;
        padding: 8px 20px 16px;
        gap: 2px;
        z-index: 99;
    }
    .nav.open { display: flex; }
    .nav a:not(.nav-user):not(.btn) {
        width: 100%;
        text-align: left;
        padding: 10px 12px;
    }
    .nav a:not(.nav-user):not(.btn).active::after { display: none; }
    .nav-divider { width: 100%; height: 1px; margin: 4px 0; }
    .nav-user { width: 100%; justify-content: flex-start; padding: 10px 12px; }
    .nav .btn { width: 100%; justify-content: center; margin-top: 4px; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: 1px solid #1a2535;
    border-radius: 10px;
    background: #0a1020;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover {
    background: #12203a;
    text-decoration: none;
    color: #fff;
}
.btn-primary {
    background: #00FFD9;
    color: #070C19;
    border-color: #00FFD9;
    font-weight: 600;
}
.btn-primary:hover {
    background: #00e6c4;
    color: #070C19;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.btn-logout {
    background: transparent;
    color: #A4A4A4 !important;
    border-color: #1a2535 !important;
}
.btn-logout:hover {
    color: #ff6b6b !important;
    border-color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.08);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
    width: 100%;
}

/* Cards */
.card {
    background: #0a1020;
    border: 1px solid #1a2535;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat-card {
    background: #0a1020;
    border: 1px solid #1a2535;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}
.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #00FFD9;
}
.stat-label {
    font-size: 13px;
    color: #A4A4A4;
    margin-top: 4px;
}

/* Table */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #1a2535;
}
th {
    background: #0a1020;
    font-weight: 600;
    font-size: 13px;
    color: #A4A4A4;
}
tr:hover {
    background: #0d1528;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #A4A4A4;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #1a2535;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.15s;
    background: #0a1020;
    color: #e0e0e0;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00FFD9;
    box-shadow: 0 0 0 3px rgba(0, 255, 219, 0.1);
}
.form-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 4px;
}
.input-error {
    border-color: #ff6b6b !important;
}

/* Avatar upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #1a2535;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #00FFD9;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}
.alert-success {
    background: rgba(0, 255, 219, 0.1);
    color: #00FFD9;
    border: 1px solid rgba(0, 255, 219, 0.2);
}

/* Footer */
.footer {
    background: #0a1020;
    border-top: 1px solid #1a2535;
    margin-top: auto;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    font-size: 13px;
    color: #A4A4A4;
    text-align: center;
}

/* Auth form */
.auth-form {
    max-width: 420px;
    margin: 0 auto;
}
.auth-form .card {
    padding: 32px;
}
.auth-form .card-title {
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
}

/* User avatar small */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #1a2535;
}
.user-avatar-lg {
    width: 100px;
    height: 100px;
}

/* Progress bar colors */
.bar-mint { background: linear-gradient(90deg, #00FFD9, #3EABA4); }
.bar-fire { background: linear-gradient(90deg, #f97316, #ef4444); }
.bar-violet { background: linear-gradient(90deg, #a855f7, #6366f1); }
.bar-gold { background: linear-gradient(90deg, #eab308, #f97316); }
.pct-mint { color: #00FFD9; }
.pct-fire { color: #f97316; }
.pct-violet { color: #a855f7; }
.pct-gold { color: #eab308; }

/* Loading spinner */
.spinner { display:inline-block; width:20px; height:20px; border:2px solid #1a2535; border-top-color:#00FFD9; border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Day dots */
.days-row { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.day-dot { width:10px; height:10px; border-radius:50%; background:#253045; transition:all 0.2s; }
.day-done { background:#00FFD9; box-shadow:0 0 6px rgba(0,255,219,0.4); }
.day-missed { background:#ff6b6b; box-shadow:0 0 6px rgba(255,107,107,0.4); }
.day-today { background:#ffffff; box-shadow:0 0 8px rgba(255,255,255,0.6); animation:pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ box-shadow:0 0 4px rgba(0,255,219,0.3); } 50%{ box-shadow:0 0 10px rgba(0,255,219,0.7); } }

/* Ripple play button */
.ripple-play {
	cursor:pointer;
	    border: 0px;
    outline: none;
    position: absolute;
	background-color: rgba(0, 0, 0, 44%);
	font-size: 30px;
	color: #00dabf;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 217, 0.4);
    animation: ripple 3s infinite;
}
.ripple-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 217, 0.4);
    -webkit-animation-delay: .6s;
    animation-delay: .6s;
    -webkit-animation: ripple 3s infinite;
    animation: ripple 6s infinite;
}
.ripple-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 217, 0.4);
    -webkit-animation-delay: .9s;
    animation-delay: .9s;
    -webkit-animation: ripple 3s infinite;
    animation: ripple 9s infinite;
}

@keyframes ripple {
70% {
	box-shadow:0 0 0 50px transparent;
}
100% {
    box-shadow: 0 0 0 0 transparent;
}
}




/* Popup overlay */
.popup-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); z-index:1000; align-items:center; justify-content:center; }
.popup-overlay.active { display:flex; }
.popup-box { background:#0d1528; border:1px solid #1a2535; border-radius:16px; padding:28px 32px; max-width:420px; width:90%; text-align:center; animation:popupIn 0.2s ease-out; }
@keyframes popupIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.popup-icon { font-size:32px; margin-bottom:12px; }
.popup-title { font-size:18px; font-weight:700; color:#fff; margin-bottom:8px; }
.popup-msg { font-size:14px; color:#A4A4A4; line-height:1.6; margin-bottom:20px; }
.popup-btns { display:flex; gap:10px; justify-content:center; }

/* Alert (вместо старых .alert) */
.alert { display:none; padding:12px 16px; border-radius:10px; margin-bottom:16px; font-size:14px; }
.alert.show { display:block; }

/* Habit styles */
.habit-label { font-size: 18px; font-weight: 600; color: #ccc; }
.habit-dates { font-size: 12px; color: #8f9ba6; letter-spacing: 1px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.habit-dates svg { width: 14px; height: 14px; flex-shrink: 0; }
