:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* ============ HEADER ============ */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.header-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-size: 0.85rem;
    opacity: 0.85;
    font-style: italic;
}

/* ============ NAVIGATION ============ */
.nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn,
.nav-link {
    padding: 0.75rem 1.5rem;
    border: none;
    background-color: var(--light-bg);
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-btn:hover,
.nav-link:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.nav-btn.active {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* ============ SUMMARY CARDS ============ */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.summary-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.summary-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* ============ TARGETS GRID ============ */
.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem 2rem 1rem;
}

.target-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.target-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.target-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.target-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--light-bg);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    transition: width 0.3s ease;
    border-radius: 5px;
}

.progress-fill.completed {
    background: linear-gradient(90deg, var(--success-color), #1abc9c);
}

.progress-fill.partial {
    background: linear-gradient(90deg, var(--warning-color), var(--secondary-color));
}

.target-unit {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ============ FORMS ============ */
.targets-form {
    padding: 0 1rem 2rem 1rem;
}

.form-item {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-item-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.form-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-detail {
    display: flex;
    flex-direction: column;
}

.form-detail label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.form-detail span {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--light-bg);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-input-group .unit {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.form-item-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.item-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: none;
}

.item-status.show {
    display: inline-block;
}

.item-status.success {
    background-color: #d4edda;
    color: #155724;
}

.item-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.item-status.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ============ BUTTONS ============ */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #229954;
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #c0392b;
    box-shadow: var(--shadow);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ============ ADMIN CONTROLS ============ */
.admin-controls {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ============ MESSAGES ============ */
.message {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.show {
    display: block;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ SPINNER ============ */
.spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.spinner.show {
    display: flex;
}

.spinner-inner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ RESPONSIVE MOBILE ============ */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.95rem;
    }

    .targets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .summary-card {
        padding: 1.25rem;
    }

    .summary-value {
        font-size: 1.75rem;
    }

    .target-card {
        padding: 1.25rem;
    }

    .form-item {
        padding: 1.25rem;
    }

    .form-item-details {
        grid-template-columns: 1fr;
    }

    .nav {
        flex-direction: column;
    }

    .nav-btn,
    .nav-link {
        width: 100%;
        text-align: center;
    }

    .admin-controls {
        flex-direction: column;
    }

    .admin-controls .btn {
        width: 100%;
    }

    .form-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .form-input-group input {
        width: 100%;
    }

    .form-input-group .unit {
        display: none;
    }

    .form-item-actions {
        flex-direction: column;
    }

    .form-item-actions .btn {
        width: 100%;
    }

    .progress-label {
        font-size: 0.85rem;
    }

    .target-name {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .header {
        padding: 1.25rem 0.75rem;
        margin-bottom: 1rem;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .header-subtitle {
        font-size: 0.85rem;
    }

    .summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0 0.75rem;
        margin-bottom: 1rem;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-label {
        font-size: 0.75rem;
    }

    .summary-value {
        font-size: 1.5rem;
    }

    .targets-grid,
    .targets-form {
        padding: 0 0.75rem 1.5rem 0.75rem;
        gap: 0.75rem;
    }

    .target-card,
    .form-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .target-name {
        font-size: 0.9rem;
    }

    .target-description {
        font-size: 0.8rem;
    }

    .progress-label {
        font-size: 0.8rem;
    }

    .nav {
        padding: 0.75rem;
        margin-bottom: 1rem;
        gap: 0.25rem;
    }

    .nav-btn,
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .admin-controls {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .last-updated {
        font-size: 0.75rem;
    }
}
