:root {
    /* Paleta de culori modernă */
    --primary: #4361ee;
    --primary-hover: #3a0ca3;
    --bg-color: #f4f7f6;
    --surface: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --border: #edf2f4;
    --danger: #e63946;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 0;
    padding-bottom: 40px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Container global */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   Zona de Autentificare
   ========================================= */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 20px;
    color: var(--text-main);
}

/* =========================================
   Formulare și Butoane
   ========================================= */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-color);
    color: var(--text-main);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Customizare iconiță calendar */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

/* =========================================
   Dashboard & Liste Task-uri
   ========================================= */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 25px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: none;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-bar .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.header-bar .logo span {
    color: var(--text-main);
    -webkit-text-fill-color: var(--text-main);
    font-size: 1.35em;
    font-weight: 900;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: var(--bg-color);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-theme {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    color: var(--text-main);
    padding: 0;
}

.btn-theme:hover {
    background: var(--border);
    transform: scale(1.1);
}

.btn-logout {
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: #fff0f0;
    color: var(--danger);
    border-color: var(--danger);
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.task-details {
    background: var(--bg-color);
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 20px;
}

.task-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.task-meta strong {
    color: var(--text-main);
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    background: var(--surface);
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.task-priority {
    font-size: 0.8rem;
    background: var(--border);
    padding: 4px 8px;
    border-radius: 12px;
    color: var(--text-muted);
    margin-left: 10px;
}

.alert-error {
    background: #ffe3e6;
    color: var(--danger);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    border: 1px solid #ffc2c7;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: monospace;
    margin-top: 15px;
}

/* =========================================
   Floating Action Button (FAB)
   ========================================= */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 1000;
    border: none;
}

.fab-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

/* =========================================
   Modal / Popup
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 1001;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1; visibility: visible;
}

.modal-content {
    background: var(--surface);
    padding: 30px; border-radius: var(--radius);
    width: 100%; max-width: 600px;
    box-shadow: var(--shadow);
    position: relative;
    max-height: 90vh; overflow-y: auto;
}

.modal-close {
    position: absolute; top: 15px; right: 15px;
    font-size: 24px; cursor: pointer; color: var(--text-muted);
    background: none; border: none; padding: 0; line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}