/* Ekspedisyon Manager - Client CSS */
*, *::before, *::after { box-sizing: border-box; }
img, video, canvas, svg { max-width: 100%; height: auto; }

.ek-client-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.ek-dashboard-header {
    background: linear-gradient(135deg, #1a5276, #2980b9);
    color: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.ek-profile-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ek-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    flex-shrink: 0;
}

.ek-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ek-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

.ek-profile-info h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.ek-profile-info p {
    margin: 3px 0;
    font-size: 14px;
    opacity: 0.9;
}

.ek-address-section {
    background: #e8f4fd;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.ek-address-section h3 {
    margin: 0 0 10px 0;
    color: #1a5276;
}

.ek-address-box {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
}

.ek-address-box p {
    margin: 3px 0;
}

.ek-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.ek-stat-box {
    background: #fff;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ek-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1a5276;
}

.ek-stat-label {
    font-size: 13px;
    color: #666;
}

.ek-finance-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ek-finance-section h3 {
    margin: 0 0 15px 0;
    color: #1a5276;
}

.ek-finance-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ek-finance-item {
    font-size: 15px;
}

.ek-finance-label {
    color: #666;
}

.ek-finance-value {
    font-weight: 700;
    color: #1a5276;
}

.ek-packages-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ek-packages-section h3 {
    margin: 0 0 15px 0;
    color: #1a5276;
}

.ek-packages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ek-package-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background 0.2s;
}

.ek-package-item:hover {
    background: #f8f9fa;
}

.ek-package-photo {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.ek-package-info {
    flex: 1;
}

.ek-package-tracking {
    font-weight: 700;
    color: #1a5276;
    font-size: 15px;
}

.ek-package-desc {
    color: #555;
    font-size: 13px;
}

.ek-package-status {
    font-size: 13px;
    margin-top: 2px;
}

.ek-package-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 16px;
}

.ek-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.ek-btn-view-all {
    display: inline-block;
    margin-top: 10px;
    color: #1a5276;
    text-decoration: none;
    font-weight: 600;
}

.ek-btn-view-all:hover {
    text-decoration: underline;
}

/* Scanner */
.ek-scanner-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.ek-scanner-header {
    text-align: center;
    margin-bottom: 20px;
}

.ek-scanner-header h2 {
    color: #1a5276;
}

.ek-scanner-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ek-scan-result,
.ek-scan-error {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ek-scan-message {
    font-size: 18px;
    margin-bottom: 15px;
}

.ek-btn-confirm {
    background: #27ae60;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.ek-btn-confirm:hover {
    background: #1e8449;
}

.ek-btn-retry {
    background: #3498db;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.ek-btn-retry:hover {
    background: #2e86c1;
}

@media (max-width: 768px) {
    .ek-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ek-profile-section {
        flex-direction: column;
        text-align: center;
    }
    .ek-package-item {
        flex-wrap: wrap;
    }
    .ek-package-price {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 480px) {
	.ek-stats-grid {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
	.ek-stat-number {
		font-size: 22px;
	}
	.ek-avatar {
		width: 60px;
		height: 60px;
		font-size: 24px;
	}
	.ek-dashboard-header {
		padding: 15px;
	}
	.ek-finance-row {
		gap: 15px;
	}
	.ek-client-dashboard { padding: 12px; }
	.ek-register-wrap,
	.ek-tracking-wrap { padding: 12px; }
	.ek-tracking-search { flex-direction: column; }
	.ek-scanner-container { padding: 12px; }
	.ek-package-detail-photo { max-width: 100%; }
}

@media (max-width: 360px) {
	.ek-stats-grid { grid-template-columns: 1fr; }
	.ek-role-nav-links { gap: 4px; }
	.ek-role-nav-links a { padding: 7px 10px; font-size: 12.5px; }
	.ek-btn { width: 100%; text-align: center; }
	.ek-proof-modal-actions { flex-direction: column; }
	.ek-proof-modal-actions .ek-btn { width: 100%; }
}

/* ================================================================
   NOUVO: Fòm Enskripsyon (paj ki te manke anvan)
   ================================================================ */
.ek-register-wrap { max-width: 600px; margin: 0 auto; }

/* ================================================================
   NOUVEAU : Pages de connexion/deconnexion dediees (includes/auth.php)
   ================================================================ */
.ek-auth-wrap { max-width: 420px; margin: 60px auto; padding: 30px; background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(15,23,42,0.08); }
.ek-auth-form p { margin-bottom: 16px; }
.ek-auth-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: #374151; }
.ek-auth-form input[type="text"],
.ek-auth-form input[type="password"] { width: 100%; padding: 10px 12px; border: 1px solid #d5d9de; border-radius: 6px; box-sizing: border-box; }
@media (max-width: 480px) {
	.ek-auth-wrap { margin: 20px auto; padding: 20px; }
}
.ek-notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.ek-notice-success { background: #e8f6ec; color: #1e6b3f; border: 1px solid #b7e4c7; }
.ek-notice-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2c0; }
.ek-notice-error ul { margin: 0; padding-left: 20px; }
.ek-notice-info { background: #e8f2fd; color: #1a5276; border: 1px solid #bcd9f5; }

/* ---- Connexion avec Google ---- */
.ek-auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #9aa3ae; font-size: 12px; }
.ek-auth-divider::before,
.ek-auth-divider::after { content: ''; flex: 1; height: 1px; background: #e5e8ec; }
.ek-btn-google {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; padding: 10px 16px; border: 1px solid #d5d9de; border-radius: 6px;
	background: #fff; color: #3c4043; font-weight: 600; font-size: 14px;
	text-decoration: none; box-sizing: border-box; transition: background 0.15s ease, box-shadow 0.15s ease;
}
.ek-btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(15,23,42,0.08); }

/* ---- Menu de navigation par role (haut de chaque page externe) ---- */
.ek-role-nav {
	display: flex; align-items: center; justify-content: space-between;
	max-width: 900px; margin: 0 auto 20px; padding: 12px 20px;
	background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(15,23,42,0.06);
	flex-wrap: wrap; gap: 10px;
}
.ek-role-nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.ek-role-nav-links a {
	padding: 8px 14px; border-radius: 6px; text-decoration: none;
	color: #374151; font-size: 13.5px; font-weight: 600; transition: background 0.15s ease, color 0.15s ease;
}
.ek-role-nav-links a:hover { background: #f1f3f5; }
.ek-role-nav-links a.ek-role-nav-active { background: #1a5276; color: #fff; }
.ek-role-nav-right { display: flex; align-items: center; gap: 14px; }
.ek-role-nav-logout { color: #b3261e; font-size: 13px; font-weight: 600; text-decoration: none; padding: 8px 12px; }
.ek-role-nav-logout:hover { text-decoration: underline; }

/* ---- Sélecteur de langue ---- */
.ek-lang-switcher { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ek-lang-switcher select {
	padding: 5px 8px; border: 1px solid #d5d9de; border-radius: 6px; font-size: 12.5px; color: #374151; background: #fff;
}
.ek-lang-switcher a { color: #6b7280; text-decoration: none; padding: 4px 6px; border-radius: 4px; }
.ek-lang-switcher a:hover { background: #f1f3f5; }
.ek-lang-switcher a.ek-lang-active { color: #1a5276; font-weight: 700; }

@media (max-width: 640px) {
	.ek-role-nav { flex-direction: column; align-items: stretch; }
	.ek-role-nav-links { justify-content: center; }
	.ek-role-nav-right { justify-content: center; }
	.ek-role-nav-logout { text-align: center; }
}

/* ---- Statistiques agent (page scanner externe) ---- */
.ek-agent-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.ek-agent-stat-box { background: #fff; border-left: 4px solid #1a5276; border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,23,42,0.06); }
.ek-agent-stat-box.ek-agent-stat-warning { border-left-color: #b9770e; }
.ek-agent-stat-box.ek-agent-stat-success { border-left-color: #1e8449; }
.ek-agent-stat-number { display: block; font-size: 24px; font-weight: 700; color: #1c2b39; }
.ek-agent-stat-label { display: block; font-size: 11.5px; color: #6b7280; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ---- Modal de preuve de remise (photo + signature) ---- */
.ek-proof-modal {
	position: fixed; inset: 0; background: rgba(15,23,42,0.55);
	z-index: 9999; align-items: center; justify-content: center; padding: 16px;
}
.ek-proof-modal-content {
	background: #fff; border-radius: 12px; padding: 24px; max-width: 460px; width: 100%;
	max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(15,23,42,0.25);
}
.ek-proof-modal-content h3 { margin-top: 0; }
.ek-proof-modal-content label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.ek-proof-modal-content input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid #d5d9de; border-radius: 6px; box-sizing: border-box; margin-bottom: 10px; }
.ek-proof-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.ek-register-form p { margin-bottom: 14px; }
.ek-register-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.ek-register-form input[type="text"],
.ek-register-form input[type="email"],
.ek-register-form input[type="password"],
.ek-register-form select,
.ek-register-form textarea {
	width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 15px;
}
.ek-register-form textarea { min-height: 80px; }
.ek-btn { display: inline-block; padding: 10px 20px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; font-size: 15px; }
.ek-btn-primary { background: #1a5276; color: #fff; }
.ek-btn-secondary { background: #f1f3f5; color: #374151; border: 1px solid #d5d9de; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.ek-btn-secondary:hover { background: #e5e8ec; }
#ek-profile-address-form textarea { width: 100%; padding: 10px; border: 1px solid #d5d9de; border-radius: 6px; box-sizing: border-box; margin-bottom: 8px; }
#ek-profile-address-status { margin-left: 8px; font-size: 13px; color: #6b7280; }
.ek-btn-primary:hover { background: #154360; }

/* ================================================================
   NOUVO: Paj Tracking Piblik
   ================================================================ */
.ek-tracking-wrap { max-width: 500px; margin: 0 auto; padding: 20px; }
.ek-tracking-search { display: flex; gap: 8px; margin: 16px 0; }
.ek-tracking-search input { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 6px; }

/* NOUVO: Koli klikab (dashboard kliyan) */
.ek-package-clickable { cursor: pointer; }
.ek-package-detail { background: #f8f9fa; padding: 15px; border-radius: 8px; margin: -6px 0 10px; }
.ek-package-detail-photo { max-width: 200px; border-radius: 8px; margin-bottom: 10px; }
.ek-address-name { font-weight: 700; font-size: 15px; letter-spacing: 0.5px; }