/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1a5fb4;      /* Bleu Djibouti */
    --secondary: #26a269;    /* Vert */
    --accent: #e52b2b;       /* Rouge */
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ===== MOBILE FIRST ===== */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== HEADER ===== */
.app-header {
    background: linear-gradient(135deg, var(--primary), #0e3d7a);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.app-header .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.app-header h1 span { color: #ffd700; }

.user-info {
    font-size: 0.8rem;
    opacity: 0.9;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.2s;
}

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

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

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

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

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    width: auto;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-received { background: #dbeafe; color: #1e40af; }
.badge-validated { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #e0e7ff; color: #3730a3; }

/* ===== TRANSFER LIST ===== */
.transfer-item {
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}

.transfer-item .ref {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: monospace;
}

.transfer-item .amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 6px 0;
}

.transfer-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 8px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

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

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ===== NAV BOTTOM ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.7rem;
}

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

.nav-item .icon {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 2px;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary), #0e3d7a);
}

.login-logo {
    text-align: center;
    color: white;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 2.2rem;
    font-weight: 800;
}

.login-logo h1 span { color: #ffd700; }

.login-logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 8px;
}

.login-form {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ===== TABLE ADMIN ===== */
.admin-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
}

.admin-table th {
    background: var(--primary);
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

/* ===== RESPONSIVE TABLET/DESKTOP ===== */
@media (min-width: 768px) {
    .container { max-width: 720px; padding: 24px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .bottom-nav { display: none; }
    .desktop-nav { display: flex !important; gap: 16px; }
}

.desktop-nav { display: none; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.pb-nav { padding-bottom: 80px; }