:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FFF0EB;
    --secondary: #2D3436;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #D63031;
    --info: #0984E3;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #6C757D;
    --gray-700: #495057;
    --gray-900: #212529;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

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

.logo {
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
}

.subtitle {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-block {
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

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

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* App Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.app-header .logo-icon {
    font-size: 28px;
    margin: 0;
}

.app-header h1 {
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-500);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Navigation */
.app-nav {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 8px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item .icon {
    font-size: 22px;
}

/* Main Content */
.app-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 90px;
    overflow-y: auto;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--secondary);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.list-item:active {
    transform: scale(0.98);
}

.list-item-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-info p {
    font-size: 12px;
    color: var(--gray-500);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-planifie {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-en-cours {
    background: #E3F2FD;
    color: var(--info);
}

.badge-termine {
    background: #E8F5E9;
    color: var(--success);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 11px;
    text-transform: uppercase;
}

/* Planning Form */
.planning-form {
    display: grid;
    gap: 12px;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.size-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.size-input label {
    font-size: 11px;
    color: var(--gray-500);
    text-align: center;
}

.size-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* Ingredients */
.ingredient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

.ingredient-row:last-child {
    border-bottom: none;
}

.ingredient-info {
    flex: 1;
}

.ingredient-name {
    font-weight: 500;
    font-size: 14px;
}

.ingredient-ref {
    font-size: 11px;
    color: var(--gray-500);
}

.ingredient-qty {
    text-align: right;
}

.ingredient-estimation {
    font-weight: 600;
    color: var(--primary);
}

.ingredient-unit {
    font-size: 12px;
    color: var(--gray-500);
}

/* Input QTE Réelle */
.real-qty-input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    text-align: right;
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

/* Date picker */
.date-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.date-chip {
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.date-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.mt-2 {
    margin-top: 12px;
}

.mb-2 {
    margin-bottom: 12px;
}

/* Admin section */
.admin-only {
    display: none;
}

.admin-only.visible {
    display: block;
}
